diff options
author | Jarod Wilson <jarod@redhat.com> | 2018-11-04 14:59:46 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-11-04 19:44:44 -0500 |
commit | ea53abfab960909d622ca37bcfb8e1c5378d21cc (patch) | |
tree | f9723d9631cb90a47b462d8499524a70f1700187 /drivers/net | |
parent | 0432e833191ad4d17b7fc2364941f91dad51db1a (diff) |
bonding/802.3ad: fix link_failure_count tracking
Commit 4d2c0cda07448ea6980f00102dc3964eb25e241c set slave->link to
BOND_LINK_DOWN for 802.3ad bonds whenever invalid speed/duplex values
were read, to fix a problem with slaves getting into weird states, but
in the process, broke tracking of link failures, as going straight to
BOND_LINK_DOWN when a link is indeed down (cable pulled, switch rebooted)
means we broke out of bond_miimon_inspect()'s BOND_LINK_DOWN case because
!link_state was already true, we never incremented commit, and never got
a chance to call bond_miimon_commit(), where slave->link_failure_count
would be incremented. I believe the simple fix here is to mark the slave
as BOND_LINK_FAIL, and let bond_miimon_inspect() transition the link from
_FAIL to either _UP or _DOWN, and in the latter case, we now get proper
incrementing of link_failure_count again.
Fixes: 4d2c0cda0744 ("bonding: speed/duplex update at NETDEV_UP event")
CC: Mahesh Bandewar <maheshb@google.com>
CC: David S. Miller <davem@davemloft.net>
CC: netdev@vger.kernel.org
CC: stable@vger.kernel.org
Signed-off-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/bonding/bond_main.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index ffa37adb7681..333387f1f1fe 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c | |||
@@ -3112,13 +3112,13 @@ static int bond_slave_netdev_event(unsigned long event, | |||
3112 | case NETDEV_CHANGE: | 3112 | case NETDEV_CHANGE: |
3113 | /* For 802.3ad mode only: | 3113 | /* For 802.3ad mode only: |
3114 | * Getting invalid Speed/Duplex values here will put slave | 3114 | * Getting invalid Speed/Duplex values here will put slave |
3115 | * in weird state. So mark it as link-down for the time | 3115 | * in weird state. So mark it as link-fail for the time |
3116 | * being and let link-monitoring (miimon) set it right when | 3116 | * being and let link-monitoring (miimon) set it right when |
3117 | * correct speeds/duplex are available. | 3117 | * correct speeds/duplex are available. |
3118 | */ | 3118 | */ |
3119 | if (bond_update_speed_duplex(slave) && | 3119 | if (bond_update_speed_duplex(slave) && |
3120 | BOND_MODE(bond) == BOND_MODE_8023AD) | 3120 | BOND_MODE(bond) == BOND_MODE_8023AD) |
3121 | slave->link = BOND_LINK_DOWN; | 3121 | slave->link = BOND_LINK_FAIL; |
3122 | 3122 | ||
3123 | if (BOND_MODE(bond) == BOND_MODE_8023AD) | 3123 | if (BOND_MODE(bond) == BOND_MODE_8023AD) |
3124 | bond_3ad_adapter_speed_duplex_changed(slave); | 3124 | bond_3ad_adapter_speed_duplex_changed(slave); |