Skip to content

Commit 6956f80

Browse files
jarodwilsonSomasundaram Krishnasamy
authored andcommitted
bonding/802.3ad: fix link_failure_count tracking
Orabug: 31730609 Commit 4d2c0cd 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: 4d2c0cd ("bonding: speed/duplex update at NETDEV_UP event") CC: Mahesh Bandewar <[email protected]> CC: David S. Miller <[email protected]> CC: [email protected] CC: [email protected] Signed-off-by: Jarod Wilson <[email protected]> Signed-off-by: David S. Miller <[email protected]> (cherry picked from commit ea53abf) Signed-off-by: Brian Maly <[email protected]> Reviewed-by: Venkat Venkatsubra <[email protected]> Signed-off-by: Somasundaram Krishnasamy <[email protected]>
1 parent 16541c3 commit 6956f80

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/net/bonding/bond_main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3089,13 +3089,13 @@ static int bond_slave_netdev_event(unsigned long event,
30893089
case NETDEV_CHANGE:
30903090
/* For 802.3ad mode only:
30913091
* Getting invalid Speed/Duplex values here will put slave
3092-
* in weird state. So mark it as link-down for the time
3092+
* in weird state. So mark it as link-fail for the time
30933093
* being and let link-monitoring (miimon) set it right when
30943094
* correct speeds/duplex are available.
30953095
*/
30963096
if (bond_update_speed_duplex(slave) &&
30973097
BOND_MODE(bond) == BOND_MODE_8023AD)
3098-
slave->link = BOND_LINK_DOWN;
3098+
slave->link = BOND_LINK_FAIL;
30993099

31003100
if (BOND_MODE(bond) == BOND_MODE_8023AD)
31013101
bond_3ad_adapter_speed_duplex_changed(slave);

0 commit comments

Comments
 (0)