Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 255488
b: refs/heads/master
c: ba824a8
h: refs/heads/master
v: v3
  • Loading branch information
Peter Pan(潘卫平) authored and David S. Miller committed Jun 9, 2011
1 parent 208e14c commit 42658fb
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b880a954b9e2585ce325aedd76e4741880cab180
refs/heads/master: ba824a8b2d77942d51ce45ed721f65764c00ab50
31 changes: 31 additions & 0 deletions trunk/drivers/net/bonding/bond_3ad.c
Original file line number Diff line number Diff line change
Expand Up @@ -2473,3 +2473,34 @@ void bond_3ad_lacpdu_recv(struct sk_buff *skb, struct bonding *bond,
bond_3ad_rx_indication((struct lacpdu *) skb->data, slave, skb->len);
read_unlock(&bond->lock);
}

/*
* When modify lacp_rate parameter via sysfs,
* update actor_oper_port_state of each port.
*
* Hold slave->state_machine_lock,
* so we can modify port->actor_oper_port_state,
* no matter bond is up or down.
*/
void bond_3ad_update_lacp_rate(struct bonding *bond)
{
int i;
struct slave *slave;
struct port *port = NULL;
int lacp_fast;

read_lock(&bond->lock);
lacp_fast = bond->params.lacp_fast;

bond_for_each_slave(bond, slave, i) {
port = &(SLAVE_AD_INFO(slave).port);
__get_state_machine_lock(port);
if (lacp_fast)
port->actor_oper_port_state |= AD_STATE_LACP_TIMEOUT;
else
port->actor_oper_port_state &= ~AD_STATE_LACP_TIMEOUT;
__release_state_machine_lock(port);
}

read_unlock(&bond->lock);
}
1 change: 1 addition & 0 deletions trunk/drivers/net/bonding/bond_3ad.h
Original file line number Diff line number Diff line change
Expand Up @@ -282,5 +282,6 @@ int bond_3ad_xmit_xor(struct sk_buff *skb, struct net_device *dev);
void bond_3ad_lacpdu_recv(struct sk_buff *skb, struct bonding *bond,
struct slave *slave);
int bond_3ad_set_carrier(struct bonding *bond);
void bond_3ad_update_lacp_rate(struct bonding *bond);
#endif //__BOND_3AD_H__

1 change: 1 addition & 0 deletions trunk/drivers/net/bonding/bond_sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -804,6 +804,7 @@ static ssize_t bonding_store_lacp(struct device *d,

if ((new_value == 1) || (new_value == 0)) {
bond->params.lacp_fast = new_value;
bond_3ad_update_lacp_rate(bond);
pr_info("%s: Setting LACP rate to %s (%d).\n",
bond->dev->name, bond_lacp_tbl[new_value].modename,
new_value);
Expand Down

0 comments on commit 42658fb

Please sign in to comment.