Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 189178
b: refs/heads/master
c: a2fd940
h: refs/heads/master
v: v3
  • Loading branch information
Andy Gospodarek authored and David S. Miller committed Mar 27, 2010
1 parent f389c57 commit 2af7e8f
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 9 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: 44ebb95290afcc687511ad3f7fd6434e867c270a
refs/heads/master: a2fd940f4cff74b932728bd6ca12848da21a0234
40 changes: 32 additions & 8 deletions trunk/drivers/net/bonding/bond_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1235,6 +1235,11 @@ void bond_change_active_slave(struct bonding *bond, struct slave *new_active)
write_lock_bh(&bond->curr_slave_lock);
}
}

/* resend IGMP joins since all were sent on curr_active_slave */
if (bond->params.mode == BOND_MODE_ROUNDROBIN) {
bond_resend_igmp_join_requests(bond);
}
}

/**
Expand Down Expand Up @@ -4138,22 +4143,41 @@ static int bond_xmit_roundrobin(struct sk_buff *skb, struct net_device *bond_dev
struct bonding *bond = netdev_priv(bond_dev);
struct slave *slave, *start_at;
int i, slave_no, res = 1;
struct iphdr *iph = ip_hdr(skb);

read_lock(&bond->lock);

if (!BOND_IS_OK(bond))
goto out;

/*
* Concurrent TX may collide on rr_tx_counter; we accept that
* as being rare enough not to justify using an atomic op here
* Start with the curr_active_slave that joined the bond as the
* default for sending IGMP traffic. For failover purposes one
* needs to maintain some consistency for the interface that will
* send the join/membership reports. The curr_active_slave found
* will send all of this type of traffic.
*/
slave_no = bond->rr_tx_counter++ % bond->slave_cnt;
if ((iph->protocol == htons(IPPROTO_IGMP)) &&
(skb->protocol == htons(ETH_P_IP))) {

bond_for_each_slave(bond, slave, i) {
slave_no--;
if (slave_no < 0)
break;
read_lock(&bond->curr_slave_lock);
slave = bond->curr_active_slave;
read_unlock(&bond->curr_slave_lock);

if (!slave)
goto out;
} else {
/*
* Concurrent TX may collide on rr_tx_counter; we accept
* that as being rare enough not to justify using an
* atomic op here.
*/
slave_no = bond->rr_tx_counter++ % bond->slave_cnt;

bond_for_each_slave(bond, slave, i) {
slave_no--;
if (slave_no < 0)
break;
}
}

start_at = slave;
Expand Down

0 comments on commit 2af7e8f

Please sign in to comment.