DPDK patches and discussions
 help / color / mirror / Atom feed
From: Aaron Conole <aconole@redhat.com>
To: dev@dpdk.org
Cc: Phil Yang <phil.yang@arm.com>, Gavin Hu <gavin.hu@arm.com>,
	Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Subject: [dpdk-dev] [PATCH] test/mcslock: wait for lcore completion
Date: Wed,  7 Aug 2019 10:58:44 -0400	[thread overview]
Message-ID: <20190807145844.23670-1-aconole@redhat.com> (raw)

It's possible that the mcsunlock occurs before the test_mcslock_try has
a chance to execute, which will result in the trylock being successful,
making the test case fail.  Fix this by waiting until all lcores have
completed their test before unlocking the master lock.

Fixes: 32dcb9fd2a22 ("test/mcslock: add MCS queued lock unit test")
Cc: Phil Yang <phil.yang@arm.com>
Cc: Gavin Hu <gavin.hu@arm.com>
Cc: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Signed-off-by: Aaron Conole <aconole@redhat.com>
---
 app/test/test_mcslock.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/app/test/test_mcslock.c b/app/test/test_mcslock.c
index ed384b81d..e9359df2e 100644
--- a/app/test/test_mcslock.c
+++ b/app/test/test_mcslock.c
@@ -225,8 +225,8 @@ test_mcslock(void)
 	RTE_LCORE_FOREACH_SLAVE(i) {
 		rte_eal_remote_launch(test_mcslock_try, NULL, i);
 	}
-	rte_mcslock_unlock(&p_ml_try, &ml_try_me);
 	rte_eal_mp_wait_lcore();
+	rte_mcslock_unlock(&p_ml_try, &ml_try_me);
 
 	/* Test is_locked API */
 	if (rte_mcslock_is_locked(p_ml)) {
-- 
2.21.0


             reply	other threads:[~2019-08-07 14:58 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-07 14:58 Aaron Conole [this message]
2019-08-08  3:44 ` Phil Yang (Arm Technology China)
2019-08-08 10:22   ` Thomas Monjalon
2019-08-08  6:58 ` 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=20190807145844.23670-1-aconole@redhat.com \
    --to=aconole@redhat.com \
    --cc=dev@dpdk.org \
    --cc=gavin.hu@arm.com \
    --cc=honnappa.nagarahalli@arm.com \
    --cc=phil.yang@arm.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).