switchdev: fix handling for drivers not supporting IPv4 fib add/del ops
authorScott Feldman <sfeldma@gmail.com>
Thu, 11 Jun 2015 00:04:49 +0000 (17:04 -0700)
committerDavid S. Miller <davem@davemloft.net>
Thu, 11 Jun 2015 06:56:34 +0000 (23:56 -0700)
commitaf201f723f694c8bf12f80c39c897371c4800d31
tree029a3cba83d0ef15411d9fe9ab14c10a80b96f50
parent1531407c81830e8b9b0fb00d4f49bcc1ee91dfd1
switchdev: fix handling for drivers not supporting IPv4 fib add/del ops

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.

Reported-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Scott Feldman <sfeldma@gmail.com>
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/switchdev/switchdev.c