diff options
author | Jay Vosburgh <fubar@us.ibm.com> | 2009-03-18 21:38:25 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-03-18 21:38:25 -0400 |
commit | 17d04500e2528217de5fe967599f98ee84348a9c (patch) | |
tree | eee21759194ab1e7499b4b0ee3c7421ef3129687 /drivers/net/bonding/bond_main.c | |
parent | 690103137267e9ed893febf7ff061af63e8235a9 (diff) |
bonding: Fix updating of speed/duplex changes
This patch corrects an omission from the following commit:
commit f0c76d61779b153dbfb955db3f144c62d02173c2
Author: Jay Vosburgh <fubar@us.ibm.com>
Date: Wed Jul 2 18:21:58 2008 -0700
bonding: refactor mii monitor
The un-refactored code checked the link speed and duplex of
every slave on every pass; the refactored code did not do so.
The 802.3ad and balance-alb/tlb modes utilize the speed and
duplex information, and require it to be kept up to date. This patch
adds a notifier check to perform the appropriate updating when the slave
device speed changes.
Signed-off-by: Jay Vosburgh <fubar@us.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/bonding/bond_main.c')
-rw-r--r-- | drivers/net/bonding/bond_main.c | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index e0578fe8c0db..3d76686dceca 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c | |||
@@ -3537,11 +3537,26 @@ static int bond_slave_netdev_event(unsigned long event, struct net_device *slave | |||
3537 | } | 3537 | } |
3538 | break; | 3538 | break; |
3539 | case NETDEV_CHANGE: | 3539 | case NETDEV_CHANGE: |
3540 | /* | 3540 | if (bond->params.mode == BOND_MODE_8023AD || bond_is_lb(bond)) { |
3541 | * TODO: is this what we get if somebody | 3541 | struct slave *slave; |
3542 | * sets up a hierarchical bond, then rmmod's | 3542 | |
3543 | * one of the slave bonding devices? | 3543 | slave = bond_get_slave_by_dev(bond, slave_dev); |
3544 | */ | 3544 | if (slave) { |
3545 | u16 old_speed = slave->speed; | ||
3546 | u16 old_duplex = slave->duplex; | ||
3547 | |||
3548 | bond_update_speed_duplex(slave); | ||
3549 | |||
3550 | if (bond_is_lb(bond)) | ||
3551 | break; | ||
3552 | |||
3553 | if (old_speed != slave->speed) | ||
3554 | bond_3ad_adapter_speed_changed(slave); | ||
3555 | if (old_duplex != slave->duplex) | ||
3556 | bond_3ad_adapter_duplex_changed(slave); | ||
3557 | } | ||
3558 | } | ||
3559 | |||
3545 | break; | 3560 | break; |
3546 | case NETDEV_DOWN: | 3561 | case NETDEV_DOWN: |
3547 | /* | 3562 | /* |