service: fix lcore iteration
authorIgor Romanov <igor.romanov@oktetlabs.ru>
Tue, 7 Jul 2020 10:45:24 +0000 (11:45 +0100)
committerThomas Monjalon <thomas@monjalon.net>
Tue, 7 Jul 2020 21:48:44 +0000 (23:48 +0200)
The service core list is populated, but not used. Incorrect
lcore states are examined for a service.

Use the populated list to iterate over service cores.

Fixes: e484ccddbe1b ("service: avoid false sharing on core state")
Cc: stable@dpdk.org
Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
lib/librte_eal/common/rte_service.c

index 6123a21..e2795f8 100644 (file)
@@ -422,7 +422,7 @@ rte_service_may_be_active(uint32_t id)
                return -EINVAL;
 
        for (i = 0; i < lcore_count; i++) {
-               if (lcore_states[i].service_active_on_lcore[id])
+               if (lcore_states[ids[i]].service_active_on_lcore[id])
                        return 1;
        }