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/ixgbe | |
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/ixgbe')
-rw-r--r-- | drivers/net/ixgbe/ixgbe_common.c | 14 | ||||
-rw-r--r-- | drivers/net/ixgbe/ixgbe_common.h | 4 | ||||
-rw-r--r-- | drivers/net/ixgbe/ixgbe_main.c | 6 | ||||
-rw-r--r-- | drivers/net/ixgbe/ixgbe_type.h | 4 |
4 files changed, 12 insertions, 16 deletions
diff --git a/drivers/net/ixgbe/ixgbe_common.c b/drivers/net/ixgbe/ixgbe_common.c index 0cc3c47cb453..6f79409270a7 100644 --- a/drivers/net/ixgbe/ixgbe_common.c +++ b/drivers/net/ixgbe/ixgbe_common.c | |||
@@ -28,6 +28,8 @@ | |||
28 | #include <linux/pci.h> | 28 | #include <linux/pci.h> |
29 | #include <linux/delay.h> | 29 | #include <linux/delay.h> |
30 | #include <linux/sched.h> | 30 | #include <linux/sched.h> |
31 | #include <linux/list.h> | ||
32 | #include <linux/netdevice.h> | ||
31 | 33 | ||
32 | #include "ixgbe.h" | 34 | #include "ixgbe.h" |
33 | #include "ixgbe_common.h" | 35 | #include "ixgbe_common.h" |
@@ -1356,15 +1358,14 @@ static void ixgbe_add_uc_addr(struct ixgbe_hw *hw, u8 *addr, u32 vmdq) | |||
1356 | * Drivers using secondary unicast addresses must set user_set_promisc when | 1358 | * Drivers using secondary unicast addresses must set user_set_promisc when |
1357 | * manually putting the device into promiscuous mode. | 1359 | * manually putting the device into promiscuous mode. |
1358 | **/ | 1360 | **/ |
1359 | s32 ixgbe_update_uc_addr_list_generic(struct ixgbe_hw *hw, u8 *addr_list, | 1361 | s32 ixgbe_update_uc_addr_list_generic(struct ixgbe_hw *hw, |
1360 | u32 addr_count, ixgbe_mc_addr_itr next) | 1362 | struct list_head *uc_list) |
1361 | { | 1363 | { |
1362 | u8 *addr; | ||
1363 | u32 i; | 1364 | u32 i; |
1364 | u32 old_promisc_setting = hw->addr_ctrl.overflow_promisc; | 1365 | u32 old_promisc_setting = hw->addr_ctrl.overflow_promisc; |
1365 | u32 uc_addr_in_use; | 1366 | u32 uc_addr_in_use; |
1366 | u32 fctrl; | 1367 | u32 fctrl; |
1367 | u32 vmdq; | 1368 | struct netdev_hw_addr *ha; |
1368 | 1369 | ||
1369 | /* | 1370 | /* |
1370 | * Clear accounting of old secondary address list, | 1371 | * Clear accounting of old secondary address list, |
@@ -1382,10 +1383,9 @@ s32 ixgbe_update_uc_addr_list_generic(struct ixgbe_hw *hw, u8 *addr_list, | |||
1382 | } | 1383 | } |
1383 | 1384 | ||
1384 | /* Add the new addresses */ | 1385 | /* Add the new addresses */ |
1385 | for (i = 0; i < addr_count; i++) { | 1386 | list_for_each_entry(ha, uc_list, list) { |
1386 | hw_dbg(hw, " Adding the secondary addresses:\n"); | 1387 | hw_dbg(hw, " Adding the secondary addresses:\n"); |
1387 | addr = next(hw, &addr_list, &vmdq); | 1388 | ixgbe_add_uc_addr(hw, ha->addr, 0); |
1388 | ixgbe_add_uc_addr(hw, addr, vmdq); | ||
1389 | } | 1389 | } |
1390 | 1390 | ||
1391 | if (hw->addr_ctrl.overflow_promisc) { | 1391 | if (hw->addr_ctrl.overflow_promisc) { |
diff --git a/drivers/net/ixgbe/ixgbe_common.h b/drivers/net/ixgbe/ixgbe_common.h index dd260890ad0a..b2a4b2c99c40 100644 --- a/drivers/net/ixgbe/ixgbe_common.h +++ b/drivers/net/ixgbe/ixgbe_common.h | |||
@@ -59,8 +59,8 @@ s32 ixgbe_init_rx_addrs_generic(struct ixgbe_hw *hw); | |||
59 | s32 ixgbe_update_mc_addr_list_generic(struct ixgbe_hw *hw, u8 *mc_addr_list, | 59 | s32 ixgbe_update_mc_addr_list_generic(struct ixgbe_hw *hw, u8 *mc_addr_list, |
60 | u32 mc_addr_count, | 60 | u32 mc_addr_count, |
61 | ixgbe_mc_addr_itr func); | 61 | ixgbe_mc_addr_itr func); |
62 | s32 ixgbe_update_uc_addr_list_generic(struct ixgbe_hw *hw, u8 *addr_list, | 62 | s32 ixgbe_update_uc_addr_list_generic(struct ixgbe_hw *hw, |
63 | u32 addr_count, ixgbe_mc_addr_itr func); | 63 | struct list_head *uc_list); |
64 | s32 ixgbe_enable_mc_generic(struct ixgbe_hw *hw); | 64 | s32 ixgbe_enable_mc_generic(struct ixgbe_hw *hw); |
65 | s32 ixgbe_disable_mc_generic(struct ixgbe_hw *hw); | 65 | s32 ixgbe_disable_mc_generic(struct ixgbe_hw *hw); |
66 | s32 ixgbe_enable_rx_dma_generic(struct ixgbe_hw *hw, u32 regval); | 66 | s32 ixgbe_enable_rx_dma_generic(struct ixgbe_hw *hw, u32 regval); |
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c index 924aa5ed02ce..de70a2df9aeb 100644 --- a/drivers/net/ixgbe/ixgbe_main.c +++ b/drivers/net/ixgbe/ixgbe_main.c | |||
@@ -2181,11 +2181,7 @@ static void ixgbe_set_rx_mode(struct net_device *netdev) | |||
2181 | IXGBE_WRITE_REG(hw, IXGBE_VLNCTRL, vlnctrl); | 2181 | IXGBE_WRITE_REG(hw, IXGBE_VLNCTRL, vlnctrl); |
2182 | 2182 | ||
2183 | /* reprogram secondary unicast list */ | 2183 | /* reprogram secondary unicast list */ |
2184 | addr_count = netdev->uc_count; | 2184 | hw->mac.ops.update_uc_addr_list(hw, &netdev->uc_list); |
2185 | if (addr_count) | ||
2186 | addr_list = netdev->uc_list->dmi_addr; | ||
2187 | hw->mac.ops.update_uc_addr_list(hw, addr_list, addr_count, | ||
2188 | ixgbe_addr_list_itr); | ||
2189 | 2185 | ||
2190 | /* reprogram multicast list */ | 2186 | /* reprogram multicast list */ |
2191 | addr_count = netdev->mc_count; | 2187 | addr_count = netdev->mc_count; |
diff --git a/drivers/net/ixgbe/ixgbe_type.h b/drivers/net/ixgbe/ixgbe_type.h index df1f7034c284..a8a8243d8fdb 100644 --- a/drivers/net/ixgbe/ixgbe_type.h +++ b/drivers/net/ixgbe/ixgbe_type.h | |||
@@ -30,6 +30,7 @@ | |||
30 | 30 | ||
31 | #include <linux/types.h> | 31 | #include <linux/types.h> |
32 | #include <linux/mdio.h> | 32 | #include <linux/mdio.h> |
33 | #include <linux/list.h> | ||
33 | 34 | ||
34 | /* Vendor ID */ | 35 | /* Vendor ID */ |
35 | #define IXGBE_INTEL_VENDOR_ID 0x8086 | 36 | #define IXGBE_INTEL_VENDOR_ID 0x8086 |
@@ -2223,8 +2224,7 @@ struct ixgbe_mac_operations { | |||
2223 | s32 (*set_vmdq)(struct ixgbe_hw *, u32, u32); | 2224 | s32 (*set_vmdq)(struct ixgbe_hw *, u32, u32); |
2224 | s32 (*clear_vmdq)(struct ixgbe_hw *, u32, u32); | 2225 | s32 (*clear_vmdq)(struct ixgbe_hw *, u32, u32); |
2225 | s32 (*init_rx_addrs)(struct ixgbe_hw *); | 2226 | s32 (*init_rx_addrs)(struct ixgbe_hw *); |
2226 | s32 (*update_uc_addr_list)(struct ixgbe_hw *, u8 *, u32, | 2227 | s32 (*update_uc_addr_list)(struct ixgbe_hw *, struct list_head *); |
2227 | ixgbe_mc_addr_itr); | ||
2228 | s32 (*update_mc_addr_list)(struct ixgbe_hw *, u8 *, u32, | 2228 | s32 (*update_mc_addr_list)(struct ixgbe_hw *, u8 *, u32, |
2229 | ixgbe_mc_addr_itr); | 2229 | ixgbe_mc_addr_itr); |
2230 | s32 (*enable_mc)(struct ixgbe_hw *); | 2230 | s32 (*enable_mc)(struct ixgbe_hw *); |