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 5EE10A04E0; Wed, 27 Nov 2019 15:10:33 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B904D2B8E; Wed, 27 Nov 2019 15:10:32 +0100 (CET) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by dpdk.org (Postfix) with ESMTP id DD0B428EE for ; Wed, 27 Nov 2019 15:10:31 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1574863831; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=vn1a/OKLcYD/CIxz+0AIsOtcAACkup5iIU5qgFA2Jkg=; b=L/jQ+JErWG8ORwmjySG7FMj2IjttipDOdmvYalKNdIkzNy3j+IVVD81DNIOy6hCGaHNHEE 3oDGPXNjNPn2mW2A0u0NpKrlJITsbQPXIqxWsRrd2j4ZxCHnN+06jtxP0m6zmYkzLomvFv ucLTe2psTob2PvWFiy3bM8PTLZZHRYg= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-206-e0oL7WbyO_umPTY6cKj4OQ-1; Wed, 27 Nov 2019 09:10:28 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2946318B9FB7; Wed, 27 Nov 2019 14:10:27 +0000 (UTC) Received: from dhcp-25.97.bos.redhat.com (ovpn-124-43.rdu2.redhat.com [10.10.124.43]) by smtp.corp.redhat.com (Postfix) with ESMTPS id BE88460BEC; Wed, 27 Nov 2019 14:10:26 +0000 (UTC) From: Aaron Conole To: Harry van Haaren Cc: dev@dpdk.org References: <20191127132027.80239-1-harry.van.haaren@intel.com> Date: Wed, 27 Nov 2019 09:10:25 -0500 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") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-MC-Unique: e0oL7WbyO_umPTY6cKj4OQ-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Subject: Re: [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" Harry van Haaren 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 > Signed-off-by: Harry van Haaren > > --- 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) > =09int ret =3D rte_eal_remote_launch(service_remote_launch_func, NULL, > =09=09=09=09=09slcore_id); > =09TEST_ASSERT_EQUAL(0, ret, "Ex-service core remote launch failed."); > -=09rte_eal_mp_wait_lcore(); > +=09rte_eal_wait_lcore(slcore_id); > =09TEST_ASSERT_EQUAL(1, service_remote_launch_flag, > =09=09=09"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) =20 =09/* flag done, then wait for the spawned 2nd core to return */ =09params[0] =3D 1; -=09rte_eal_mp_wait_lcore(); +=09rte_eal_wait_lcore(app_core2); =20 =09/* core two gets launched first - and should hold the service lock */ =09TEST_ASSERT_EQUAL(0, app_core2_ret,