Skip to contentSkip to conversation

: netdev: Add addr_list_lock to struct net_device.

PATCH In review David Miller 1 participant 1 message Jun 24, 2008

Subsystems (2)
lore
Share & tools
lore

David Miller

author maintainer
#0 lore raw

PATCH 1/3 : netdev: Add addr_list_lock to struct net_device.

netdev: Add addr_list_lock to struct net_device.

This will be used to protect the per-device unicast and multicast address lists, as well as the callbacks into the drivers which configure such state such as ->set_rx_mode() and ->set_multicast_list().

---
 include/linux/netdevice.h |    1 +
 net/core/dev.c            |    1 +
 2 files changed, 2 insertions(+), 0 deletions(-)
include/linux/netdevice.h +1 -0
index 1304ad2..fb5a0ec 100644
@@ -590,6 +590,7 @@ struct net_device
 	unsigned char		addr_len;	/* hardware address length	*/
 	unsigned short          dev_id;		/* for shared network cards */
 
+	spinlock_t		addr_list_lock;
 	struct dev_addr_list	*uc_list;	/* Secondary unicast mac addresses */
 	int			uc_count;	/* Number of installed ucasts	*/
 	int			uc_promisc;
net/core/dev.c +1 -0
index f6944ec..7b50e8d 100644
@@ -3784,6 +3784,7 @@ int register_netdevice(struct net_device *dev)
 	net = dev_net(dev);
 
 	spin_lock_init(&dev->queue_lock);
+	spin_lock_init(&dev->addr_list_lock);
 	spin_lock_init(&dev->_xmit_lock);
 	netdev_set_lockdep_class(&dev->_xmit_lock, dev->type);
 	dev->xmit_lock_owner = -1;
Signature · 1 line
1.5.6