aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorVeaceslav Falico <vfalico@redhat.com>2013-09-25 03:20:09 -0400
committerDavid S. Miller <davem@davemloft.net>2013-09-26 16:02:04 -0400
commit402dae9614557296e84543008a8e582c28fb1db3 (patch)
tree80d4da7981cb8f5f68340e11d2f6449117a15794 /include
parent5249dec7380cb64928d2ae6201028b4da1dceb1e (diff)
net: add netdev_adjacent->private and allow to use it
Currently, even though we can access any linked device, we can't attach anything to it, which is vital to properly manage them. To fix this, add a new void *private to netdev_adjacent and functions setting/getting it (per link), so that we can save, per example, bonding's slave structures there, per slave device. netdev_master_upper_dev_link_private(dev, upper_dev, private) links dev to upper dev and populates the neighbour link only with private. netdev_lower_dev_get_private{,_rcu}() returns the private, if found. CC: "David S. Miller" <davem@davemloft.net> CC: Eric Dumazet <edumazet@google.com> CC: Jiri Pirko <jiri@resnulli.us> CC: Alexander Duyck <alexander.h.duyck@intel.com> Signed-off-by: Veaceslav Falico <vfalico@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r--include/linux/netdevice.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 514045c704a8..75d5beac463b 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -2839,8 +2839,15 @@ extern int netdev_upper_dev_link(struct net_device *dev,
2839 struct net_device *upper_dev); 2839 struct net_device *upper_dev);
2840extern int netdev_master_upper_dev_link(struct net_device *dev, 2840extern int netdev_master_upper_dev_link(struct net_device *dev,
2841 struct net_device *upper_dev); 2841 struct net_device *upper_dev);
2842extern int netdev_master_upper_dev_link_private(struct net_device *dev,
2843 struct net_device *upper_dev,
2844 void *private);
2842extern void netdev_upper_dev_unlink(struct net_device *dev, 2845extern void netdev_upper_dev_unlink(struct net_device *dev,
2843 struct net_device *upper_dev); 2846 struct net_device *upper_dev);
2847extern void *netdev_lower_dev_get_private_rcu(struct net_device *dev,
2848 struct net_device *lower_dev);
2849extern void *netdev_lower_dev_get_private(struct net_device *dev,
2850 struct net_device *lower_dev);
2844extern int skb_checksum_help(struct sk_buff *skb); 2851extern int skb_checksum_help(struct sk_buff *skb);
2845extern struct sk_buff *__skb_gso_segment(struct sk_buff *skb, 2852extern struct sk_buff *__skb_gso_segment(struct sk_buff *skb,
2846 netdev_features_t features, bool tx_path); 2853 netdev_features_t features, bool tx_path);