Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 203670
b: refs/heads/master
c: f35188f
h: refs/heads/master
v: v3
  • Loading branch information
Jay Vosburgh authored and David S. Miller committed Jul 22, 2010
1 parent 42800c2 commit 6ba898f
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4bee1f9ac066ef0350b961eab9fedc4d0bd0a549
refs/heads/master: f35188faa0fbabefac476536994f4b6f3677380f
4 changes: 2 additions & 2 deletions trunk/drivers/net/bonding/bond_alb.c
Original file line number Diff line number Diff line change
Expand Up @@ -682,7 +682,7 @@ static struct slave *rlb_choose_channel(struct sk_buff *skb, struct bonding *bon
client_info->ntt = 0;
}

if (!list_empty(&bond->vlan_list)) {
if (bond->vlgrp) {
if (!vlan_get_tag(skb, &client_info->vlan_id))
client_info->tag = 1;
}
Expand Down Expand Up @@ -904,7 +904,7 @@ static void alb_send_learning_packets(struct slave *slave, u8 mac_addr[])
skb->priority = TC_PRIO_CONTROL;
skb->dev = slave->dev;

if (!list_empty(&bond->vlan_list)) {
if (bond->vlgrp) {
struct vlan_entry *vlan;

vlan = bond_next_vlan(bond,
Expand Down
30 changes: 23 additions & 7 deletions trunk/drivers/net/bonding/bond_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,7 @@ int bond_dev_queue_xmit(struct bonding *bond, struct sk_buff *skb,
{
unsigned short uninitialized_var(vlan_id);

/* Test vlan_list not vlgrp to catch and handle 802.1p tags */
if (!list_empty(&bond->vlan_list) &&
!(slave_dev->features & NETIF_F_HW_VLAN_TX) &&
vlan_get_tag(skb, &vlan_id) == 0) {
Expand Down Expand Up @@ -487,7 +488,9 @@ static void bond_vlan_rx_register(struct net_device *bond_dev,
struct slave *slave;
int i;

write_lock(&bond->lock);
bond->vlgrp = grp;
write_unlock(&bond->lock);

bond_for_each_slave(bond, slave, i) {
struct net_device *slave_dev = slave->dev;
Expand Down Expand Up @@ -569,7 +572,7 @@ static void bond_add_vlans_on_slave(struct bonding *bond, struct net_device *sla

write_lock_bh(&bond->lock);

if (list_empty(&bond->vlan_list))
if (!bond->vlgrp)
goto out;

if ((slave_dev->features & NETIF_F_HW_VLAN_RX) &&
Expand All @@ -596,14 +599,16 @@ static void bond_del_vlans_from_slave(struct bonding *bond,

write_lock_bh(&bond->lock);

if (list_empty(&bond->vlan_list))
if (!bond->vlgrp)
goto out;

if (!(slave_dev->features & NETIF_F_HW_VLAN_FILTER) ||
!(slave_ops->ndo_vlan_rx_kill_vid))
goto unreg;

list_for_each_entry(vlan, &bond->vlan_list, vlan_list) {
if (!vlan->vlan_id)
continue;
/* Save and then restore vlan_dev in the grp array,
* since the slave's driver might clear it.
*/
Expand Down Expand Up @@ -1443,7 +1448,7 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
/* no need to lock since we're protected by rtnl_lock */
if (slave_dev->features & NETIF_F_VLAN_CHALLENGED) {
pr_debug("%s: NETIF_F_VLAN_CHALLENGED\n", slave_dev->name);
if (!list_empty(&bond->vlan_list)) {
if (bond->vlgrp) {
pr_err("%s: Error: cannot enslave VLAN challenged slave %s on VLAN enabled bond %s\n",
bond_dev->name, slave_dev->name, bond_dev->name);
return -EPERM;
Expand Down Expand Up @@ -1942,7 +1947,7 @@ int bond_release(struct net_device *bond_dev, struct net_device *slave_dev)
*/
memset(bond_dev->dev_addr, 0, bond_dev->addr_len);

if (list_empty(&bond->vlan_list)) {
if (!bond->vlgrp) {
bond_dev->features |= NETIF_F_VLAN_CHALLENGED;
} else {
pr_warning("%s: Warning: clearing HW address of %s while it still has VLANs.\n",
Expand Down Expand Up @@ -2134,9 +2139,9 @@ static int bond_release_all(struct net_device *bond_dev)
*/
memset(bond_dev->dev_addr, 0, bond_dev->addr_len);

if (list_empty(&bond->vlan_list))
if (!bond->vlgrp) {
bond_dev->features |= NETIF_F_VLAN_CHALLENGED;
else {
} else {
pr_warning("%s: Warning: clearing HW address of %s while it still has VLANs.\n",
bond_dev->name, bond_dev->name);
pr_warning("%s: When re-adding slaves, make sure the bond's HW address matches its VLANs'.\n",
Expand Down Expand Up @@ -2569,7 +2574,7 @@ static void bond_arp_send_all(struct bonding *bond, struct slave *slave)
if (!targets[i])
break;
pr_debug("basa: target %x\n", targets[i]);
if (list_empty(&bond->vlan_list)) {
if (!bond->vlgrp) {
pr_debug("basa: empty vlan: arp_send\n");
bond_arp_send(slave->dev, ARPOP_REQUEST, targets[i],
bond->master_ip, 0);
Expand Down Expand Up @@ -2658,6 +2663,9 @@ static void bond_send_gratuitous_arp(struct bonding *bond)
bond->master_ip, 0);
}

if (!bond->vlgrp)
return;

list_for_each_entry(vlan, &bond->vlan_list, vlan_list) {
vlan_dev = vlan_group_get_device(bond->vlgrp, vlan->vlan_id);
if (vlan->vlan_ip) {
Expand Down Expand Up @@ -3590,6 +3598,8 @@ static int bond_inetaddr_event(struct notifier_block *this, unsigned long event,
}

list_for_each_entry(vlan, &bond->vlan_list, vlan_list) {
if (!bond->vlgrp)
continue;
vlan_dev = vlan_group_get_device(bond->vlgrp, vlan->vlan_id);
if (vlan_dev == event_dev) {
switch (event) {
Expand Down Expand Up @@ -4686,6 +4696,7 @@ static void bond_work_cancel_all(struct bonding *bond)
static void bond_uninit(struct net_device *bond_dev)
{
struct bonding *bond = netdev_priv(bond_dev);
struct vlan_entry *vlan, *tmp;

bond_netpoll_cleanup(bond_dev);

Expand All @@ -4699,6 +4710,11 @@ static void bond_uninit(struct net_device *bond_dev)
bond_remove_proc_entry(bond);

__hw_addr_flush(&bond->mc_list);

list_for_each_entry_safe(vlan, tmp, &bond->vlan_list, vlan_list) {
list_del(&vlan->vlan_list);
kfree(vlan);
}
}

/*------------------------- Module initialization ---------------------------*/
Expand Down

0 comments on commit 6ba898f

Please sign in to comment.