Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 162915
b: refs/heads/master
c: 12cbcfd
h: refs/heads/master
i:
  162913: 7c168d0
  162911: 3d3cf26
v: v3
  • Loading branch information
David S. Miller committed Sep 17, 2009
1 parent 5ce3714 commit 8a7cfce
Show file tree
Hide file tree
Showing 120 changed files with 1,655 additions and 589 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: c4835d81efb1795eb8bbeb40b73d74e5c04b1257
refs/heads/master: 12cbcfd386df56dce8b8ba6ba2c7f85680793716
7 changes: 3 additions & 4 deletions trunk/drivers/net/b44.c
Original file line number Diff line number Diff line change
Expand Up @@ -847,23 +847,22 @@ static int b44_poll(struct napi_struct *napi, int budget)
{
struct b44 *bp = container_of(napi, struct b44, napi);
int work_done;
unsigned long flags;

spin_lock_irq(&bp->lock);
spin_lock_irqsave(&bp->lock, flags);

if (bp->istat & (ISTAT_TX | ISTAT_TO)) {
/* spin_lock(&bp->tx_lock); */
b44_tx(bp);
/* spin_unlock(&bp->tx_lock); */
}
spin_unlock_irq(&bp->lock);
spin_unlock_irqrestore(&bp->lock, flags);

work_done = 0;
if (bp->istat & ISTAT_RX)
work_done += b44_rx(bp, budget);

if (bp->istat & ISTAT_ERRORS) {
unsigned long flags;

spin_lock_irqsave(&bp->lock, flags);
b44_halt(bp);
b44_init_rings(bp);
Expand Down
131 changes: 41 additions & 90 deletions trunk/drivers/net/bonding/bond_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1093,31 +1093,23 @@ static struct slave *bond_find_best_slave(struct bonding *bond)
return NULL; /* still no slave, return NULL */
}

/*
* first try the primary link; if arping, a link must tx/rx
* traffic before it can be considered the curr_active_slave.
* also, we would skip slaves between the curr_active_slave
* and primary_slave that may be up and able to arp
*/
if ((bond->primary_slave) &&
(!bond->params.arp_interval) &&
(IS_UP(bond->primary_slave->dev))) {
bond->primary_slave->link == BOND_LINK_UP) {
new_active = bond->primary_slave;
}

/* remember where to stop iterating over the slaves */
old_active = new_active;

bond_for_each_slave_from(bond, new_active, i, old_active) {
if (IS_UP(new_active->dev)) {
if (new_active->link == BOND_LINK_UP) {
return new_active;
} else if (new_active->link == BOND_LINK_BACK) {
/* link up, but waiting for stabilization */
if (new_active->delay < mintime) {
mintime = new_active->delay;
bestslave = new_active;
}
if (new_active->link == BOND_LINK_UP) {
return new_active;
} else if (new_active->link == BOND_LINK_BACK &&
IS_UP(new_active->dev)) {
/* link up, but waiting for stabilization */
if (new_active->delay < mintime) {
mintime = new_active->delay;
bestslave = new_active;
}
}
}
Expand Down Expand Up @@ -1211,7 +1203,7 @@ void bond_change_active_slave(struct bonding *bond, struct slave *new_active)
write_unlock_bh(&bond->curr_slave_lock);
read_unlock(&bond->lock);

netdev_bonding_change(bond->dev);
netdev_bonding_change(bond->dev, NETDEV_BONDING_FAILOVER);

read_lock(&bond->lock);
write_lock_bh(&bond->curr_slave_lock);
Expand Down Expand Up @@ -1469,14 +1461,17 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
*/
if (bond->slave_cnt == 0) {
if (bond_dev->type != slave_dev->type) {
dev_close(bond_dev);
pr_debug("%s: change device type from %d to %d\n",
bond_dev->name, bond_dev->type, slave_dev->type);

netdev_bonding_change(bond_dev, NETDEV_BONDING_OLDTYPE);

if (slave_dev->type != ARPHRD_ETHER)
bond_setup_by_slave(bond_dev, slave_dev);
else
ether_setup(bond_dev);
dev_open(bond_dev);

netdev_bonding_change(bond_dev, NETDEV_BONDING_NEWTYPE);
}
} else if (bond_dev->type != slave_dev->type) {
pr_err(DRV_NAME ": %s ether type (%d) is different "
Expand Down Expand Up @@ -2929,18 +2924,6 @@ static int bond_ab_arp_inspect(struct bonding *bond, int delta_in_ticks)
}
}

read_lock(&bond->curr_slave_lock);

/*
* Trigger a commit if the primary option setting has changed.
*/
if (bond->primary_slave &&
(bond->primary_slave != bond->curr_active_slave) &&
(bond->primary_slave->link == BOND_LINK_UP))
commit++;

read_unlock(&bond->curr_slave_lock);

return commit;
}

Expand All @@ -2961,90 +2944,58 @@ static void bond_ab_arp_commit(struct bonding *bond, int delta_in_ticks)
continue;

case BOND_LINK_UP:
write_lock_bh(&bond->curr_slave_lock);

if (!bond->curr_active_slave &&
time_before_eq(jiffies, dev_trans_start(slave->dev) +
delta_in_ticks)) {
if ((!bond->curr_active_slave &&
time_before_eq(jiffies,
dev_trans_start(slave->dev) +
delta_in_ticks)) ||
bond->curr_active_slave != slave) {
slave->link = BOND_LINK_UP;
bond_change_active_slave(bond, slave);
bond->current_arp_slave = NULL;

pr_info(DRV_NAME
": %s: %s is up and now the "
"active interface\n",
bond->dev->name, slave->dev->name);

} else if (bond->curr_active_slave != slave) {
/* this slave has just come up but we
* already have a current slave; this can
* also happen if bond_enslave adds a new
* slave that is up while we are searching
* for a new slave
*/
slave->link = BOND_LINK_UP;
bond_set_slave_inactive_flags(slave);
bond->current_arp_slave = NULL;
": %s: link status definitely "
"up for interface %s.\n",
bond->dev->name, slave->dev->name);

pr_info(DRV_NAME
": %s: backup interface %s is now up\n",
bond->dev->name, slave->dev->name);
}
if (!bond->curr_active_slave ||
(slave == bond->primary_slave))
goto do_failover;

write_unlock_bh(&bond->curr_slave_lock);
}

break;
continue;

case BOND_LINK_DOWN:
if (slave->link_failure_count < UINT_MAX)
slave->link_failure_count++;

slave->link = BOND_LINK_DOWN;
bond_set_slave_inactive_flags(slave);

if (slave == bond->curr_active_slave) {
pr_info(DRV_NAME
": %s: link status down for active "
"interface %s, disabling it\n",
bond->dev->name, slave->dev->name);

bond_set_slave_inactive_flags(slave);

write_lock_bh(&bond->curr_slave_lock);

bond_select_active_slave(bond);
if (bond->curr_active_slave)
bond->curr_active_slave->jiffies =
jiffies;

write_unlock_bh(&bond->curr_slave_lock);
pr_info(DRV_NAME
": %s: link status definitely down for "
"interface %s, disabling it\n",
bond->dev->name, slave->dev->name);

if (slave == bond->curr_active_slave) {
bond->current_arp_slave = NULL;

} else if (slave->state == BOND_STATE_BACKUP) {
pr_info(DRV_NAME
": %s: backup interface %s is now down\n",
bond->dev->name, slave->dev->name);

bond_set_slave_inactive_flags(slave);
goto do_failover;
}
break;

continue;

default:
pr_err(DRV_NAME
": %s: impossible: new_link %d on slave %s\n",
bond->dev->name, slave->new_link,
slave->dev->name);
continue;
}
}

/*
* No race with changes to primary via sysfs, as we hold rtnl.
*/
if (bond->primary_slave &&
(bond->primary_slave != bond->curr_active_slave) &&
(bond->primary_slave->link == BOND_LINK_UP)) {
do_failover:
ASSERT_RTNL();
write_lock_bh(&bond->curr_slave_lock);
bond_change_active_slave(bond, bond->primary_slave);
bond_select_active_slave(bond);
write_unlock_bh(&bond->curr_slave_lock);
}

Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/net/can/vcan.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ static void vcan_rx(struct sk_buff *skb, struct net_device *dev)
skb->dev = dev;
skb->ip_summed = CHECKSUM_UNNECESSARY;

netif_rx(skb);
netif_rx_ni(skb);
}

static netdev_tx_t vcan_tx(struct sk_buff *skb, struct net_device *dev)
Expand Down
Loading

0 comments on commit 8a7cfce

Please sign in to comment.