patch 'net/bonding: fix stopping non-active slaves' has been queued to stable release 20.11.6

Xueming Li xuemingl at nvidia.com
Tue Jun 21 10:01:41 CEST 2022


Hi,

FYI, your patch has been queued to stable release 20.11.6

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 06/23/22. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://github.com/steevenlee/dpdk

This queued commit can be viewed at:
https://github.com/steevenlee/dpdk/commit/5f9aca077fd48ec3b24327b594ba8411be8b7496

Thanks.

Xueming Li <xuemingl at nvidia.com>

---
>From 5f9aca077fd48ec3b24327b594ba8411be8b7496 Mon Sep 17 00:00:00 2001
From: Huisong Li <lihuisong at huawei.com>
Date: Tue, 3 May 2022 18:02:13 +0800
Subject: [PATCH] net/bonding: fix stopping non-active slaves
Cc: Xueming Li <xuemingl at nvidia.com>

[ upstream commit f5e72e8e8d57b331baf1a86d15eb7fae921f57fb ]

When stopping a bonded port, all slaves should be stopped. But only
active slaves are stopped.
So fix by stopping all slave ports and later do "deactivate_slave()" for
active slaves.

Fixes: 0911d4ec0183 ("net/bonding: fix crash when stopping mode 4 port")

Signed-off-by: Huisong Li <lihuisong at huawei.com>
Signed-off-by: Min Hu (Connor) <humin29 at huawei.com>
---
 drivers/net/bonding/rte_eth_bond_pmd.c | 20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)

diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c
index 5fc759d3e8..bda69c9e4f 100644
--- a/drivers/net/bonding/rte_eth_bond_pmd.c
+++ b/drivers/net/bonding/rte_eth_bond_pmd.c
@@ -2100,18 +2100,20 @@ bond_ethdev_stop(struct rte_eth_dev *eth_dev)
 	internals->link_status_polling_enabled = 0;
 	for (i = 0; i < internals->slave_count; i++) {
 		uint16_t slave_id = internals->slaves[i].port_id;
+
+		internals->slaves[i].last_link_status = 0;
+		ret = rte_eth_dev_stop(slave_id);
+		if (ret != 0) {
+			RTE_BOND_LOG(ERR, "Failed to stop device on port %u",
+				     slave_id);
+			return ret;
+		}
+
+		/* active slaves need to be deactivated. */
 		if (find_slave_by_id(internals->active_slaves,
 				internals->active_slave_count, slave_id) !=
-						internals->active_slave_count) {
-			internals->slaves[i].last_link_status = 0;
-			ret = rte_eth_dev_stop(slave_id);
-			if (ret != 0) {
-				RTE_BOND_LOG(ERR, "Failed to stop device on port %u",
-					     slave_id);
-				return ret;
-			}
+					internals->active_slave_count)
 			deactivate_slave(eth_dev, slave_id);
-		}
 	}
 
 	return 0;
-- 
2.35.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-06-21 15:37:50.909532202 +0800
+++ 0035-net-bonding-fix-stopping-non-active-slaves.patch	2022-06-21 15:37:49.014451169 +0800
@@ -1 +1 @@
-From f5e72e8e8d57b331baf1a86d15eb7fae921f57fb Mon Sep 17 00:00:00 2001
+From 5f9aca077fd48ec3b24327b594ba8411be8b7496 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit f5e72e8e8d57b331baf1a86d15eb7fae921f57fb ]
@@ -12 +14,0 @@
-Cc: stable at dpdk.org
@@ -21 +23 @@
-index 5cbe89031b..605fc2ffb5 100644
+index 5fc759d3e8..bda69c9e4f 100644
@@ -24 +26 @@
-@@ -2118,18 +2118,20 @@ bond_ethdev_stop(struct rte_eth_dev *eth_dev)
+@@ -2100,18 +2100,20 @@ bond_ethdev_stop(struct rte_eth_dev *eth_dev)


More information about the stable mailing list