aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/netdevice.h
diff options
context:
space:
mode:
authorJiri Pirko <jiri@resnulli.us>2013-01-03 17:48:49 -0500
committerDavid S. Miller <davem@davemloft.net>2013-01-04 16:31:49 -0500
commit9ff162a8b96c96238773972e26288a366e403b0c (patch)
treeae74065e46364c807a1996e5268aec349d9d86d4 /include/linux/netdevice.h
parent04e406dcc54cfd84d333ea673fa986fb5a1840e7 (diff)
net: introduce upper device lists
This lists are supposed to serve for storing pointers to all upper devices. Eventually it will replace dev->master pointer which is used for bonding, bridge, team but it cannot be used for vlan, macvlan where there might be multiple upper present. In case the upper link is replacement for dev->master, it is marked with "master" flag. New upper device list resolves this limitation. Also, the information stored in lists is used for preventing looping setups like "bond->somethingelse->samebond" Signed-off-by: Jiri Pirko <jiri@resnulli.us> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/netdevice.h')
-rw-r--r--include/linux/netdevice.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index c5031a45e185..e324601f48e8 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -1174,6 +1174,8 @@ struct net_device {
1174 * which this device is member of. 1174 * which this device is member of.
1175 */ 1175 */
1176 1176
1177 struct list_head upper_dev_list; /* List of upper devices */
1178
1177 /* Interface address info used in eth_type_trans() */ 1179 /* Interface address info used in eth_type_trans() */
1178 unsigned char *dev_addr; /* hw address, (before bcast 1180 unsigned char *dev_addr; /* hw address, (before bcast
1179 because most packets are 1181 because most packets are
@@ -2636,6 +2638,18 @@ extern int netdev_max_backlog;
2636extern int netdev_tstamp_prequeue; 2638extern int netdev_tstamp_prequeue;
2637extern int weight_p; 2639extern int weight_p;
2638extern int bpf_jit_enable; 2640extern int bpf_jit_enable;
2641
2642extern bool netdev_has_upper_dev(struct net_device *dev,
2643 struct net_device *upper_dev);
2644extern bool netdev_has_any_upper_dev(struct net_device *dev);
2645extern struct net_device *netdev_master_upper_dev_get(struct net_device *dev);
2646extern struct net_device *netdev_master_upper_dev_get_rcu(struct net_device *dev);
2647extern int netdev_upper_dev_link(struct net_device *dev,
2648 struct net_device *upper_dev);
2649extern int netdev_master_upper_dev_link(struct net_device *dev,
2650 struct net_device *upper_dev);
2651extern void netdev_upper_dev_unlink(struct net_device *dev,
2652 struct net_device *upper_dev);
2639extern int netdev_set_master(struct net_device *dev, struct net_device *master); 2653extern int netdev_set_master(struct net_device *dev, struct net_device *master);
2640extern int netdev_set_bond_master(struct net_device *dev, 2654extern int netdev_set_bond_master(struct net_device *dev,
2641 struct net_device *master); 2655 struct net_device *master);