diff options
author | Jay Vosburgh <fubar@us.ibm.com> | 2010-07-21 08:14:47 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-07-22 17:14:46 -0400 |
commit | f35188faa0fbabefac476536994f4b6f3677380f (patch) | |
tree | 460c54e3d8505fd0ce42d16a1798c1f8c371d4a9 /drivers/net/bonding/bond_alb.c | |
parent | 4bee1f9ac066ef0350b961eab9fedc4d0bd0a549 (diff) |
bonding: change test for presence of VLANs
After commit ad1afb00393915a51c21b1ae8704562bf036855f
("vlan_dev: VLAN 0 should be treated as "no vlan tag" (802.1p packet)")
it is now regular practice for a VLAN "add vid" for VLAN 0 to
arrive prior to any VLAN registration or creation of a vlan_group.
This patch updates the bonding code that tests for the presence
of VLANs configured above bonding. The new logic tests for bond->vlgrp
to determine if a registration has occured, instead of testing that
bonding's internal vlan_list is empty.
The old code would panic when vlan_list was not empty, but
vlgrp was still NULL (because only an "add vid" for VLAN 0 had occured).
Bonding still adds VLAN 0 to its internal list so that 802.1p
frames are handled correctly on transmit when non-VLAN accelerated
slaves are members of the bond. The test against bond->vlan_list
remains in bond_dev_queue_xmit for this reason.
Modification to the bond->vlgrp now occurs under lock (in
addition to RTNL), because not all inspections of it occur under RTNL.
Additionally, because 8021q will never issue a "kill vid" for
VLAN 0, there is now logic in bond_uninit to release any remaining
entries from vlan_list.
Signed-off-by: Jay Vosburgh <fubar@us.ibm.com>
Cc: Pedro Garcia <pedro.netdev@dondevamos.com>
Cc: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/bonding/bond_alb.c')
-rw-r--r-- | drivers/net/bonding/bond_alb.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/bonding/bond_alb.c b/drivers/net/bonding/bond_alb.c index 3662d6e446a9..e3b35d0b4284 100644 --- a/drivers/net/bonding/bond_alb.c +++ b/drivers/net/bonding/bond_alb.c | |||
@@ -682,7 +682,7 @@ static struct slave *rlb_choose_channel(struct sk_buff *skb, struct bonding *bon | |||
682 | client_info->ntt = 0; | 682 | client_info->ntt = 0; |
683 | } | 683 | } |
684 | 684 | ||
685 | if (!list_empty(&bond->vlan_list)) { | 685 | if (bond->vlgrp) { |
686 | if (!vlan_get_tag(skb, &client_info->vlan_id)) | 686 | if (!vlan_get_tag(skb, &client_info->vlan_id)) |
687 | client_info->tag = 1; | 687 | client_info->tag = 1; |
688 | } | 688 | } |
@@ -904,7 +904,7 @@ static void alb_send_learning_packets(struct slave *slave, u8 mac_addr[]) | |||
904 | skb->priority = TC_PRIO_CONTROL; | 904 | skb->priority = TC_PRIO_CONTROL; |
905 | skb->dev = slave->dev; | 905 | skb->dev = slave->dev; |
906 | 906 | ||
907 | if (!list_empty(&bond->vlan_list)) { | 907 | if (bond->vlgrp) { |
908 | struct vlan_entry *vlan; | 908 | struct vlan_entry *vlan; |
909 | 909 | ||
910 | vlan = bond_next_vlan(bond, | 910 | vlan = bond_next_vlan(bond, |