aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott Feldman <sfeldma@gmail.com>2015-03-06 00:21:14 -0500
committerDavid S. Miller <davem@davemloft.net>2015-03-06 00:24:58 -0500
commit4586f1bb911ce219a4bc1c2a9d6eee2e058b2b51 (patch)
tree742823217dd97108f26c352894743fa680ef7c09
parent37ed9493699cc5dafe1b8725858ef73176fdc9d2 (diff)
netdevice: add IPv4 fib add/del ops
Add two new ndo ops for IPv4 fib offload support, add and del. Add uses modifiy semantics if fib entry already offloaded. Drivers implementing the new ndo ops will return err<0 if programming device fails, for example if device's tables are full. Signed-off-by: Scott Feldman <sfeldma@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--include/linux/netdevice.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 625c8d71511b..45413784a3b1 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -768,6 +768,8 @@ struct netdev_phys_item_id {
768typedef u16 (*select_queue_fallback_t)(struct net_device *dev, 768typedef u16 (*select_queue_fallback_t)(struct net_device *dev,
769 struct sk_buff *skb); 769 struct sk_buff *skb);
770 770
771struct fib_info;
772
771/* 773/*
772 * This structure defines the management hooks for network devices. 774 * This structure defines the management hooks for network devices.
773 * The following hooks can be defined; unless noted otherwise, they are 775 * The following hooks can be defined; unless noted otherwise, they are
@@ -1031,6 +1033,14 @@ typedef u16 (*select_queue_fallback_t)(struct net_device *dev,
1031 * int (*ndo_switch_port_stp_update)(struct net_device *dev, u8 state); 1033 * int (*ndo_switch_port_stp_update)(struct net_device *dev, u8 state);
1032 * Called to notify switch device port of bridge port STP 1034 * Called to notify switch device port of bridge port STP
1033 * state change. 1035 * state change.
1036 * int (*ndo_sw_parent_fib_ipv4_add)(struct net_device *dev, __be32 dst,
1037 * int dst_len, struct fib_info *fi,
1038 * u8 tos, u8 type, u32 tb_id);
1039 * Called to add/modify IPv4 route to switch device.
1040 * int (*ndo_sw_parent_fib_ipv4_del)(struct net_device *dev, __be32 dst,
1041 * int dst_len, struct fib_info *fi,
1042 * u8 tos, u8 type, u32 tb_id);
1043 * Called to delete IPv4 route from switch device.
1034 */ 1044 */
1035struct net_device_ops { 1045struct net_device_ops {
1036 int (*ndo_init)(struct net_device *dev); 1046 int (*ndo_init)(struct net_device *dev);
@@ -1192,6 +1202,18 @@ struct net_device_ops {
1192 struct netdev_phys_item_id *psid); 1202 struct netdev_phys_item_id *psid);
1193 int (*ndo_switch_port_stp_update)(struct net_device *dev, 1203 int (*ndo_switch_port_stp_update)(struct net_device *dev,
1194 u8 state); 1204 u8 state);
1205 int (*ndo_switch_fib_ipv4_add)(struct net_device *dev,
1206 __be32 dst,
1207 int dst_len,
1208 struct fib_info *fi,
1209 u8 tos, u8 type,
1210 u32 tb_id);
1211 int (*ndo_switch_fib_ipv4_del)(struct net_device *dev,
1212 __be32 dst,
1213 int dst_len,
1214 struct fib_info *fi,
1215 u8 tos, u8 type,
1216 u32 tb_id);
1195#endif 1217#endif
1196}; 1218};
1197 1219