From: Harry van Haaren Date: Wed, 27 Nov 2019 13:20:27 +0000 (+0000) Subject: test/service: fix wait for service core X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=505a2b0c64a7f1e087f5a8aaa6940da78c11c81b;p=dpdk.git test/service: fix wait for service core This commit fixes a sporadic failure of the service_autotest unit test, as seen in the DPDK CI. The failure occurs as the main test thread did not wait on the service-thread to return, and allowing it to read a flag before the service was able to write to it. The fix changes the wait API call to specific the service-core ID, and this waits for cores with both ROLE_RTE and ROLE_SERVICE. The rte_eal_mp_wait_lcore() call does not (and should not) wait for service cores, so must not be used to wait on service-cores. Fixes: f038a81e1c56 ("service: add unit tests") Cc: stable@dpdk.org Reported-by: Aaron Conole Signed-off-by: Harry van Haaren Acked-by: David Marchand --- diff --git a/app/test/test_service_cores.c b/app/test/test_service_cores.c index 9fe38f5e08..a922c7ddcc 100644 --- a/app/test/test_service_cores.c +++ b/app/test/test_service_cores.c @@ -483,7 +483,7 @@ service_lcore_en_dis_able(void) int ret = rte_eal_remote_launch(service_remote_launch_func, NULL, slcore_id); TEST_ASSERT_EQUAL(0, ret, "Ex-service core remote launch failed."); - rte_eal_mp_wait_lcore(); + rte_eal_wait_lcore(slcore_id); TEST_ASSERT_EQUAL(1, service_remote_launch_flag, "Ex-service core function call had no effect.");