From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id C7B5FA00E6 for ; Wed, 7 Aug 2019 16:58:49 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id D12312BA8; Wed, 7 Aug 2019 16:58:48 +0200 (CEST) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id 9D0F12B9C for ; Wed, 7 Aug 2019 16:58:46 +0200 (CEST) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E0FF958; Wed, 7 Aug 2019 14:58:45 +0000 (UTC) Received: from dhcp-25.97.bos.redhat.com (unknown [10.18.25.67]) by smtp.corp.redhat.com (Postfix) with ESMTP id 54F2D5C21A; Wed, 7 Aug 2019 14:58:45 +0000 (UTC) From: Aaron Conole To: dev@dpdk.org Cc: Phil Yang , Gavin Hu , Honnappa Nagarahalli Date: Wed, 7 Aug 2019 10:58:44 -0400 Message-Id: <20190807145844.23670-1-aconole@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Wed, 07 Aug 2019 14:58:45 +0000 (UTC) Subject: [dpdk-dev] [PATCH] test/mcslock: wait for lcore completion X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 Cc: Gavin Hu Cc: Honnappa Nagarahalli Signed-off-by: Aaron Conole --- 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