Skip to content

Commit

Permalink
netdevice: add IPv4 fib add/del ops
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Scott Feldman authored and David S. Miller committed Mar 6, 2015
1 parent 37ed949 commit 4586f1b
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions include/linux/netdevice.h
Original file line number Diff line number Diff line change
Expand Up @@ -768,6 +768,8 @@ struct netdev_phys_item_id {
typedef u16 (*select_queue_fallback_t)(struct net_device *dev,
struct sk_buff *skb);

struct fib_info;

/*
* This structure defines the management hooks for network devices.
* The following hooks can be defined; unless noted otherwise, they are
Expand Down Expand Up @@ -1031,6 +1033,14 @@ typedef u16 (*select_queue_fallback_t)(struct net_device *dev,
* int (*ndo_switch_port_stp_update)(struct net_device *dev, u8 state);
* Called to notify switch device port of bridge port STP
* state change.
* int (*ndo_sw_parent_fib_ipv4_add)(struct net_device *dev, __be32 dst,
* int dst_len, struct fib_info *fi,
* u8 tos, u8 type, u32 tb_id);
* Called to add/modify IPv4 route to switch device.
* int (*ndo_sw_parent_fib_ipv4_del)(struct net_device *dev, __be32 dst,
* int dst_len, struct fib_info *fi,
* u8 tos, u8 type, u32 tb_id);
* Called to delete IPv4 route from switch device.
*/
struct net_device_ops {
int (*ndo_init)(struct net_device *dev);
Expand Down Expand Up @@ -1192,6 +1202,18 @@ struct net_device_ops {
struct netdev_phys_item_id *psid);
int (*ndo_switch_port_stp_update)(struct net_device *dev,
u8 state);
int (*ndo_switch_fib_ipv4_add)(struct net_device *dev,
__be32 dst,
int dst_len,
struct fib_info *fi,
u8 tos, u8 type,
u32 tb_id);
int (*ndo_switch_fib_ipv4_del)(struct net_device *dev,
__be32 dst,
int dst_len,
struct fib_info *fi,
u8 tos, u8 type,
u32 tb_id);
#endif
};

Expand Down

0 comments on commit 4586f1b

Please sign in to comment.