]> git.baikalelectronics.ru Git - kernel.git/commit
bonding/802.3ad: fix link_failure_count tracking
authorJarod Wilson <jarod@redhat.com>
Sun, 4 Nov 2018 19:59:46 +0000 (14:59 -0500)
committerDavid S. Miller <davem@davemloft.net>
Mon, 5 Nov 2018 00:44:44 +0000 (16:44 -0800)
commit2615f78925461dab9f386bfb4841c1f7efed8870
treef9723d9631cb90a47b462d8499524a70f1700187
parent7772d8ab591b46c0f93191e306e97ec7fa62f62b
bonding/802.3ad: fix link_failure_count tracking

Commit 05e3bb81530f43b4771f65b797027e65b9460f7e 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: 05e3bb81530f ("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>
drivers/net/bonding/bond_main.c