mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-23 07:12:09 +00:00
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>
This commit is contained in:
parent
448b128a14
commit
8e05fd7166
3 changed files with 61 additions and 3 deletions
|
@ -55,6 +55,7 @@ int netdev_switch_fib_ipv4_add(u32 dst, int dst_len, struct fib_info *fi,
|
|||
u8 tos, u8 type, u32 tb_id);
|
||||
int netdev_switch_fib_ipv4_del(u32 dst, int dst_len, struct fib_info *fi,
|
||||
u8 tos, u8 type, u32 tb_id);
|
||||
void netdev_switch_fib_ipv4_abort(struct fib_info *fi);
|
||||
|
||||
#else
|
||||
|
||||
|
@ -128,6 +129,10 @@ static inline int netdev_switch_fib_ipv4_del(u32 dst, int dst_len,
|
|||
return 0;
|
||||
}
|
||||
|
||||
void netdev_switch_fib_ipv4_abort(struct fib_info *fi)
|
||||
{
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* _LINUX_SWITCHDEV_H_ */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue