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 E261EA04E0; Wed, 27 Nov 2019 14:20:37 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id C102658C3; Wed, 27 Nov 2019 14:20:36 +0100 (CET) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id 6EAC1235 for ; Wed, 27 Nov 2019 14:20:35 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Nov 2019 05:20:34 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,249,1571727600"; d="scan'208";a="292062202" Received: from silpixa00399779.ir.intel.com (HELO silpixa00399779.ger.corp.intel.com) ([10.237.222.209]) by orsmga001.jf.intel.com with ESMTP; 27 Nov 2019 05:20:33 -0800 From: Harry van Haaren To: dev@dpdk.org Cc: aconole@redhat.com, Harry van Haaren Date: Wed, 27 Nov 2019 13:20:27 +0000 Message-Id: <20191127132027.80239-1-harry.van.haaren@intel.com> X-Mailer: git-send-email 2.17.1 Subject: [dpdk-dev] [PATCH] test/service: fix wait for service core 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" 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 Signed-off-by: Harry van Haaren --- 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, 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."); -- 2.17.1