]> git.kernelconcepts.de Git - karo-tx-linux.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)
commit8e05fd7166c6123334b7a739a697d677747aa462
tree92a66ecee7e1ff94f0314cd32e4fd65e2fd12741
parent448b128a14501543748514a4f9adedd3c0da2e85
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