switchdev: fix handling for drivers not supporting IPv4 fib add/del ops
Subsystems (3)
PATCH 1/1 switchdev: fix handling for drivers not supporting IPv4 fib add/del ops
From: Scott Feldman <[email protected]>
If CONFIG_NET_SWITCHDEV is enabled, but port driver does not implement support for IPv4 FIB add/del ops, don't fail route add/del offload operations. Route adds will not be marked as OFFLOAD. Routes will be installed in the kernel FIB, as usual.
This was report/fixed by Florian when testing DSA driver with net-next on devices with L2 offload support but no L3 offload support. What he reported was an initial route installed from DHCP client would fail (route not installed to kernel FIB). This was triggering the setting of ipv4.fib_offload_disabled, which would disable route offloading after the first failure. So subsequent attempts to install the route would succeed.
There is follow-on work/discussion to address the handling of route install failures, but for now, let's differentiate between no support and failed support.
--- net/switchdev/switchdev.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
net/switchdev/switchdev.c +2 -2
@@ -853,7 +853,7 @@ int switchdev_fib_ipv4_add(u32 dst, int dst_len, struct fib_info *fi,if (!err) fi->fib_flags |=RTNH_F_OFFLOAD ; -return err; +return err == -EOPNOTSUPP ?0 : err; }EXPORT_SYMBOL_GPL (switchdev_fib_ipv4_add);
@@ -898,7 +898,7 @@ int switchdev_fib_ipv4_del(u32 dst, int dst_len, struct fib_info *fi,if (!err) fi->fib_flags &= ~RTNH_F_OFFLOAD ; -return err; +return err == -EOPNOTSUPP ?0 : err; }EXPORT_SYMBOL_GPL (switchdev_fib_ipv4_del);
Signature · 1 line
1.7.10.4
Quoted 14 lines · On 10/06/15 17:04, [email protected] wrote:
From: Scott Feldman <[email protected]>
If
CONFIG_NET_SWITCHDEVis enabled, but port driver does not implement support for IPv4 FIB add/del ops, don't fail route add/del offload operations. Route adds will not be marked as OFFLOAD. Routes will be installed in the kernel FIB, as usual.This was report/fixed by Florian when testing DSA driver with net-next on devices with L2 offload support but no L3 offload support. What he reported was an initial route installed from DHCP client would fail (route not installed to kernel FIB). This was triggering the setting of ipv4.fib_offload_disabled, which would disable route offloading after the first failure. So subsequent attempts to install the route would succeed.
Quoted 6 lines
There is follow-on work/discussion to address the handling of route install failures, but for now, let's differentiate between no support and failed support.
Reported-by Florian Fainelli <[email protected]>Signed-off-by Scott Feldman <[email protected]>
Quoted 27 lines
--- net/switchdev/switchdev.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)net/switchdev/switchdev.c +2
-2@@ -853,7 +853,7 @@ int switchdev_fib_ipv4_add(u32 dst, int dst_len, struct fib_info *fi,if (!err) fi->fib_flags |=RTNH_F_OFFLOAD ; -return err; +return err == -EOPNOTSUPP ?0 : err; }EXPORT_SYMBOL_GPL (switchdev_fib_ipv4_add);@@ -898,7 +898,7 @@ int switchdev_fib_ipv4_del(u32 dst, int dst_len, struct fib_info *fi,if (!err) fi->fib_flags &= ~RTNH_F_OFFLOAD ; -return err; +return err == -EOPNOTSUPP ?0 : err; }EXPORT_SYMBOL_GPL (switchdev_fib_ipv4_del);
Signature · 1 line
Florian
From: [email protected]
Date: Wed, 10 Jun 2015 17:04:49 -0700
Quoted 14 lines
From: Scott Feldman <[email protected]>
If
CONFIG_NET_SWITCHDEVis enabled, but port driver does not implement support for IPv4 FIB add/del ops, don't fail route add/del offload operations. Route adds will not be marked as OFFLOAD. Routes will be installed in the kernel FIB, as usual.This was report/fixed by Florian when testing DSA driver with net-next on devices with L2 offload support but no L3 offload support. What he reported was an initial route installed from DHCP client would fail (route not installed to kernel FIB). This was triggering the setting of ipv4.fib_offload_disabled, which would disable route offloading after the first failure. So subsequent attempts to install the route would succeed.
Quoted 6 lines
There is follow-on work/discussion to address the handling of route install failures, but for now, let's differentiate between no support and failed support.
Reported-by Florian Fainelli <[email protected]>Signed-off-by Scott Feldman <[email protected]>
Applied, thanks everyone.