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 D40C6A0093; Mon, 18 May 2020 20:25:40 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E6E6B1D558; Mon, 18 May 2020 20:25:38 +0200 (CEST) Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) by dpdk.org (Postfix) with ESMTP id 1DE1C1D54D for ; Mon, 18 May 2020 20:25:36 +0200 (CEST) Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20200518182535euoutp0277ad0711703e2590a8c3e2a0688e5f90~QMqEVMzDa1057410574euoutp02N for ; Mon, 18 May 2020 18:25:35 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20200518182535euoutp0277ad0711703e2590a8c3e2a0688e5f90~QMqEVMzDa1057410574euoutp02N DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1589826335; bh=fsSmcmcgRMNxYNURhZ9lMxLdZ5qvjSg8xbgyFnJO09Y=; h=Subject:To:Cc:From:Date:In-Reply-To:References:From; b=rYxvjRIiXvugy0WmpluKs2zQ1tltJLVo8UQ0Aom3/OS/7sbHJrNSWuPy8hJp2tm+1 L5pjwWQjJIMrf5i7N44e9ao3F7WXIGcUWL3eOaQvrUDemsRCHBffQypMAk6RkhU4hn W/tn3x5gSHiU3pIzKu0gXrFQMY/retjP0C2++YDI= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20200518182535eucas1p2ce515e0c1c49b00d1439ddf6dd5599c5~QMqDs7Pfk2310423104eucas1p2I; Mon, 18 May 2020 18:25:35 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id A2.78.61286.F13D2CE5; Mon, 18 May 2020 19:25:35 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20200518182534eucas1p2098d62710d0818bdd28666a48402b73b~QMqDMW4GI0645906459eucas1p2n; Mon, 18 May 2020 18:25:34 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20200518182534eusmtrp114c17eae20fb61a7a1c5f67d808cd566~QMqDLzdn-1056110561eusmtrp1Z; Mon, 18 May 2020 18:25:34 +0000 (GMT) X-AuditID: cbfec7f2-f0bff7000001ef66-b7-5ec2d31fa934 Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 8F.EE.08375.E13D2CE5; Mon, 18 May 2020 19:25:34 +0100 (BST) Received: from [106.210.88.70] (unknown [106.210.88.70]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20200518182534eusmtip2f07aa03bae4da8834c1fd1a26ff29737~QMqCsYRzt0958409584eusmtip27; Mon, 18 May 2020 18:25:34 +0000 (GMT) To: david.marchand@redhat.com Cc: Harry van Haaren , Jerin Jacob , dev@dpdk.org, stable@dpdk.org From: Lukasz Wojciechowski Message-ID: <1303e35b-7573-28d8-8425-538058c90ad5@partner.samsung.com> Date: Mon, 18 May 2020 20:25:33 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 MIME-Version: 1.0 In-Reply-To: <20200428012139.32196-1-l.wojciechow@partner.samsung.com> Content-Transfer-Encoding: 8bit Content-Language: en-US X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprNKsWRmVeSWpSXmKPExsWy7djPc7rylw/FGWxczWWxfUUXm8W7T9uZ LBr7v7FYTJxkYvGv4w+7A6vHhhP9rB6/Fixl9Vi85yWTx/t9V9kC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k4hASWMoo0T//LHsXIwdQQkbiwyUBiBphiT/Xutggal4zSjw6NZsR pEZYQFdi14JqkBoRAVmJl6efMoLUMAs0MEp8WdPNDJIQEpjJKHHlGiOIzSZgK3Fk5ldWEJtX wE3ixas/LCA2i4CqxInOo+wgtqhArMTqa62MEDWCEidnPgGr4QSq/91zBayGWcBMYt7mh8wQ trxE89bZULa4xK0n85kmMArNQtI+C0nLLCQts5C0LGBkWcUoklpanJueW2yoV5yYW1yal66X nJ+7iREYVduO/dy8g/HSxuBDjAIcjEo8vAn5h+KEWBPLiitzDzFKcDArifBGft4XJ8SbklhZ lVqUH19UmpNafIjRFOi5icxSosn5wIjPK4k3NDU0t7A0NDc2NzazUBLn7RA4GCMkkJ5Ykpqd mlqQWgTTx8TBKdXAKLXMI6Z/y7uY6lOe0U2Mqq2cK+Vf7H5zbm5TsrzyzcAP/9a57Zp1NKt6 isDBhfr2E26/vnB1zUnVYCuPlve6UcXfOT89OhtXLHXdMu30hD0eV30LLfewsGh2PMoPsvry br1Sbes9+Ykhmqs79q8y/dnEtpS5LeqxQ/rj/i1tZTNOL7n94PNcKSWW4oxEQy3mouJEAIWA fHHAAgAA X-CMS-MailID: 20200518182534eucas1p2098d62710d0818bdd28666a48402b73b X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20200428012204eucas1p120a84e501d0d64145c21476cd2562f36 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200428012204eucas1p120a84e501d0d64145c21476cd2562f36 References: <20200428012139.32196-1-l.wojciechow@partner.samsung.com> Subject: Re: [dpdk-dev] [PATCH] eal: fix lcore state bug 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" Hi David, The patch is here for quite a while and I believe it's assign to you. Today there were some questions about it on https://bugs.dpdk.org/show_bug.cgi?id=464 Is there anything else to be done, so it can be accepted? Best regards Lukasz W dniu 28.04.2020 o 03:21, Lukasz Wojciechowski pisze: > The rte_service_lcore_reset_all function stops execution of services > on all lcores and switches them back from ROLE_SERVICE to ROLE_RTE. > However the thread loop for slave lcores (eal_thread_loop) distincts these > roles to set lcore state after processing delegated function. > It sets WAIT state for ROLE_SERVICE, but FINISHED for ROLE_RTE. > So changing the role to RTE before stopping work in slave lcores > causes lcores to end in FINISHED state. That is why the rte_eal_lcore_wait > must be run after rte_service_lcore_reset_all to bring back lcores to > launchable (WAIT) state. > This has been fixed in test app and clarified in API documentation. > > Setting the state to WAIT in rte_service_runner_func is premature > as the rte_service_runner_func function is still a part of the lcore > function delegated to slave lcore. The state is overwritten anyway in > slave lcore thread loop. This premature setting state to WAIT might > however cause rte_eal_lcore_wait, that was called by the application, > to return before slave lcore thread set the FINISHED state. That's > why it is removed from librte_eal rte_service_runner_func function. > > Bugzilla ID: 464 > Fixes: 21698354c832 ("service: introduce service cores concept") > Fixes: f038a81e1c56 ("service: add unit tests") > Cc: harry.van.haaren@intel.com > Cc: stable@dpdk.org > > Signed-off-by: Lukasz Wojciechowski > --- > app/test/test_service_cores.c | 1 + > lib/librte_eal/common/rte_service.c | 2 -- > lib/librte_eal/include/rte_service.h | 4 ++++ > 3 files changed, 5 insertions(+), 2 deletions(-) > > diff --git a/app/test/test_service_cores.c b/app/test/test_service_cores.c > index a922c7ddc..2a4978e29 100644 > --- a/app/test/test_service_cores.c > +++ b/app/test/test_service_cores.c > @@ -114,6 +114,7 @@ unregister_all(void) > } > > rte_service_lcore_reset_all(); > + rte_eal_mp_wait_lcore(); > > return TEST_SUCCESS; > } > diff --git a/lib/librte_eal/common/rte_service.c b/lib/librte_eal/common/rte_service.c > index 70d17a5d7..018876199 100644 > --- a/lib/librte_eal/common/rte_service.c > +++ b/lib/librte_eal/common/rte_service.c > @@ -458,8 +458,6 @@ rte_service_runner_func(void *arg) > rte_smp_rmb(); > } > > - lcore_config[lcore].state = WAIT; > - > return 0; > } > > diff --git a/lib/librte_eal/include/rte_service.h b/lib/librte_eal/include/rte_service.h > index d8701dd4c..acdda8c54 100644 > --- a/lib/librte_eal/include/rte_service.h > +++ b/lib/librte_eal/include/rte_service.h > @@ -300,6 +300,10 @@ int32_t rte_service_lcore_count(void); > * from duty, just unmaps all services / cores, and stops() the service cores. > * The runstate of services is not modified. > * > + * The cores that are stopped with this call, are in FINISHED state and > + * the application must take care of bringing them back to a launchable state: > + * e.g. call *rte_eal_lcore_wait* on the lcore_id. > + * > * @retval 0 Success > */ > int32_t rte_service_lcore_reset_all(void); -- Lukasz Wojciechowski Principal Software Engineer Samsung R&D Institute Poland Samsung Electronics Office +48 22 377 88 25 l.wojciechow@partner.samsung.com