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>
This commit is contained in:
committed by
David S. Miller
parent
ae63e808f5
commit
ccffad25b5
@@ -182,8 +182,8 @@ static void fcoe_update_src_mac(struct fcoe_ctlr *fip, u8 *old, u8 *new)
|
||||
fc = fcoe_from_ctlr(fip);
|
||||
rtnl_lock();
|
||||
if (!is_zero_ether_addr(old))
|
||||
dev_unicast_delete(fc->real_dev, old, ETH_ALEN);
|
||||
dev_unicast_add(fc->real_dev, new, ETH_ALEN);
|
||||
dev_unicast_delete(fc->real_dev, old);
|
||||
dev_unicast_add(fc->real_dev, new);
|
||||
rtnl_unlock();
|
||||
}
|
||||
|
||||
@@ -233,13 +233,11 @@ void fcoe_netdev_cleanup(struct fcoe_softc *fc)
|
||||
/* Delete secondary MAC addresses */
|
||||
rtnl_lock();
|
||||
memcpy(flogi_maddr, (u8[6]) FC_FCOE_FLOGI_MAC, ETH_ALEN);
|
||||
dev_unicast_delete(fc->real_dev, flogi_maddr, ETH_ALEN);
|
||||
dev_unicast_delete(fc->real_dev, flogi_maddr);
|
||||
if (!is_zero_ether_addr(fc->ctlr.data_src_addr))
|
||||
dev_unicast_delete(fc->real_dev,
|
||||
fc->ctlr.data_src_addr, ETH_ALEN);
|
||||
dev_unicast_delete(fc->real_dev, fc->ctlr.data_src_addr);
|
||||
if (fc->ctlr.spma)
|
||||
dev_unicast_delete(fc->real_dev,
|
||||
fc->ctlr.ctl_src_addr, ETH_ALEN);
|
||||
dev_unicast_delete(fc->real_dev, fc->ctlr.ctl_src_addr);
|
||||
dev_mc_delete(fc->real_dev, FIP_ALL_ENODE_MACS, ETH_ALEN, 0);
|
||||
rtnl_unlock();
|
||||
}
|
||||
@@ -347,9 +345,9 @@ static int fcoe_netdev_config(struct fc_lport *lp, struct net_device *netdev)
|
||||
*/
|
||||
rtnl_lock();
|
||||
memcpy(flogi_maddr, (u8[6]) FC_FCOE_FLOGI_MAC, ETH_ALEN);
|
||||
dev_unicast_add(fc->real_dev, flogi_maddr, ETH_ALEN);
|
||||
dev_unicast_add(fc->real_dev, flogi_maddr);
|
||||
if (fc->ctlr.spma)
|
||||
dev_unicast_add(fc->real_dev, fc->ctlr.ctl_src_addr, ETH_ALEN);
|
||||
dev_unicast_add(fc->real_dev, fc->ctlr.ctl_src_addr);
|
||||
dev_mc_add(fc->real_dev, FIP_ALL_ENODE_MACS, ETH_ALEN, 0);
|
||||
rtnl_unlock();
|
||||
|
||||
|
Reference in New Issue
Block a user