[PATCH] service: fix getting service lcore attributes

Piotr Krzewinski piotr.krzewinski at ericsson.com
Fri Dec 20 15:29:38 CET 2024


Perf test service_perf_autotest was failing after introduction
of lcore variables. Fixed getting of idle_ and error_ service
call statistics.

Fixes: b24bbaedbba2 ("service: keep per-lcore state in lcore variable")
Cc: mattias.ronnblom at ericsson.com
Cc: stable at dpdk.org

Signed-off-by: Piotr Krzewinski <piotr.krzewinski at ericsson.com>
---
 lib/eal/common/rte_service.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/eal/common/rte_service.c b/lib/eal/common/rte_service.c
index dad3150df9..1821746337 100644
--- a/lib/eal/common/rte_service.c
+++ b/lib/eal/common/rte_service.c
@@ -879,7 +879,7 @@ lcore_attr_get_service_calls(uint32_t service_id, unsigned int lcore)
 static uint64_t
 lcore_attr_get_service_idle_calls(uint32_t service_id, unsigned int lcore)
 {
-	struct core_state *cs = &lcore_states[lcore];
+	struct core_state *cs =	RTE_LCORE_VAR_LCORE(lcore, lcore_states);
 
 	return rte_atomic_load_explicit(&cs->service_stats[service_id].idle_calls,
 		rte_memory_order_relaxed);
@@ -888,7 +888,7 @@ lcore_attr_get_service_idle_calls(uint32_t service_id, unsigned int lcore)
 static uint64_t
 lcore_attr_get_service_error_calls(uint32_t service_id, unsigned int lcore)
 {
-	struct core_state *cs = &lcore_states[lcore];
+	struct core_state *cs =	RTE_LCORE_VAR_LCORE(lcore, lcore_states);
 
 	return rte_atomic_load_explicit(&cs->service_stats[service_id].error_calls,
 		rte_memory_order_relaxed);
-- 
2.36.0



More information about the stable mailing list