]> git.baikalelectronics.ru Git - kernel.git/commit
fib: hook IPv4 fib for hardware offload
authorScott Feldman <sfeldma@gmail.com>
Fri, 6 Mar 2015 05:21:19 +0000 (21:21 -0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 6 Mar 2015 05:24:58 +0000 (00:24 -0500)
commit59932b6aaf9942cc168216610cd5a8b59a2514f3
tree92a66ecee7e1ff94f0314cd32e4fd65e2fd12741
parentbc4c060ca33cbfa53584a01b6a36e3ca69d3c166
fib: hook IPv4 fib for hardware offload

Call into the switchdev driver any time an IPv4 fib entry is
added/modified/deleted from the kernel's FIB.  The switchdev driver may or
may not install the route to the offload device.  In the case where the
driver tries to install the route and something goes wrong (device's routing
table is full, etc), then all of the offloaded routes will be flushed from the
device, route forwarding falls back to the kernel, and no more routes are
offloading.

We can refine this logic later.  For now, use the simplist model of offloading
routes up to the point of failure, and then on failure, undo everything and
mark IPv4 offloading disabled.

Signed-off-by: Scott Feldman <sfeldma@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/switchdev.h
net/ipv4/fib_trie.c
net/switchdev/switchdev.c