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

christian.ehrhardt at canonical.com christian.ehrhardt at canonical.com
Thu Jul 7 09:55:21 CEST 2022


Hi,

FYI, your patch has been queued to stable release 19.11.13

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/09/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/cpaelzer/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/cpaelzer/dpdk-stable-queue/commit/3d3bcdcee414581a2eb959c14157f82684973295

Thanks.

Christian Ehrhardt <christian.ehrhardt at canonical.com>

---
>From 3d3bcdcee414581a2eb959c14157f82684973295 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/librte_eal/common/rte_service.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/lib/librte_eal/common/rte_service.c b/lib/librte_eal/common/rte_service.c
index 8fcccac85c..d11027fcba 100644
--- a/lib/librte_eal/common/rte_service.c
+++ b/lib/librte_eal/common/rte_service.c
@@ -708,13 +708,20 @@ 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);
 		int32_t only_core = (1 ==
 			rte_atomic32_read(&rte_services[i].num_mapped_cores));
 
+		/* 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.37.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-07-07 09:54:14.662698591 +0200
+++ 0086-service-fix-lingering-active-status.patch	2022-07-07 09:54:11.029825012 +0200
@@ -1 +1 @@
-From 6550113be62d1bd27b2f2dc07d7a888ad9499006 Mon Sep 17 00:00:00 2001
+From 3d3bcdcee414581a2eb959c14157f82684973295 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 6550113be62d1bd27b2f2dc07d7a888ad9499006 ]
+
@@ -21 +23 @@
- lib/eal/common/rte_service.c | 9 ++++++++-
+ lib/librte_eal/common/rte_service.c | 9 ++++++++-
@@ -24,5 +26,5 @@
-diff --git a/lib/eal/common/rte_service.c b/lib/eal/common/rte_service.c
-index ef31b1f63c..d2b7275ac0 100644
---- a/lib/eal/common/rte_service.c
-+++ b/lib/eal/common/rte_service.c
-@@ -758,7 +758,9 @@ rte_service_lcore_stop(uint32_t lcore)
+diff --git a/lib/librte_eal/common/rte_service.c b/lib/librte_eal/common/rte_service.c
+index 8fcccac85c..d11027fcba 100644
+--- a/lib/librte_eal/common/rte_service.c
++++ b/lib/librte_eal/common/rte_service.c
+@@ -708,13 +708,20 @@ rte_service_lcore_stop(uint32_t lcore)
@@ -39,3 +41,2 @@
-@@ -766,6 +768,11 @@ rte_service_lcore_stop(uint32_t lcore)
- 			__atomic_load_n(&rte_services[i].num_mapped_cores,
- 				__ATOMIC_RELAXED));
+ 		int32_t only_core = (1 ==
+ 			rte_atomic32_read(&rte_services[i].num_mapped_cores));


More information about the stable mailing list