DPDK patches and discussions
 help / color / mirror / Atom feed
From: Aaron Conole <aconole@redhat.com>
To: Harry van Haaren <harry.van.haaren@intel.com>
Cc: dev@dpdk.org
Subject: Re: [dpdk-dev] [PATCH] test/service: fix wait for service core
Date: Wed, 27 Nov 2019 09:10:25 -0500	[thread overview]
Message-ID: <f7t7e3l5s1a.fsf@dhcp-25.97.bos.redhat.com> (raw)
In-Reply-To: <20191127132027.80239-1-harry.van.haaren@intel.com> (Harry van Haaren's message of "Wed, 27 Nov 2019 13:20:27 +0000")

Harry van Haaren <harry.van.haaren@intel.com> writes:

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

It might also be good to document this behavior in the API area.  It's
unclear that the lcore wait function which takes a core id will work,
but the broad wait will not.

> 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.

I think it's worth it if the LTS / stable branches use the unit tests
(otherwise, they will observe sporadic failures).

> ---
>  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,
>  					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.");

Should we also have some change like the following (just a guess):

diff --git a/app/test/test_service_cores.c b/app/test/test_service_cores.c
index 9fe38f5e08..695c35ac6c 100644
--- a/app/test/test_service_cores.c
+++ b/app/test/test_service_cores.c
@@ -773,7 +773,7 @@ service_app_lcore_poll_impl(const int mt_safe)
 
 	/* flag done, then wait for the spawned 2nd core to return */
 	params[0] = 1;
-	rte_eal_mp_wait_lcore();
+	rte_eal_wait_lcore(app_core2);
 
 	/* core two gets launched first - and should hold the service lock */
 	TEST_ASSERT_EQUAL(0, app_core2_ret,


  reply	other threads:[~2019-11-27 14:10 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-27 13:20 Harry van Haaren
2019-11-27 14:10 ` Aaron Conole [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f7t7e3l5s1a.fsf@dhcp-25.97.bos.redhat.com \
    --to=aconole@redhat.com \
    --cc=dev@dpdk.org \
    --cc=harry.van.haaren@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).