diff options
author | Dan Aloni <da-x@monatomic.org> | 2007-03-02 23:44:51 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2007-03-02 23:44:51 -0500 |
commit | 5c15bdec5c38f4ccf73ef2585fc80a6164de9554 (patch) | |
tree | c99084e96238eb9ce40e8d9d90e0097c4e92111d /drivers | |
parent | b5284e5aa94be2f88dc92b29e97aff3da0c45f9f (diff) |
[VLAN]: Avoid a 4-order allocation.
This patch splits the vlan_group struct into a multi-allocated struct. On
x86_64, the size of the original struct is a little more than 32KB, causing
a 4-order allocation, which is prune to problems caused by buddy-system
external fragmentation conditions.
I couldn't just use vmalloc() because vfree() cannot be called in the
softirq context of the RCU callback.
Signed-off-by: Dan Aloni <da-x@monatomic.org>
Acked-by: Jeff Garzik <jeff@garzik.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/8139cp.c | 3 | ||||
-rw-r--r-- | drivers/net/acenic.c | 5 | ||||
-rw-r--r-- | drivers/net/amd8111e.c | 3 | ||||
-rw-r--r-- | drivers/net/atl1/atl1_main.c | 5 | ||||
-rw-r--r-- | drivers/net/bnx2.c | 4 | ||||
-rw-r--r-- | drivers/net/bonding/bond_main.c | 14 | ||||
-rw-r--r-- | drivers/net/chelsio/cxgb2.c | 3 | ||||
-rw-r--r-- | drivers/net/cxgb3/cxgb3_offload.c | 6 | ||||
-rw-r--r-- | drivers/net/e1000/e1000_main.c | 13 | ||||
-rw-r--r-- | drivers/net/ehea/ehea_main.c | 3 | ||||
-rw-r--r-- | drivers/net/gianfar.c | 3 | ||||
-rw-r--r-- | drivers/net/ixgb/ixgb_main.c | 5 | ||||
-rw-r--r-- | drivers/net/ns83820.c | 3 | ||||
-rw-r--r-- | drivers/net/r8169.c | 3 | ||||
-rw-r--r-- | drivers/net/s2io.c | 3 | ||||
-rw-r--r-- | drivers/net/sky2.c | 3 | ||||
-rw-r--r-- | drivers/net/starfire.c | 5 | ||||
-rw-r--r-- | drivers/net/tg3.c | 3 | ||||
-rw-r--r-- | drivers/net/typhoon.c | 3 | ||||
-rw-r--r-- | drivers/s390/net/qeth_main.c | 25 |
20 files changed, 48 insertions, 67 deletions
diff --git a/drivers/net/8139cp.c b/drivers/net/8139cp.c index 6f93a765e564..12c8453f44bc 100644 --- a/drivers/net/8139cp.c +++ b/drivers/net/8139cp.c | |||
@@ -448,8 +448,7 @@ static void cp_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid) | |||
448 | spin_lock_irqsave(&cp->lock, flags); | 448 | spin_lock_irqsave(&cp->lock, flags); |
449 | cp->cpcmd &= ~RxVlanOn; | 449 | cp->cpcmd &= ~RxVlanOn; |
450 | cpw16(CpCmd, cp->cpcmd); | 450 | cpw16(CpCmd, cp->cpcmd); |
451 | if (cp->vlgrp) | 451 | vlan_group_set_device(cp->vlgrp, vid, NULL); |
452 | cp->vlgrp->vlan_devices[vid] = NULL; | ||
453 | spin_unlock_irqrestore(&cp->lock, flags); | 452 | spin_unlock_irqrestore(&cp->lock, flags); |
454 | } | 453 | } |
455 | #endif /* CP_VLAN_TAG_USED */ | 454 | #endif /* CP_VLAN_TAG_USED */ |
diff --git a/drivers/net/acenic.c b/drivers/net/acenic.c index 33c6645455ae..7138e0e025bc 100644 --- a/drivers/net/acenic.c +++ b/drivers/net/acenic.c | |||
@@ -2293,10 +2293,7 @@ static void ace_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid) | |||
2293 | 2293 | ||
2294 | local_irq_save(flags); | 2294 | local_irq_save(flags); |
2295 | ace_mask_irq(dev); | 2295 | ace_mask_irq(dev); |
2296 | 2296 | vlan_group_set_device(ap->vlgrp, vid, NULL); | |
2297 | if (ap->vlgrp) | ||
2298 | ap->vlgrp->vlan_devices[vid] = NULL; | ||
2299 | |||
2300 | ace_unmask_irq(dev); | 2297 | ace_unmask_irq(dev); |
2301 | local_irq_restore(flags); | 2298 | local_irq_restore(flags); |
2302 | } | 2299 | } |
diff --git a/drivers/net/amd8111e.c b/drivers/net/amd8111e.c index 9c399aaefbdd..962c954c2d56 100644 --- a/drivers/net/amd8111e.c +++ b/drivers/net/amd8111e.c | |||
@@ -1737,8 +1737,7 @@ static void amd8111e_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid | |||
1737 | { | 1737 | { |
1738 | struct amd8111e_priv *lp = netdev_priv(dev); | 1738 | struct amd8111e_priv *lp = netdev_priv(dev); |
1739 | spin_lock_irq(&lp->lock); | 1739 | spin_lock_irq(&lp->lock); |
1740 | if (lp->vlgrp) | 1740 | vlan_group_set_device(lp->vlgrp, vid, NULL); |
1741 | lp->vlgrp->vlan_devices[vid] = NULL; | ||
1742 | spin_unlock_irq(&lp->lock); | 1741 | spin_unlock_irq(&lp->lock); |
1743 | } | 1742 | } |
1744 | #endif | 1743 | #endif |
diff --git a/drivers/net/atl1/atl1_main.c b/drivers/net/atl1/atl1_main.c index 65673485bb6b..88d4f70035bb 100644 --- a/drivers/net/atl1/atl1_main.c +++ b/drivers/net/atl1/atl1_main.c | |||
@@ -1252,8 +1252,7 @@ static void atl1_vlan_rx_kill_vid(struct net_device *netdev, u16 vid) | |||
1252 | 1252 | ||
1253 | spin_lock_irqsave(&adapter->lock, flags); | 1253 | spin_lock_irqsave(&adapter->lock, flags); |
1254 | /* atl1_irq_disable(adapter); */ | 1254 | /* atl1_irq_disable(adapter); */ |
1255 | if (adapter->vlgrp) | 1255 | vlan_group_set_device(adapter->vlgrp, vid, NULL); |
1256 | adapter->vlgrp->vlan_devices[vid] = NULL; | ||
1257 | /* atl1_irq_enable(adapter); */ | 1256 | /* atl1_irq_enable(adapter); */ |
1258 | spin_unlock_irqrestore(&adapter->lock, flags); | 1257 | spin_unlock_irqrestore(&adapter->lock, flags); |
1259 | /* We don't do Vlan filtering */ | 1258 | /* We don't do Vlan filtering */ |
@@ -1266,7 +1265,7 @@ static void atl1_restore_vlan(struct atl1_adapter *adapter) | |||
1266 | if (adapter->vlgrp) { | 1265 | if (adapter->vlgrp) { |
1267 | u16 vid; | 1266 | u16 vid; |
1268 | for (vid = 0; vid < VLAN_GROUP_ARRAY_LEN; vid++) { | 1267 | for (vid = 0; vid < VLAN_GROUP_ARRAY_LEN; vid++) { |
1269 | if (!adapter->vlgrp->vlan_devices[vid]) | 1268 | if (!vlan_group_get_device(adapter->vlgrp, vid)) |
1270 | continue; | 1269 | continue; |
1271 | atl1_vlan_rx_add_vid(adapter->netdev, vid); | 1270 | atl1_vlan_rx_add_vid(adapter->netdev, vid); |
1272 | } | 1271 | } |
diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c index 5a96d7611af1..c12e5ea61819 100644 --- a/drivers/net/bnx2.c +++ b/drivers/net/bnx2.c | |||
@@ -4467,9 +4467,7 @@ bnx2_vlan_rx_kill_vid(struct net_device *dev, uint16_t vid) | |||
4467 | struct bnx2 *bp = netdev_priv(dev); | 4467 | struct bnx2 *bp = netdev_priv(dev); |
4468 | 4468 | ||
4469 | bnx2_netif_stop(bp); | 4469 | bnx2_netif_stop(bp); |
4470 | 4470 | vlan_group_set_device(bp->vlgrp, vid, NULL); | |
4471 | if (bp->vlgrp) | ||
4472 | bp->vlgrp->vlan_devices[vid] = NULL; | ||
4473 | bnx2_set_rx_mode(dev); | 4471 | bnx2_set_rx_mode(dev); |
4474 | 4472 | ||
4475 | bnx2_netif_start(bp); | 4473 | bnx2_netif_start(bp); |
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index a7c8f98a890c..ea73ebff4387 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c | |||
@@ -488,9 +488,9 @@ static void bond_vlan_rx_kill_vid(struct net_device *bond_dev, uint16_t vid) | |||
488 | /* Save and then restore vlan_dev in the grp array, | 488 | /* Save and then restore vlan_dev in the grp array, |
489 | * since the slave's driver might clear it. | 489 | * since the slave's driver might clear it. |
490 | */ | 490 | */ |
491 | vlan_dev = bond->vlgrp->vlan_devices[vid]; | 491 | vlan_dev = vlan_group_get_device(bond->vlgrp, vid); |
492 | slave_dev->vlan_rx_kill_vid(slave_dev, vid); | 492 | slave_dev->vlan_rx_kill_vid(slave_dev, vid); |
493 | bond->vlgrp->vlan_devices[vid] = vlan_dev; | 493 | vlan_group_set_device(bond->vlgrp, vid, vlan_dev); |
494 | } | 494 | } |
495 | } | 495 | } |
496 | 496 | ||
@@ -550,9 +550,9 @@ static void bond_del_vlans_from_slave(struct bonding *bond, struct net_device *s | |||
550 | /* Save and then restore vlan_dev in the grp array, | 550 | /* Save and then restore vlan_dev in the grp array, |
551 | * since the slave's driver might clear it. | 551 | * since the slave's driver might clear it. |
552 | */ | 552 | */ |
553 | vlan_dev = bond->vlgrp->vlan_devices[vlan->vlan_id]; | 553 | vlan_dev = vlan_group_get_device(bond->vlgrp, vlan->vlan_id); |
554 | slave_dev->vlan_rx_kill_vid(slave_dev, vlan->vlan_id); | 554 | slave_dev->vlan_rx_kill_vid(slave_dev, vlan->vlan_id); |
555 | bond->vlgrp->vlan_devices[vlan->vlan_id] = vlan_dev; | 555 | vlan_group_set_device(bond->vlgrp, vlan->vlan_id, vlan_dev); |
556 | } | 556 | } |
557 | 557 | ||
558 | unreg: | 558 | unreg: |
@@ -2397,7 +2397,7 @@ static void bond_arp_send_all(struct bonding *bond, struct slave *slave) | |||
2397 | vlan_id = 0; | 2397 | vlan_id = 0; |
2398 | list_for_each_entry_safe(vlan, vlan_next, &bond->vlan_list, | 2398 | list_for_each_entry_safe(vlan, vlan_next, &bond->vlan_list, |
2399 | vlan_list) { | 2399 | vlan_list) { |
2400 | vlan_dev = bond->vlgrp->vlan_devices[vlan->vlan_id]; | 2400 | vlan_dev = vlan_group_get_device(bond->vlgrp, vlan->vlan_id); |
2401 | if (vlan_dev == rt->u.dst.dev) { | 2401 | if (vlan_dev == rt->u.dst.dev) { |
2402 | vlan_id = vlan->vlan_id; | 2402 | vlan_id = vlan->vlan_id; |
2403 | dprintk("basa: vlan match on %s %d\n", | 2403 | dprintk("basa: vlan match on %s %d\n", |
@@ -2444,7 +2444,7 @@ static void bond_send_gratuitous_arp(struct bonding *bond) | |||
2444 | } | 2444 | } |
2445 | 2445 | ||
2446 | list_for_each_entry(vlan, &bond->vlan_list, vlan_list) { | 2446 | list_for_each_entry(vlan, &bond->vlan_list, vlan_list) { |
2447 | vlan_dev = bond->vlgrp->vlan_devices[vlan->vlan_id]; | 2447 | vlan_dev = vlan_group_get_device(bond->vlgrp, vlan->vlan_id); |
2448 | if (vlan->vlan_ip) { | 2448 | if (vlan->vlan_ip) { |
2449 | bond_arp_send(slave->dev, ARPOP_REPLY, vlan->vlan_ip, | 2449 | bond_arp_send(slave->dev, ARPOP_REPLY, vlan->vlan_ip, |
2450 | vlan->vlan_ip, vlan->vlan_id); | 2450 | vlan->vlan_ip, vlan->vlan_id); |
@@ -3371,7 +3371,7 @@ static int bond_inetaddr_event(struct notifier_block *this, unsigned long event, | |||
3371 | 3371 | ||
3372 | list_for_each_entry_safe(vlan, vlan_next, &bond->vlan_list, | 3372 | list_for_each_entry_safe(vlan, vlan_next, &bond->vlan_list, |
3373 | vlan_list) { | 3373 | vlan_list) { |
3374 | vlan_dev = bond->vlgrp->vlan_devices[vlan->vlan_id]; | 3374 | vlan_dev = vlan_group_get_device(bond->vlgrp, vlan->vlan_id); |
3375 | if (vlan_dev == event_dev) { | 3375 | if (vlan_dev == event_dev) { |
3376 | switch (event) { | 3376 | switch (event) { |
3377 | case NETDEV_UP: | 3377 | case NETDEV_UP: |
diff --git a/drivers/net/chelsio/cxgb2.c b/drivers/net/chelsio/cxgb2.c index 7d0f24f69777..125c9b105869 100644 --- a/drivers/net/chelsio/cxgb2.c +++ b/drivers/net/chelsio/cxgb2.c | |||
@@ -889,8 +889,7 @@ static void vlan_rx_kill_vid(struct net_device *dev, unsigned short vid) | |||
889 | struct adapter *adapter = dev->priv; | 889 | struct adapter *adapter = dev->priv; |
890 | 890 | ||
891 | spin_lock_irq(&adapter->async_lock); | 891 | spin_lock_irq(&adapter->async_lock); |
892 | if (adapter->vlan_grp) | 892 | vlan_group_set_device(adapter->vlan_grp, vid, NULL); |
893 | adapter->vlan_grp->vlan_devices[vid] = NULL; | ||
894 | spin_unlock_irq(&adapter->async_lock); | 893 | spin_unlock_irq(&adapter->async_lock); |
895 | } | 894 | } |
896 | #endif | 895 | #endif |
diff --git a/drivers/net/cxgb3/cxgb3_offload.c b/drivers/net/cxgb3/cxgb3_offload.c index b2cf5f6feb4a..f6ed033efb56 100644 --- a/drivers/net/cxgb3/cxgb3_offload.c +++ b/drivers/net/cxgb3/cxgb3_offload.c | |||
@@ -160,14 +160,16 @@ static struct net_device *get_iff_from_mac(struct adapter *adapter, | |||
160 | int i; | 160 | int i; |
161 | 161 | ||
162 | for_each_port(adapter, i) { | 162 | for_each_port(adapter, i) { |
163 | const struct vlan_group *grp; | 163 | struct vlan_group *grp; |
164 | struct net_device *dev = adapter->port[i]; | 164 | struct net_device *dev = adapter->port[i]; |
165 | const struct port_info *p = netdev_priv(dev); | 165 | const struct port_info *p = netdev_priv(dev); |
166 | 166 | ||
167 | if (!memcmp(dev->dev_addr, mac, ETH_ALEN)) { | 167 | if (!memcmp(dev->dev_addr, mac, ETH_ALEN)) { |
168 | if (vlan && vlan != VLAN_VID_MASK) { | 168 | if (vlan && vlan != VLAN_VID_MASK) { |
169 | grp = p->vlan_grp; | 169 | grp = p->vlan_grp; |
170 | dev = grp ? grp->vlan_devices[vlan] : NULL; | 170 | dev = NULL; |
171 | if (grp) | ||
172 | dev = vlan_group_get_device(grp, vlan); | ||
171 | } else | 173 | } else |
172 | while (dev->master) | 174 | while (dev->master) |
173 | dev = dev->master; | 175 | dev = dev->master; |
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c index 98215fdd7d10..1d08e937af82 100644 --- a/drivers/net/e1000/e1000_main.c +++ b/drivers/net/e1000/e1000_main.c | |||
@@ -376,7 +376,7 @@ e1000_update_mng_vlan(struct e1000_adapter *adapter) | |||
376 | uint16_t vid = adapter->hw.mng_cookie.vlan_id; | 376 | uint16_t vid = adapter->hw.mng_cookie.vlan_id; |
377 | uint16_t old_vid = adapter->mng_vlan_id; | 377 | uint16_t old_vid = adapter->mng_vlan_id; |
378 | if (adapter->vlgrp) { | 378 | if (adapter->vlgrp) { |
379 | if (!adapter->vlgrp->vlan_devices[vid]) { | 379 | if (!vlan_group_get_device(adapter->vlgrp, vid)) { |
380 | if (adapter->hw.mng_cookie.status & | 380 | if (adapter->hw.mng_cookie.status & |
381 | E1000_MNG_DHCP_COOKIE_STATUS_VLAN_SUPPORT) { | 381 | E1000_MNG_DHCP_COOKIE_STATUS_VLAN_SUPPORT) { |
382 | e1000_vlan_rx_add_vid(netdev, vid); | 382 | e1000_vlan_rx_add_vid(netdev, vid); |
@@ -386,7 +386,7 @@ e1000_update_mng_vlan(struct e1000_adapter *adapter) | |||
386 | 386 | ||
387 | if ((old_vid != (uint16_t)E1000_MNG_VLAN_NONE) && | 387 | if ((old_vid != (uint16_t)E1000_MNG_VLAN_NONE) && |
388 | (vid != old_vid) && | 388 | (vid != old_vid) && |
389 | !adapter->vlgrp->vlan_devices[old_vid]) | 389 | !vlan_group_get_device(adapter->vlgrp, old_vid)) |
390 | e1000_vlan_rx_kill_vid(netdev, old_vid); | 390 | e1000_vlan_rx_kill_vid(netdev, old_vid); |
391 | } else | 391 | } else |
392 | adapter->mng_vlan_id = vid; | 392 | adapter->mng_vlan_id = vid; |
@@ -1482,7 +1482,7 @@ e1000_close(struct net_device *netdev) | |||
1482 | if ((adapter->hw.mng_cookie.status & | 1482 | if ((adapter->hw.mng_cookie.status & |
1483 | E1000_MNG_DHCP_COOKIE_STATUS_VLAN_SUPPORT) && | 1483 | E1000_MNG_DHCP_COOKIE_STATUS_VLAN_SUPPORT) && |
1484 | !(adapter->vlgrp && | 1484 | !(adapter->vlgrp && |
1485 | adapter->vlgrp->vlan_devices[adapter->mng_vlan_id])) { | 1485 | vlan_group_get_device(adapter->vlgrp, adapter->mng_vlan_id))) { |
1486 | e1000_vlan_rx_kill_vid(netdev, adapter->mng_vlan_id); | 1486 | e1000_vlan_rx_kill_vid(netdev, adapter->mng_vlan_id); |
1487 | } | 1487 | } |
1488 | 1488 | ||
@@ -4998,10 +4998,7 @@ e1000_vlan_rx_kill_vid(struct net_device *netdev, uint16_t vid) | |||
4998 | uint32_t vfta, index; | 4998 | uint32_t vfta, index; |
4999 | 4999 | ||
5000 | e1000_irq_disable(adapter); | 5000 | e1000_irq_disable(adapter); |
5001 | 5001 | vlan_group_set_device(adapter->vlgrp, vid, NULL); | |
5002 | if (adapter->vlgrp) | ||
5003 | adapter->vlgrp->vlan_devices[vid] = NULL; | ||
5004 | |||
5005 | e1000_irq_enable(adapter); | 5002 | e1000_irq_enable(adapter); |
5006 | 5003 | ||
5007 | if ((adapter->hw.mng_cookie.status & | 5004 | if ((adapter->hw.mng_cookie.status & |
@@ -5027,7 +5024,7 @@ e1000_restore_vlan(struct e1000_adapter *adapter) | |||
5027 | if (adapter->vlgrp) { | 5024 | if (adapter->vlgrp) { |
5028 | uint16_t vid; | 5025 | uint16_t vid; |
5029 | for (vid = 0; vid < VLAN_GROUP_ARRAY_LEN; vid++) { | 5026 | for (vid = 0; vid < VLAN_GROUP_ARRAY_LEN; vid++) { |
5030 | if (!adapter->vlgrp->vlan_devices[vid]) | 5027 | if (!vlan_group_get_device(adapter->vlgrp, vid)) |
5031 | continue; | 5028 | continue; |
5032 | e1000_vlan_rx_add_vid(adapter->netdev, vid); | 5029 | e1000_vlan_rx_add_vid(adapter->netdev, vid); |
5033 | } | 5030 | } |
diff --git a/drivers/net/ehea/ehea_main.c b/drivers/net/ehea/ehea_main.c index 88ad1c8bcee4..0e4042bc0a48 100644 --- a/drivers/net/ehea/ehea_main.c +++ b/drivers/net/ehea/ehea_main.c | |||
@@ -1939,8 +1939,7 @@ static void ehea_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid) | |||
1939 | int index; | 1939 | int index; |
1940 | u64 hret; | 1940 | u64 hret; |
1941 | 1941 | ||
1942 | if (port->vgrp) | 1942 | vlan_group_set_device(port->vgrp, vid, NULL); |
1943 | port->vgrp->vlan_devices[vid] = NULL; | ||
1944 | 1943 | ||
1945 | cb1 = kzalloc(PAGE_SIZE, GFP_KERNEL); | 1944 | cb1 = kzalloc(PAGE_SIZE, GFP_KERNEL); |
1946 | if (!cb1) { | 1945 | if (!cb1) { |
diff --git a/drivers/net/gianfar.c b/drivers/net/gianfar.c index 1f83988a6a64..02b61b85b62c 100644 --- a/drivers/net/gianfar.c +++ b/drivers/net/gianfar.c | |||
@@ -1132,8 +1132,7 @@ static void gfar_vlan_rx_kill_vid(struct net_device *dev, uint16_t vid) | |||
1132 | 1132 | ||
1133 | spin_lock_irqsave(&priv->rxlock, flags); | 1133 | spin_lock_irqsave(&priv->rxlock, flags); |
1134 | 1134 | ||
1135 | if (priv->vlgrp) | 1135 | vlan_group_set_device(priv->vgrp, vid, NULL); |
1136 | priv->vlgrp->vlan_devices[vid] = NULL; | ||
1137 | 1136 | ||
1138 | spin_unlock_irqrestore(&priv->rxlock, flags); | 1137 | spin_unlock_irqrestore(&priv->rxlock, flags); |
1139 | } | 1138 | } |
diff --git a/drivers/net/ixgb/ixgb_main.c b/drivers/net/ixgb/ixgb_main.c index 0c3682889344..afc2ec72529e 100644 --- a/drivers/net/ixgb/ixgb_main.c +++ b/drivers/net/ixgb/ixgb_main.c | |||
@@ -2213,8 +2213,7 @@ ixgb_vlan_rx_kill_vid(struct net_device *netdev, uint16_t vid) | |||
2213 | 2213 | ||
2214 | ixgb_irq_disable(adapter); | 2214 | ixgb_irq_disable(adapter); |
2215 | 2215 | ||
2216 | if(adapter->vlgrp) | 2216 | vlan_group_set_device(adapter->vlgrp, vid, NULL); |
2217 | adapter->vlgrp->vlan_devices[vid] = NULL; | ||
2218 | 2217 | ||
2219 | ixgb_irq_enable(adapter); | 2218 | ixgb_irq_enable(adapter); |
2220 | 2219 | ||
@@ -2234,7 +2233,7 @@ ixgb_restore_vlan(struct ixgb_adapter *adapter) | |||
2234 | if(adapter->vlgrp) { | 2233 | if(adapter->vlgrp) { |
2235 | uint16_t vid; | 2234 | uint16_t vid; |
2236 | for(vid = 0; vid < VLAN_GROUP_ARRAY_LEN; vid++) { | 2235 | for(vid = 0; vid < VLAN_GROUP_ARRAY_LEN; vid++) { |
2237 | if(!adapter->vlgrp->vlan_devices[vid]) | 2236 | if(!vlan_group_get_device(adapter->vlgrp, vid)) |
2238 | continue; | 2237 | continue; |
2239 | ixgb_vlan_rx_add_vid(adapter->netdev, vid); | 2238 | ixgb_vlan_rx_add_vid(adapter->netdev, vid); |
2240 | } | 2239 | } |
diff --git a/drivers/net/ns83820.c b/drivers/net/ns83820.c index 568daeb3e9d8..9ec6e9e54f47 100644 --- a/drivers/net/ns83820.c +++ b/drivers/net/ns83820.c | |||
@@ -514,8 +514,7 @@ static void ns83820_vlan_rx_kill_vid(struct net_device *ndev, unsigned short vid | |||
514 | 514 | ||
515 | spin_lock_irq(&dev->misc_lock); | 515 | spin_lock_irq(&dev->misc_lock); |
516 | spin_lock(&dev->tx_lock); | 516 | spin_lock(&dev->tx_lock); |
517 | if (dev->vlgrp) | 517 | vlan_group_set_device(dev->vlgrp, vid, NULL); |
518 | dev->vlgrp->vlan_devices[vid] = NULL; | ||
519 | spin_unlock(&dev->tx_lock); | 518 | spin_unlock(&dev->tx_lock); |
520 | spin_unlock_irq(&dev->misc_lock); | 519 | spin_unlock_irq(&dev->misc_lock); |
521 | } | 520 | } |
diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c index 13cf06ee97f7..15d954e50cae 100644 --- a/drivers/net/r8169.c +++ b/drivers/net/r8169.c | |||
@@ -890,8 +890,7 @@ static void rtl8169_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid) | |||
890 | unsigned long flags; | 890 | unsigned long flags; |
891 | 891 | ||
892 | spin_lock_irqsave(&tp->lock, flags); | 892 | spin_lock_irqsave(&tp->lock, flags); |
893 | if (tp->vlgrp) | 893 | vlan_group_set_device(tp->vlgrp, vid, NULL); |
894 | tp->vlgrp->vlan_devices[vid] = NULL; | ||
895 | spin_unlock_irqrestore(&tp->lock, flags); | 894 | spin_unlock_irqrestore(&tp->lock, flags); |
896 | } | 895 | } |
897 | 896 | ||
diff --git a/drivers/net/s2io.c b/drivers/net/s2io.c index 44bb2395af84..46ebf141ee5a 100644 --- a/drivers/net/s2io.c +++ b/drivers/net/s2io.c | |||
@@ -325,8 +325,7 @@ static void s2io_vlan_rx_kill_vid(struct net_device *dev, unsigned long vid) | |||
325 | unsigned long flags; | 325 | unsigned long flags; |
326 | 326 | ||
327 | spin_lock_irqsave(&nic->tx_lock, flags); | 327 | spin_lock_irqsave(&nic->tx_lock, flags); |
328 | if (nic->vlgrp) | 328 | vlan_group_set_device(nic->vlgrp, vid, NULL); |
329 | nic->vlgrp->vlan_devices[vid] = NULL; | ||
330 | spin_unlock_irqrestore(&nic->tx_lock, flags); | 329 | spin_unlock_irqrestore(&nic->tx_lock, flags); |
331 | } | 330 | } |
332 | 331 | ||
diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c index 52edbd7ac17e..53839979cfb8 100644 --- a/drivers/net/sky2.c +++ b/drivers/net/sky2.c | |||
@@ -1053,8 +1053,7 @@ static void sky2_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid) | |||
1053 | 1053 | ||
1054 | sky2_write32(hw, SK_REG(port, RX_GMF_CTRL_T), RX_VLAN_STRIP_OFF); | 1054 | sky2_write32(hw, SK_REG(port, RX_GMF_CTRL_T), RX_VLAN_STRIP_OFF); |
1055 | sky2_write32(hw, SK_REG(port, TX_GMF_CTRL_T), TX_VLAN_TAG_OFF); | 1055 | sky2_write32(hw, SK_REG(port, TX_GMF_CTRL_T), TX_VLAN_TAG_OFF); |
1056 | if (sky2->vlgrp) | 1056 | vlan_group_set_device(sky2->vlgrp, vid, NULL); |
1057 | sky2->vlgrp->vlan_devices[vid] = NULL; | ||
1058 | 1057 | ||
1059 | netif_tx_unlock_bh(dev); | 1058 | netif_tx_unlock_bh(dev); |
1060 | } | 1059 | } |
diff --git a/drivers/net/starfire.c b/drivers/net/starfire.c index bf873ea25797..8bba2e3da7e1 100644 --- a/drivers/net/starfire.c +++ b/drivers/net/starfire.c | |||
@@ -677,8 +677,7 @@ static void netdev_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid) | |||
677 | spin_lock(&np->lock); | 677 | spin_lock(&np->lock); |
678 | if (debug > 1) | 678 | if (debug > 1) |
679 | printk("%s: removing vlanid %d from vlan filter\n", dev->name, vid); | 679 | printk("%s: removing vlanid %d from vlan filter\n", dev->name, vid); |
680 | if (np->vlgrp) | 680 | vlan_group_set_device(np->vlgrp, vid, NULL); |
681 | np->vlgrp->vlan_devices[vid] = NULL; | ||
682 | set_rx_mode(dev); | 681 | set_rx_mode(dev); |
683 | spin_unlock(&np->lock); | 682 | spin_unlock(&np->lock); |
684 | } | 683 | } |
@@ -1738,7 +1737,7 @@ static void set_rx_mode(struct net_device *dev) | |||
1738 | int vlan_count = 0; | 1737 | int vlan_count = 0; |
1739 | void __iomem *filter_addr = ioaddr + HashTable + 8; | 1738 | void __iomem *filter_addr = ioaddr + HashTable + 8; |
1740 | for (i = 0; i < VLAN_VID_MASK; i++) { | 1739 | for (i = 0; i < VLAN_VID_MASK; i++) { |
1741 | if (np->vlgrp->vlan_devices[i]) { | 1740 | if (vlan_group_get_device(np->vlgrp, i)) { |
1742 | if (vlan_count >= 32) | 1741 | if (vlan_count >= 32) |
1743 | break; | 1742 | break; |
1744 | writew(cpu_to_be16(i), filter_addr); | 1743 | writew(cpu_to_be16(i), filter_addr); |
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c index 26c6ac48288c..8c8f9f4d47a5 100644 --- a/drivers/net/tg3.c +++ b/drivers/net/tg3.c | |||
@@ -9114,8 +9114,7 @@ static void tg3_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid) | |||
9114 | tg3_netif_stop(tp); | 9114 | tg3_netif_stop(tp); |
9115 | 9115 | ||
9116 | tg3_full_lock(tp, 0); | 9116 | tg3_full_lock(tp, 0); |
9117 | if (tp->vlgrp) | 9117 | vlan_group_set_device(tp->vlgrp, vid, NULL); |
9118 | tp->vlgrp->vlan_devices[vid] = NULL; | ||
9119 | tg3_full_unlock(tp); | 9118 | tg3_full_unlock(tp); |
9120 | 9119 | ||
9121 | if (netif_running(dev)) | 9120 | if (netif_running(dev)) |
diff --git a/drivers/net/typhoon.c b/drivers/net/typhoon.c index 9781b16bb8b6..0d91d094edd9 100644 --- a/drivers/net/typhoon.c +++ b/drivers/net/typhoon.c | |||
@@ -746,8 +746,7 @@ typhoon_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid) | |||
746 | { | 746 | { |
747 | struct typhoon *tp = netdev_priv(dev); | 747 | struct typhoon *tp = netdev_priv(dev); |
748 | spin_lock_bh(&tp->state_lock); | 748 | spin_lock_bh(&tp->state_lock); |
749 | if(tp->vlgrp) | 749 | vlan_group_set_device(tp->vlgrp, vid, NULL); |
750 | tp->vlgrp->vlan_devices[vid] = NULL; | ||
751 | spin_unlock_bh(&tp->state_lock); | 750 | spin_unlock_bh(&tp->state_lock); |
752 | } | 751 | } |
753 | 752 | ||
diff --git a/drivers/s390/net/qeth_main.c b/drivers/s390/net/qeth_main.c index 2257e45594b3..d8a86f5af379 100644 --- a/drivers/s390/net/qeth_main.c +++ b/drivers/s390/net/qeth_main.c | |||
@@ -3654,7 +3654,7 @@ qeth_verify_vlan_dev(struct net_device *dev, struct qeth_card *card) | |||
3654 | return rc; | 3654 | return rc; |
3655 | 3655 | ||
3656 | for (i = 0; i < VLAN_GROUP_ARRAY_LEN; i++){ | 3656 | for (i = 0; i < VLAN_GROUP_ARRAY_LEN; i++){ |
3657 | if (vg->vlan_devices[i] == dev){ | 3657 | if (vlan_group_get_device(vg, i) == dev){ |
3658 | rc = QETH_VLAN_CARD; | 3658 | rc = QETH_VLAN_CARD; |
3659 | break; | 3659 | break; |
3660 | } | 3660 | } |
@@ -5261,7 +5261,7 @@ qeth_free_vlan_addresses4(struct qeth_card *card, unsigned short vid) | |||
5261 | QETH_DBF_TEXT(trace, 4, "frvaddr4"); | 5261 | QETH_DBF_TEXT(trace, 4, "frvaddr4"); |
5262 | 5262 | ||
5263 | rcu_read_lock(); | 5263 | rcu_read_lock(); |
5264 | in_dev = __in_dev_get_rcu(card->vlangrp->vlan_devices[vid]); | 5264 | in_dev = __in_dev_get_rcu(vlan_group_get_device(card->vlangrp, vid)); |
5265 | if (!in_dev) | 5265 | if (!in_dev) |
5266 | goto out; | 5266 | goto out; |
5267 | for (ifa = in_dev->ifa_list; ifa; ifa = ifa->ifa_next) { | 5267 | for (ifa = in_dev->ifa_list; ifa; ifa = ifa->ifa_next) { |
@@ -5288,7 +5288,7 @@ qeth_free_vlan_addresses6(struct qeth_card *card, unsigned short vid) | |||
5288 | 5288 | ||
5289 | QETH_DBF_TEXT(trace, 4, "frvaddr6"); | 5289 | QETH_DBF_TEXT(trace, 4, "frvaddr6"); |
5290 | 5290 | ||
5291 | in6_dev = in6_dev_get(card->vlangrp->vlan_devices[vid]); | 5291 | in6_dev = in6_dev_get(vlan_group_get_device(card->vlangrp, vid)); |
5292 | if (!in6_dev) | 5292 | if (!in6_dev) |
5293 | return; | 5293 | return; |
5294 | for (ifa = in6_dev->addr_list; ifa; ifa = ifa->lst_next){ | 5294 | for (ifa = in6_dev->addr_list; ifa; ifa = ifa->lst_next){ |
@@ -5360,7 +5360,7 @@ qeth_layer2_process_vlans(struct qeth_card *card, int clear) | |||
5360 | if (!card->vlangrp) | 5360 | if (!card->vlangrp) |
5361 | return; | 5361 | return; |
5362 | for (i = 0; i < VLAN_GROUP_ARRAY_LEN; i++) { | 5362 | for (i = 0; i < VLAN_GROUP_ARRAY_LEN; i++) { |
5363 | if (card->vlangrp->vlan_devices[i] == NULL) | 5363 | if (vlan_group_get_device(card->vlangrp, i) == NULL) |
5364 | continue; | 5364 | continue; |
5365 | if (clear) | 5365 | if (clear) |
5366 | qeth_layer2_send_setdelvlan(card, i, IPA_CMD_DELVLAN); | 5366 | qeth_layer2_send_setdelvlan(card, i, IPA_CMD_DELVLAN); |
@@ -5398,8 +5398,7 @@ qeth_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid) | |||
5398 | spin_lock_irqsave(&card->vlanlock, flags); | 5398 | spin_lock_irqsave(&card->vlanlock, flags); |
5399 | /* unregister IP addresses of vlan device */ | 5399 | /* unregister IP addresses of vlan device */ |
5400 | qeth_free_vlan_addresses(card, vid); | 5400 | qeth_free_vlan_addresses(card, vid); |
5401 | if (card->vlangrp) | 5401 | vlan_group_set_device(card->vlangrp, vid, NULL); |
5402 | card->vlangrp->vlan_devices[vid] = NULL; | ||
5403 | spin_unlock_irqrestore(&card->vlanlock, flags); | 5402 | spin_unlock_irqrestore(&card->vlanlock, flags); |
5404 | if (card->options.layer2) | 5403 | if (card->options.layer2) |
5405 | qeth_layer2_send_setdelvlan(card, vid, IPA_CMD_DELVLAN); | 5404 | qeth_layer2_send_setdelvlan(card, vid, IPA_CMD_DELVLAN); |
@@ -5662,10 +5661,11 @@ qeth_add_vlan_mc(struct qeth_card *card) | |||
5662 | 5661 | ||
5663 | vg = card->vlangrp; | 5662 | vg = card->vlangrp; |
5664 | for (i = 0; i < VLAN_GROUP_ARRAY_LEN; i++) { | 5663 | for (i = 0; i < VLAN_GROUP_ARRAY_LEN; i++) { |
5665 | if (vg->vlan_devices[i] == NULL || | 5664 | struct net_device *netdev = vlan_group_get_device(vg, i); |
5666 | !(vg->vlan_devices[i]->flags & IFF_UP)) | 5665 | if (netdev == NULL || |
5666 | !(netdev->flags & IFF_UP)) | ||
5667 | continue; | 5667 | continue; |
5668 | in_dev = in_dev_get(vg->vlan_devices[i]); | 5668 | in_dev = in_dev_get(netdev); |
5669 | if (!in_dev) | 5669 | if (!in_dev) |
5670 | continue; | 5670 | continue; |
5671 | read_lock(&in_dev->mc_list_lock); | 5671 | read_lock(&in_dev->mc_list_lock); |
@@ -5749,10 +5749,11 @@ qeth_add_vlan_mc6(struct qeth_card *card) | |||
5749 | 5749 | ||
5750 | vg = card->vlangrp; | 5750 | vg = card->vlangrp; |
5751 | for (i = 0; i < VLAN_GROUP_ARRAY_LEN; i++) { | 5751 | for (i = 0; i < VLAN_GROUP_ARRAY_LEN; i++) { |
5752 | if (vg->vlan_devices[i] == NULL || | 5752 | struct net_device *netdev = vlan_group_get_device(vg, i); |
5753 | !(vg->vlan_devices[i]->flags & IFF_UP)) | 5753 | if (netdev == NULL || |
5754 | !(netdev->flags & IFF_UP)) | ||
5754 | continue; | 5755 | continue; |
5755 | in_dev = in6_dev_get(vg->vlan_devices[i]); | 5756 | in_dev = in6_dev_get(netdev); |
5756 | if (!in_dev) | 5757 | if (!in_dev) |
5757 | continue; | 5758 | continue; |
5758 | read_lock(&in_dev->lock); | 5759 | read_lock(&in_dev->lock); |