aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/switchdev.h
diff options
context:
space:
mode:
authorScott Feldman <sfeldma@gmail.com>2015-03-06 00:21:19 -0500
committerDavid S. Miller <davem@davemloft.net>2015-03-06 00:24:58 -0500
commit8e05fd7166c6123334b7a739a697d677747aa462 (patch)
tree92a66ecee7e1ff94f0314cd32e4fd65e2fd12741 /include/net/switchdev.h
parent448b128a14501543748514a4f9adedd3c0da2e85 (diff)
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>
Diffstat (limited to 'include/net/switchdev.h')
-rw-r--r--include/net/switchdev.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/net/switchdev.h b/include/net/switchdev.h
index 8d2ac663325a..dc0a5cc7c2c5 100644
--- a/include/net/switchdev.h
+++ b/include/net/switchdev.h
@@ -55,6 +55,7 @@ int netdev_switch_fib_ipv4_add(u32 dst, int dst_len, struct fib_info *fi,
55 u8 tos, u8 type, u32 tb_id); 55 u8 tos, u8 type, u32 tb_id);
56int netdev_switch_fib_ipv4_del(u32 dst, int dst_len, struct fib_info *fi, 56int netdev_switch_fib_ipv4_del(u32 dst, int dst_len, struct fib_info *fi,
57 u8 tos, u8 type, u32 tb_id); 57 u8 tos, u8 type, u32 tb_id);
58void netdev_switch_fib_ipv4_abort(struct fib_info *fi);
58 59
59#else 60#else
60 61
@@ -128,6 +129,10 @@ static inline int netdev_switch_fib_ipv4_del(u32 dst, int dst_len,
128 return 0; 129 return 0;
129} 130}
130 131
132void netdev_switch_fib_ipv4_abort(struct fib_info *fi)
133{
134}
135
131#endif 136#endif
132 137
133#endif /* _LINUX_SWITCHDEV_H_ */ 138#endif /* _LINUX_SWITCHDEV_H_ */