DPDK patches and discussions
 help / color / Atom feed
* [dpdk-dev] [PATCH] test/service: fix wait for service core
@ 2019-11-27 13:20 Harry van Haaren
  2019-11-27 14:10 ` Aaron Conole
  2019-11-27 21:38 ` [dpdk-dev] " David Marchand
  0 siblings, 2 replies; 7+ messages in thread
From: Harry van Haaren @ 2019-11-27 13:20 UTC (permalink / raw)
  To: dev; +Cc: aconole, Harry van Haaren

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")

Reported-by: Aaron Conole <aconole@redhat.com>
Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>


Given this is a fix in the unit test, and not a functional change
I'm not sure its worth backporting to LTS / stable releases?
I've not added stable on CC yet.
 app/test/test_service_cores.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/app/test/test_service_cores.c b/app/test/test_service_cores.c
index 9fe38f5e0..a922c7ddc 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,
 	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.");

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, back to index

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-27 13:20 [dpdk-dev] [PATCH] test/service: fix wait for service core Harry van Haaren
2019-11-27 14:10 ` Aaron Conole
2019-11-27 14:16   ` Van Haaren, Harry
2019-11-27 18:11     ` [dpdk-dev] [dpdk-stable] " David Marchand
2019-11-27 19:10       ` Aaron Conole
2019-11-27 20:11     ` David Marchand
2019-11-27 21:38 ` [dpdk-dev] " David Marchand

DPDK patches and discussions

Archives are clonable:
	git clone --mirror http://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ http://inbox.dpdk.org/dev \
	public-inbox-index dev

Newsgroup available over NNTP:

AGPL code for this site: git clone https://public-inbox.org/ public-inbox