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 /net/8021q | |
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 'net/8021q')
-rw-r--r-- | net/8021q/vlan.c | 4 | ||||
-rw-r--r-- | net/8021q/vlan_dev.c | 10 |
2 files changed, 7 insertions, 7 deletions
diff --git a/net/8021q/vlan.c b/net/8021q/vlan.c index d1e10546eb85..714e1c3536be 100644 --- a/net/8021q/vlan.c +++ b/net/8021q/vlan.c | |||
@@ -378,13 +378,13 @@ static void vlan_sync_address(struct net_device *dev, | |||
378 | * the new address */ | 378 | * the new address */ |
379 | if (compare_ether_addr(vlandev->dev_addr, vlan->real_dev_addr) && | 379 | if (compare_ether_addr(vlandev->dev_addr, vlan->real_dev_addr) && |
380 | !compare_ether_addr(vlandev->dev_addr, dev->dev_addr)) | 380 | !compare_ether_addr(vlandev->dev_addr, dev->dev_addr)) |
381 | dev_unicast_delete(dev, vlandev->dev_addr, ETH_ALEN); | 381 | dev_unicast_delete(dev, vlandev->dev_addr); |
382 | 382 | ||
383 | /* vlan address was equal to the old address and is different from | 383 | /* vlan address was equal to the old address and is different from |
384 | * the new address */ | 384 | * the new address */ |
385 | if (!compare_ether_addr(vlandev->dev_addr, vlan->real_dev_addr) && | 385 | if (!compare_ether_addr(vlandev->dev_addr, vlan->real_dev_addr) && |
386 | compare_ether_addr(vlandev->dev_addr, dev->dev_addr)) | 386 | compare_ether_addr(vlandev->dev_addr, dev->dev_addr)) |
387 | dev_unicast_add(dev, vlandev->dev_addr, ETH_ALEN); | 387 | dev_unicast_add(dev, vlandev->dev_addr); |
388 | 388 | ||
389 | memcpy(vlan->real_dev_addr, dev->dev_addr, ETH_ALEN); | 389 | memcpy(vlan->real_dev_addr, dev->dev_addr, ETH_ALEN); |
390 | } | 390 | } |
diff --git a/net/8021q/vlan_dev.c b/net/8021q/vlan_dev.c index 1e2ad4c7c59b..96bad8f233e2 100644 --- a/net/8021q/vlan_dev.c +++ b/net/8021q/vlan_dev.c | |||
@@ -441,7 +441,7 @@ static int vlan_dev_open(struct net_device *dev) | |||
441 | return -ENETDOWN; | 441 | return -ENETDOWN; |
442 | 442 | ||
443 | if (compare_ether_addr(dev->dev_addr, real_dev->dev_addr)) { | 443 | if (compare_ether_addr(dev->dev_addr, real_dev->dev_addr)) { |
444 | err = dev_unicast_add(real_dev, dev->dev_addr, ETH_ALEN); | 444 | err = dev_unicast_add(real_dev, dev->dev_addr); |
445 | if (err < 0) | 445 | if (err < 0) |
446 | goto out; | 446 | goto out; |
447 | } | 447 | } |
@@ -470,7 +470,7 @@ clear_allmulti: | |||
470 | dev_set_allmulti(real_dev, -1); | 470 | dev_set_allmulti(real_dev, -1); |
471 | del_unicast: | 471 | del_unicast: |
472 | if (compare_ether_addr(dev->dev_addr, real_dev->dev_addr)) | 472 | if (compare_ether_addr(dev->dev_addr, real_dev->dev_addr)) |
473 | dev_unicast_delete(real_dev, dev->dev_addr, ETH_ALEN); | 473 | dev_unicast_delete(real_dev, dev->dev_addr); |
474 | out: | 474 | out: |
475 | netif_carrier_off(dev); | 475 | netif_carrier_off(dev); |
476 | return err; | 476 | return err; |
@@ -492,7 +492,7 @@ static int vlan_dev_stop(struct net_device *dev) | |||
492 | dev_set_promiscuity(real_dev, -1); | 492 | dev_set_promiscuity(real_dev, -1); |
493 | 493 | ||
494 | if (compare_ether_addr(dev->dev_addr, real_dev->dev_addr)) | 494 | if (compare_ether_addr(dev->dev_addr, real_dev->dev_addr)) |
495 | dev_unicast_delete(real_dev, dev->dev_addr, dev->addr_len); | 495 | dev_unicast_delete(real_dev, dev->dev_addr); |
496 | 496 | ||
497 | netif_carrier_off(dev); | 497 | netif_carrier_off(dev); |
498 | return 0; | 498 | return 0; |
@@ -511,13 +511,13 @@ static int vlan_dev_set_mac_address(struct net_device *dev, void *p) | |||
511 | goto out; | 511 | goto out; |
512 | 512 | ||
513 | if (compare_ether_addr(addr->sa_data, real_dev->dev_addr)) { | 513 | if (compare_ether_addr(addr->sa_data, real_dev->dev_addr)) { |
514 | err = dev_unicast_add(real_dev, addr->sa_data, ETH_ALEN); | 514 | err = dev_unicast_add(real_dev, addr->sa_data); |
515 | if (err < 0) | 515 | if (err < 0) |
516 | return err; | 516 | return err; |
517 | } | 517 | } |
518 | 518 | ||
519 | if (compare_ether_addr(dev->dev_addr, real_dev->dev_addr)) | 519 | if (compare_ether_addr(dev->dev_addr, real_dev->dev_addr)) |
520 | dev_unicast_delete(real_dev, dev->dev_addr, ETH_ALEN); | 520 | dev_unicast_delete(real_dev, dev->dev_addr); |
521 | 521 | ||
522 | out: | 522 | out: |
523 | memcpy(dev->dev_addr, addr->sa_data, ETH_ALEN); | 523 | memcpy(dev->dev_addr, addr->sa_data, ETH_ALEN); |