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 /drivers/net/macvlan.c | |
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 'drivers/net/macvlan.c')
-rw-r--r-- | drivers/net/macvlan.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c index d5334b41e4b4..021d9941c292 100644 --- a/drivers/net/macvlan.c +++ b/drivers/net/macvlan.c | |||
@@ -232,7 +232,7 @@ static int macvlan_open(struct net_device *dev) | |||
232 | if (macvlan_addr_busy(vlan->port, dev->dev_addr)) | 232 | if (macvlan_addr_busy(vlan->port, dev->dev_addr)) |
233 | goto out; | 233 | goto out; |
234 | 234 | ||
235 | err = dev_unicast_add(lowerdev, dev->dev_addr, ETH_ALEN); | 235 | err = dev_unicast_add(lowerdev, dev->dev_addr); |
236 | if (err < 0) | 236 | if (err < 0) |
237 | goto out; | 237 | goto out; |
238 | if (dev->flags & IFF_ALLMULTI) { | 238 | if (dev->flags & IFF_ALLMULTI) { |
@@ -244,7 +244,7 @@ static int macvlan_open(struct net_device *dev) | |||
244 | return 0; | 244 | return 0; |
245 | 245 | ||
246 | del_unicast: | 246 | del_unicast: |
247 | dev_unicast_delete(lowerdev, dev->dev_addr, ETH_ALEN); | 247 | dev_unicast_delete(lowerdev, dev->dev_addr); |
248 | out: | 248 | out: |
249 | return err; | 249 | return err; |
250 | } | 250 | } |
@@ -258,7 +258,7 @@ static int macvlan_stop(struct net_device *dev) | |||
258 | if (dev->flags & IFF_ALLMULTI) | 258 | if (dev->flags & IFF_ALLMULTI) |
259 | dev_set_allmulti(lowerdev, -1); | 259 | dev_set_allmulti(lowerdev, -1); |
260 | 260 | ||
261 | dev_unicast_delete(lowerdev, dev->dev_addr, ETH_ALEN); | 261 | dev_unicast_delete(lowerdev, dev->dev_addr); |
262 | 262 | ||
263 | macvlan_hash_del(vlan); | 263 | macvlan_hash_del(vlan); |
264 | return 0; | 264 | return 0; |
@@ -282,10 +282,11 @@ static int macvlan_set_mac_address(struct net_device *dev, void *p) | |||
282 | if (macvlan_addr_busy(vlan->port, addr->sa_data)) | 282 | if (macvlan_addr_busy(vlan->port, addr->sa_data)) |
283 | return -EBUSY; | 283 | return -EBUSY; |
284 | 284 | ||
285 | if ((err = dev_unicast_add(lowerdev, addr->sa_data, ETH_ALEN))) | 285 | err = dev_unicast_add(lowerdev, addr->sa_data); |
286 | if (err) | ||
286 | return err; | 287 | return err; |
287 | 288 | ||
288 | dev_unicast_delete(lowerdev, dev->dev_addr, ETH_ALEN); | 289 | dev_unicast_delete(lowerdev, dev->dev_addr); |
289 | 290 | ||
290 | macvlan_hash_change_addr(vlan, addr->sa_data); | 291 | macvlan_hash_change_addr(vlan, addr->sa_data); |
291 | } | 292 | } |