Home Home > GIT Browse
diff options
authorMichal Kubecek <mkubecek@suse.cz>2019-09-17 14:24:49 +0200
committerMichal Kubecek <mkubecek@suse.cz>2019-09-17 14:24:55 +0200
commitdf6116d9a47fbe8aebcb9d8fdaedb72100c54e44 (patch)
parent9089d1152e96c758ddd86e3f26994a29d55dbdb9 (diff)
bonding/802.3ad: fix slave link initialization transition states
(bsc#1137069 bsc#1141013).
2 files changed, 67 insertions, 0 deletions
diff --git a/patches.suse/bonding-802.3ad-fix-slave-link-initialization-transi.patch b/patches.suse/bonding-802.3ad-fix-slave-link-initialization-transi.patch
new file mode 100644
index 0000000000..f5ec0ef63b
--- /dev/null
+++ b/patches.suse/bonding-802.3ad-fix-slave-link-initialization-transi.patch
@@ -0,0 +1,66 @@
+From: Jarod Wilson <jarod@redhat.com>
+Subject: bonding/802.3ad: fix slave link initialization transition states
+Patch-mainline: v5.2-rc3
+Git-commit: 334031219a84b9994594015aab85ed7754c80176
+References: bsc#1137069 bsc#1141013
+Once in a while, with just the right timing, 802.3ad slaves will fail to
+properly initialize, winding up in a weird state, with a partner system
+mac address of 00:00:00:00:00:00. This started happening after a fix to
+properly track link_failure_count tracking, where an 802.3ad slave that
+reported itself as link up in the miimon code, but wasn't able to get a
+valid speed/duplex, started getting set to BOND_LINK_FAIL instead of
+BOND_LINK_DOWN. That was the proper thing to do for the general "my link
+went down" case, but has created a link initialization race that can put
+the interface in this odd state.
+The simple fix is to instead set the slave link to BOND_LINK_DOWN again,
+if the link has never been up (last_link_up == 0), so the link state
+doesn't bounce from BOND_LINK_DOWN to BOND_LINK_FAIL -- it hasn't failed
+in this case, it simply hasn't been up yet, and this prevents the
+unnecessary state change from DOWN to FAIL and getting stuck in an init
+failure w/o a partner mac.
+Fixes: ea53abfab960 ("bonding/802.3ad: fix link_failure_count tracking")
+CC: Jay Vosburgh <j.vosburgh@gmail.com>
+CC: Veaceslav Falico <vfalico@gmail.com>
+CC: Andy Gospodarek <andy@greyhouse.net>
+CC: "David S. Miller" <davem@davemloft.net>
+CC: netdev@vger.kernel.org
+Tested-by: Heesoon Kim <Heesoon.Kim@stratus.com>
+Signed-off-by: Jarod Wilson <jarod@redhat.com>
+Acked-by: Jay Vosburgh <jay.vosburgh@canonical.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Reviewed-by: Jiri Wiesner <jwiesner@suse.com>
+Acked-by: Michal Kubecek <mkubecek@suse.cz>
+ drivers/net/bonding/bond_main.c | 15 ++++++++++-----
+ 1 file changed, 10 insertions(+), 5 deletions(-)
+--- a/drivers/net/bonding/bond_main.c
++++ b/drivers/net/bonding/bond_main.c
+@@ -3088,13 +3088,18 @@ static int bond_slave_netdev_event(unsigned long event,
+ /* For 802.3ad mode only:
+ * Getting invalid Speed/Duplex values here will put slave
+- * in weird state. So mark it as link-fail for the time
+- * being and let link-monitoring (miimon) set it right when
+- * correct speeds/duplex are available.
++ * in weird state. Mark it as link-fail if the link was
++ * previously up or link-down if it hasn't yet come up, and
++ * let link-monitoring (miimon) set it right when correct
++ * speeds/duplex are available.
+ */
+ if (bond_update_speed_duplex(slave) &&
+- BOND_MODE(bond) == BOND_MODE_8023AD)
+- slave->link = BOND_LINK_FAIL;
++ BOND_MODE(bond) == BOND_MODE_8023AD) {
++ if (slave->last_link_up)
++ slave->link = BOND_LINK_FAIL;
++ else
++ slave->link = BOND_LINK_DOWN;
++ }
+ if (BOND_MODE(bond) == BOND_MODE_8023AD)
+ bond_3ad_adapter_speed_duplex_changed(slave);
diff --git a/series.conf b/series.conf
index 694ab4eb00..957f0be7ff 100644
--- a/series.conf
+++ b/series.conf
@@ -23419,6 +23419,7 @@
+ patches.suse/bonding-802.3ad-fix-slave-link-initialization-transi.patch