summaryrefslogtreecommitdiff |
diff options
author | Kernel Build Daemon <kbuild@suse.de> | 2019-09-18 07:00:42 +0200 |
---|---|---|
committer | Kernel Build Daemon <kbuild@suse.de> | 2019-09-18 07:00:42 +0200 |
commit | 5fbcb0084b0570c05f70af1a7670ce81b53e6601 (patch) | |
tree | ca0e49c7e5f274613562b2b5999e1ea6f8a426ba | |
parent | cb6d00206bcfcd5eeb21716b72432b30be78f261 (diff) | |
parent | df6116d9a47fbe8aebcb9d8fdaedb72100c54e44 (diff) |
Merge branch 'SLE15' into SLE12-SP4rpm-4.12.14-95.32--sle12-sp4-updatesrpm-4.12.14-95.32
5 files changed, 271 insertions, 0 deletions
diff --git a/patches.suse/bonding-802.3ad-fix-link_failure_count-tracking.patch b/patches.suse/bonding-802.3ad-fix-link_failure_count-tracking.patch new file mode 100644 index 0000000000..533e2b25e5 --- /dev/null +++ b/patches.suse/bonding-802.3ad-fix-link_failure_count-tracking.patch @@ -0,0 +1,51 @@ +From: Jarod Wilson <jarod@redhat.com> +Subject: bonding/802.3ad: fix link_failure_count tracking +Patch-mainline: v4.20-rc2 +Git-commit: ea53abfab960909d622ca37bcfb8e1c5378d21cc +References: bsc#1137069 bsc#1141013 + +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> +Reviewed-by: Jiri Wiesner <jwiesner@suse.com> +Acked-by: Michal Kubecek <mkubecek@suse.cz> + +--- + drivers/net/bonding/bond_main.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/drivers/net/bonding/bond_main.c ++++ b/drivers/net/bonding/bond_main.c +@@ -3088,13 +3088,13 @@ static int bond_slave_netdev_event(unsigned long event, + case NETDEV_CHANGE: + /* For 802.3ad mode only: + * Getting invalid Speed/Duplex values here will put slave +- * in weird state. So mark it as link-down for the time ++ * 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. + */ + if (bond_update_speed_duplex(slave) && + BOND_MODE(bond) == BOND_MODE_8023AD) +- slave->link = BOND_LINK_DOWN; ++ slave->link = BOND_LINK_FAIL; + + if (BOND_MODE(bond) == BOND_MODE_8023AD) + bond_3ad_adapter_speed_duplex_changed(slave); 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, + case NETDEV_CHANGE: + /* 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/patches.suse/bonding-set-default-miimon-value-for-non-arp-modes-i.patch b/patches.suse/bonding-set-default-miimon-value-for-non-arp-modes-i.patch new file mode 100644 index 0000000000..bbe5891c97 --- /dev/null +++ b/patches.suse/bonding-set-default-miimon-value-for-non-arp-modes-i.patch @@ -0,0 +1,102 @@ +From: Jarod Wilson <jarod@redhat.com> +Subject: bonding: set default miimon value for non-arp modes if not set +Patch-mainline: v4.18-rc7 +Git-commit: c1f897ce186a529a494441642125479d38727a3d +References: bsc#1137069 bsc#1141013 + +For some time now, if you load the bonding driver and configure bond +parameters via sysfs using minimal config options, such as specifying +nothing but the mode, relying on defaults for everything else, modes +that cannot use arp monitoring (802.3ad, balance-tlb, balance-alb) all +wind up with both arp_interval=0 (as it should be) and miimon=0, which +means the miimon monitor thread never actually runs. This is particularly +problematic for 802.3ad. + +For example, from an LNST recipe I've set up: + +$ modprobe bonding max_bonds=0" +$ echo "+t_bond0" > /sys/class/net/bonding_masters" +$ ip link set t_bond0 down" +$ echo "802.3ad" > /sys/class/net/t_bond0/bonding/mode" +$ ip link set ens1f1 down" +$ echo "+ens1f1" > /sys/class/net/t_bond0/bonding/slaves" +$ ip link set ens1f0 down" +$ echo "+ens1f0" > /sys/class/net/t_bond0/bonding/slaves" +$ ethtool -i t_bond0" +$ ip link set ens1f1 up" +$ ip link set ens1f0 up" +$ ip link set t_bond0 up" +$ ip addr add 192.168.9.1/24 dev t_bond0" +$ ip addr add 2002::1/64 dev t_bond0" + +This bond comes up okay, but things look slightly suspect in +/proc/net/bonding/t_bond0 output: + +$ grep -i mii /proc/net/bonding/t_bond0 +MII Status: up +MII Polling Interval (ms): 0 +MII Status: up +MII Status: up + +Now, pull a cable on one of the ports in the bond, then reconnect it, and +you'll see: + +Slave Interface: ens1f0 +MII Status: down +Speed: 1000 Mbps +Duplex: full + +I believe this became a major issue as of commit 4d2c0cda0744, which for +802.3ad bonds, sets slave->link = BOND_LINK_DOWN, with a comment about +relying on link monitoring via miimon to set it correctly, but since the +miimon work queue never runs, the link just stays marked down. + +If we simply tweak bond_option_mode_set() slightly, we can check for the +non-arp modes having no miimon value set, and insert BOND_DEFAULT_MIIMON, +which gets things back in full working order. This problem exists as far +back as 4.14, and might be worth fixing in all stable trees since, though +the work-around is to simply specify an miimon value yourself. + +Reported-by: Bob Ball <ball@umich.edu> +Signed-off-by: Jarod Wilson <jarod@redhat.com> +Acked-by: Mahesh Bandewar <maheshb@google.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_options.c | 23 ++++++++++++++--------- + 1 file changed, 14 insertions(+), 9 deletions(-) + +--- a/drivers/net/bonding/bond_options.c ++++ b/drivers/net/bonding/bond_options.c +@@ -720,15 +720,20 @@ const struct bond_option *bond_opt_get(unsigned int option) + static int bond_option_mode_set(struct bonding *bond, + const struct bond_opt_value *newval) + { +- if (!bond_mode_uses_arp(newval->value) && bond->params.arp_interval) { +- netdev_info(bond->dev, "%s mode is incompatible with arp monitoring, start mii monitoring\n", +- newval->string); +- /* disable arp monitoring */ +- bond->params.arp_interval = 0; +- /* set miimon to default value */ +- bond->params.miimon = BOND_DEFAULT_MIIMON; +- netdev_info(bond->dev, "Setting MII monitoring interval to %d\n", +- bond->params.miimon); ++ if (!bond_mode_uses_arp(newval->value)) { ++ if (bond->params.arp_interval) { ++ netdev_dbg(bond->dev, "%s mode is incompatible with arp monitoring, start mii monitoring\n", ++ newval->string); ++ /* disable arp monitoring */ ++ bond->params.arp_interval = 0; ++ } ++ ++ if (!bond->params.miimon) { ++ /* set miimon to default value */ ++ bond->params.miimon = BOND_DEFAULT_MIIMON; ++ netdev_dbg(bond->dev, "Setting MII monitoring interval to %d\n", ++ bond->params.miimon); ++ } + } + + if (newval->value == BOND_MODE_ALB) diff --git a/patches.suse/bonding-speed-duplex-update-at-NETDEV_UP-event.patch b/patches.suse/bonding-speed-duplex-update-at-NETDEV_UP-event.patch new file mode 100644 index 0000000000..b1bc2056f0 --- /dev/null +++ b/patches.suse/bonding-speed-duplex-update-at-NETDEV_UP-event.patch @@ -0,0 +1,48 @@ +From: Mahesh Bandewar <maheshb@google.com> +Subject: bonding: speed/duplex update at NETDEV_UP event +Patch-mainline: v4.15-rc1 +Git-commit: 4d2c0cda07448ea6980f00102dc3964eb25e241c +References: bsc#1137069 bsc#1141013 + +Some NIC drivers don't have correct speed/duplex settings at the +time they send NETDEV_UP notification and that messes up the +bonding state. Especially 802.3ad mode which is very sensitive +to these settings. In the current implementation we invoke +bond_update_speed_duplex() when we receive NETDEV_UP, however, +ignore the return value. If the values we get are invalid +(UNKNOWN), then slave gets removed from the aggregator with +speed and duplex set to UNKNOWN while link is still marked as UP. + +This patch fixes this scenario. Also 802.3ad mode is sensitive to +these conditions while other modes are not, so making sure that it +doesn't change the behavior for other modes. + +Signed-off-by: Mahesh Bandewar <maheshb@google.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 | 11 ++++++++++- + 1 file changed, 10 insertions(+), 1 deletion(-) + +--- a/drivers/net/bonding/bond_main.c ++++ b/drivers/net/bonding/bond_main.c +@@ -3086,7 +3086,16 @@ static int bond_slave_netdev_event(unsigned long event, + break; + case NETDEV_UP: + case NETDEV_CHANGE: +- bond_update_speed_duplex(slave); ++ /* For 802.3ad mode only: ++ * Getting invalid Speed/Duplex values here will put slave ++ * in weird state. So mark it as link-down for the time ++ * being 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_DOWN; ++ + if (BOND_MODE(bond) == BOND_MODE_8023AD) + bond_3ad_adapter_speed_duplex_changed(slave); + /* Fallthrough */ diff --git a/series.conf b/series.conf index a44d2cc1ce..b49dc54754 100644 --- a/series.conf +++ b/series.conf @@ -8986,6 +8986,7 @@ patches.suse/i40e-fix-client-notify-of-VF-reset.patch patches.suse/i40e-Stop-dropping-802.1ad-tags-eth-proto-0x88a8.patch patches.suse/cxgb4-Update-comment-for-min_mtu.patch + patches.suse/bonding-speed-duplex-update-at-NETDEV_UP-event.patch patches.suse/fm10k-prepare_for_reset-when-we-lose-PCIe-Link.patch patches.suse/fm10k-use-spinlock-to-implement-mailbox-lock.patch patches.suse/fm10k-use-generic-PM-hooks-instead-of-legacy-PCIe-po.patch @@ -18370,6 +18371,7 @@ patches.suse/net-mlx5-Adjust-clock-overflow-work-period.patch patches.suse/net-mlx5e-Fix-quota-counting-in-aRFS-expire-flow.patch patches.suse/net-mlx5e-Don-t-allow-aRFS-for-encapsulated-packets.patch + patches.suse/bonding-set-default-miimon-value-for-non-arp-modes-i.patch patches.suse/qed-Fix-link-flap-issue-due-to-mismatching-EEE-capab.patch patches.suse/qed-Fix-possible-race-for-the-link-state-value.patch patches.suse/qed-Correct-Multicast-API-to-reflect-existence-of-25.patch @@ -20754,6 +20756,7 @@ patches.suse/net-hns3-Fix-for-out-of-bounds-access-when-setting-p.patch patches.suse/mlxsw-spectrum-Fix-IP2ME-CPU-policer-configuration.patch patches.suse/sctp-fix-strchange_flags-name-for-Stream-Change-Even.patch + patches.suse/bonding-802.3ad-fix-link_failure_count-tracking.patch patches.suse/netfilter-conntrack-fix-calculation-of-next-bucket-n.patch patches.suse/HID-hiddev-fix-potential-Spectre-v1.patch patches.suse/hwmon-core-Fix-double-free-in-__hwmon_device_registe.patch @@ -23698,6 +23701,7 @@ patches.suse/ipv4-igmp-fix-another-memory-leak-in-igmpv3_del_delr.patch patches.suse/ipv4-igmp-fix-build-error-if-CONFIG_IP_MULTICAST.patch patches.suse/net-fec-fix-the-clk-mismatch-in-failed_reset-path.patch + patches.suse/bonding-802.3ad-fix-slave-link-initialization-transi.patch patches.suse/net-mvneta-Fix-err-code-path-of-probe.patch patches.suse/llc-fix-skb-leak-in-llc_build_and_send_ui_pkt.patch patches.suse/net-mlx5-Avoid-double-free-in-fs-init-error-unwindin.patch |