patch 'service: fix lingering active status' has been queued to stable release 21.11.2

luca.boccassi at gmail.com luca.boccassi at gmail.com
Wed Jul 6 22:34:56 CEST 2022


Hi,

FYI, your patch has been queued to stable release 21.11.2

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 07/08/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/kevintraynor/dpdk-stable

This queued commit can be viewed at:
https://github.com/kevintraynor/dpdk-stable/commit/e46eb5a8dcd55b0499638c51680b0f8b228d2b2f

Thanks.

Luca Boccassi

---
>From e46eb5a8dcd55b0499638c51680b0f8b228d2b2f Mon Sep 17 00:00:00 2001
From: Harry van Haaren <harry.van.haaren at intel.com>
Date: Tue, 5 Jul 2022 13:32:07 +0000
Subject: [PATCH] service: fix lingering active status

[ upstream commit 6550113be62d1bd27b2f2dc07d7a888ad9499006 ]

This commit fixes an issue where calling rte_service_lcore_stop()
would result in a service's "active on lcore" status becoming stale.

The stale status would result in rte_service_may_be_active() always
returning "1", indicating that the service is not certainly stopped.

This is fixed by ensuring the "active on lcore" status of each service
is set to 0 when an lcore is stopped.

Fixes: e30dd31847d2 ("service: add mechanism for quiescing")
Fixes: 8929de043eb4 ("service: retrieve lcore active state")

Reported-by: Naga Harish K S V <s.v.naga.harish.k at intel.com>
Signed-off-by: Harry van Haaren <harry.van.haaren at intel.com>
---
 lib/eal/common/rte_service.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/lib/eal/common/rte_service.c b/lib/eal/common/rte_service.c
index bd8fb72e78..e76c2baffc 100644
--- a/lib/eal/common/rte_service.c
+++ b/lib/eal/common/rte_service.c
@@ -764,7 +764,9 @@ rte_service_lcore_stop(uint32_t lcore)
 		return -EALREADY;
 
 	uint32_t i;
-	uint64_t service_mask = lcore_states[lcore].service_mask;
+	struct core_state *cs = &lcore_states[lcore];
+	uint64_t service_mask = cs->service_mask;
+
 	for (i = 0; i < RTE_SERVICE_NUM_MAX; i++) {
 		int32_t enabled = service_mask & (UINT64_C(1) << i);
 		int32_t service_running = rte_service_runstate_get(i);
@@ -772,6 +774,11 @@ rte_service_lcore_stop(uint32_t lcore)
 			__atomic_load_n(&rte_services[i].num_mapped_cores,
 				__ATOMIC_RELAXED));
 
+		/* Switch off this core for all services, to ensure that future
+		 * calls to may_be_active() know this core is switched off.
+		 */
+		cs->service_active_on_lcore[i] = 0;
+
 		/* if the core is mapped, and the service is running, and this
 		 * is the only core that is mapped, the service would cease to
 		 * run if this core stopped, so fail instead.
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-07-06 21:07:54.281402516 +0100
+++ 0021-service-fix-lingering-active-status.patch	2022-07-06 21:07:53.555518938 +0100
@@ -1 +1 @@
-From 6550113be62d1bd27b2f2dc07d7a888ad9499006 Mon Sep 17 00:00:00 2001
+From e46eb5a8dcd55b0499638c51680b0f8b228d2b2f Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 6550113be62d1bd27b2f2dc07d7a888ad9499006 ]
+
@@ -25 +27 @@
-index ef31b1f63c..d2b7275ac0 100644
+index bd8fb72e78..e76c2baffc 100644
@@ -28 +30 @@
-@@ -758,7 +758,9 @@ rte_service_lcore_stop(uint32_t lcore)
+@@ -764,7 +764,9 @@ rte_service_lcore_stop(uint32_t lcore)
@@ -39 +41 @@
-@@ -766,6 +768,11 @@ rte_service_lcore_stop(uint32_t lcore)
+@@ -772,6 +774,11 @@ rte_service_lcore_stop(uint32_t lcore)


More information about the stable mailing list