]> 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)
commit9bf1751d4d8e29d485189e9734563e0d04fb08bf
tree92a66ecee7e1ff94f0314cd32e4fd65e2fd12741
parentaae8de8320c5c6fede85b5d78cdf66add3631a11
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