diff options
author | Jiri Pirko <jpirko@redhat.com> | 2009-05-22 19:22:17 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-05-30 01:12:32 -0400 |
commit | ccffad25b5136958d4769ed6de5e87992dd9c65c (patch) | |
tree | cd5f36fe67f4deeae23d76436f7a032a201cba44 /include/linux/netdevice.h | |
parent | ae63e808f508c38fe65e23a1480c85d5bd00ecbd (diff) |
net: convert unicast addr list
This patch converts unicast address list to standard list_head using
previously introduced struct netdev_hw_addr. It also relaxes the
locking. Original spinlock (still used for multicast addresses) is not
needed and is no longer used for a protection of this list. All
reading and writing takes place under rtnl (with no changes).
I also removed a possibility to specify the length of the address
while adding or deleting unicast address. It's always dev->addr_len.
The convertion touched especially e1000 and ixgbe codes when the
change is not so trivial.
Signed-off-by: Jiri Pirko <jpirko@redhat.com>
drivers/net/bnx2.c | 13 +--
drivers/net/e1000/e1000_main.c | 24 +++--
drivers/net/ixgbe/ixgbe_common.c | 14 ++--
drivers/net/ixgbe/ixgbe_common.h | 4 +-
drivers/net/ixgbe/ixgbe_main.c | 6 +-
drivers/net/ixgbe/ixgbe_type.h | 4 +-
drivers/net/macvlan.c | 11 +-
drivers/net/mv643xx_eth.c | 11 +-
drivers/net/niu.c | 7 +-
drivers/net/virtio_net.c | 7 +-
drivers/s390/net/qeth_l2_main.c | 6 +-
drivers/scsi/fcoe/fcoe.c | 16 ++--
include/linux/netdevice.h | 18 ++--
net/8021q/vlan.c | 4 +-
net/8021q/vlan_dev.c | 10 +-
net/core/dev.c | 195 +++++++++++++++++++++++++++-----------
net/dsa/slave.c | 10 +-
net/packet/af_packet.c | 4 +-
18 files changed, 227 insertions(+), 137 deletions(-)
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/netdevice.h')
-rw-r--r-- | include/linux/netdevice.h | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 1eaf5ae14fea..bbfabf3012b6 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
@@ -215,9 +215,12 @@ struct netdev_hw_addr { | |||
215 | struct list_head list; | 215 | struct list_head list; |
216 | unsigned char addr[MAX_ADDR_LEN]; | 216 | unsigned char addr[MAX_ADDR_LEN]; |
217 | unsigned char type; | 217 | unsigned char type; |
218 | #define NETDEV_HW_ADDR_T_LAN 1 | 218 | #define NETDEV_HW_ADDR_T_LAN 1 |
219 | #define NETDEV_HW_ADDR_T_SAN 2 | 219 | #define NETDEV_HW_ADDR_T_SAN 2 |
220 | #define NETDEV_HW_ADDR_T_SLAVE 3 | 220 | #define NETDEV_HW_ADDR_T_SLAVE 3 |
221 | #define NETDEV_HW_ADDR_T_UNICAST 4 | ||
222 | int refcount; | ||
223 | bool synced; | ||
221 | struct rcu_head rcu_head; | 224 | struct rcu_head rcu_head; |
222 | }; | 225 | }; |
223 | 226 | ||
@@ -773,10 +776,11 @@ struct net_device | |||
773 | unsigned char addr_len; /* hardware address length */ | 776 | unsigned char addr_len; /* hardware address length */ |
774 | unsigned short dev_id; /* for shared network cards */ | 777 | unsigned short dev_id; /* for shared network cards */ |
775 | 778 | ||
776 | spinlock_t addr_list_lock; | 779 | struct list_head uc_list; /* Secondary unicast mac |
777 | struct dev_addr_list *uc_list; /* Secondary unicast mac addresses */ | 780 | addresses */ |
778 | int uc_count; /* Number of installed ucasts */ | 781 | int uc_count; /* Number of installed ucasts */ |
779 | int uc_promisc; | 782 | int uc_promisc; |
783 | spinlock_t addr_list_lock; | ||
780 | struct dev_addr_list *mc_list; /* Multicast mac addresses */ | 784 | struct dev_addr_list *mc_list; /* Multicast mac addresses */ |
781 | int mc_count; /* Number of installed mcasts */ | 785 | int mc_count; /* Number of installed mcasts */ |
782 | unsigned int promiscuity; | 786 | unsigned int promiscuity; |
@@ -1836,8 +1840,8 @@ extern int dev_addr_del_multiple(struct net_device *to_dev, | |||
1836 | /* Functions used for secondary unicast and multicast support */ | 1840 | /* Functions used for secondary unicast and multicast support */ |
1837 | extern void dev_set_rx_mode(struct net_device *dev); | 1841 | extern void dev_set_rx_mode(struct net_device *dev); |
1838 | extern void __dev_set_rx_mode(struct net_device *dev); | 1842 | extern void __dev_set_rx_mode(struct net_device *dev); |
1839 | extern int dev_unicast_delete(struct net_device *dev, void *addr, int alen); | 1843 | extern int dev_unicast_delete(struct net_device *dev, void *addr); |
1840 | extern int dev_unicast_add(struct net_device *dev, void *addr, int alen); | 1844 | extern int dev_unicast_add(struct net_device *dev, void *addr); |
1841 | extern int dev_unicast_sync(struct net_device *to, struct net_device *from); | 1845 | extern int dev_unicast_sync(struct net_device *to, struct net_device *from); |
1842 | extern void dev_unicast_unsync(struct net_device *to, struct net_device *from); | 1846 | extern void dev_unicast_unsync(struct net_device *to, struct net_device *from); |
1843 | extern int dev_mc_delete(struct net_device *dev, void *addr, int alen, int all); | 1847 | extern int dev_mc_delete(struct net_device *dev, void *addr, int alen, int all); |