From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id E03D5425DF for ; Mon, 18 Sep 2023 20:23:37 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A834B4027E; Mon, 18 Sep 2023 20:23:37 +0200 (CEST) Received: from frogstar.hit.bme.hu (frogstar.hit.bme.hu [152.66.248.44]) by mails.dpdk.org (Postfix) with ESMTP id 34E494025D for ; Mon, 18 Sep 2023 20:23:36 +0200 (CEST) Received: from [192.168.0.104] (host-79-121-41-203.kabelnet.hu [79.121.41.203]) (authenticated bits=0) by frogstar.hit.bme.hu (8.17.1/8.17.1) with ESMTPSA id 38IINT6S076382 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NO); Mon, 18 Sep 2023 20:23:35 +0200 (CEST) (envelope-from lencse@hit.bme.hu) X-Authentication-Warning: frogstar.hit.bme.hu: Host host-79-121-41-203.kabelnet.hu [79.121.41.203] claimed to be [192.168.0.104] Message-ID: <9d41e20b-f0b9-eba0-484c-8bafc96c5ca9@hit.bme.hu> Date: Mon, 18 Sep 2023 20:23:25 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 Subject: Re: rte_exit() does not terminate the program -- is it a bug or a new feature? Content-Language: en-US To: Stephen Hemminger Cc: users@dpdk.org References: <3ef90e53-c28b-09e8-e3f3-2b78727114ff@hit.bme.hu> <20230915080608.724f0102@hermes.local> <35b55d11-bb67-2363-6f0a-0fb9667ebe6d@hit.bme.hu> <20230915143305.0ac313c6@hermes.local> <930f2885-caec-7297-65f7-0959dd6d550c@hit.bme.hu> <20230917142753.596c988a@hermes.local> From: Gabor LENCSE In-Reply-To: <20230917142753.596c988a@hermes.local> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Scanned: clamav-milter 0.103.8 at frogstar.hit.bme.hu X-Virus-Status: Clean Received-SPF: pass (frogstar.hit.bme.hu: authenticated connection) receiver=frogstar.hit.bme.hu; client-ip=79.121.41.203; helo=[192.168.0.104]; envelope-from=lencse@hit.bme.hu; x-software=spfmilter 2.001 http://www.acme.com/software/spfmilter/ with libspf2-1.2.11; X-DCC--Metrics: frogstar.hit.bme.hu; whitelist X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED, AWL, NICE_REPLY_A, T_SCC_BODY_TEXT_LINE autolearn=disabled version=3.4.6-frogstar X-Spam-Checker-Version: SpamAssassin 3.4.6-frogstar (2021-04-09) on frogstar.hit.bme.hu X-Scanned-By: MIMEDefang 2.86 on 152.66.248.44 X-BeenThere: users@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK usage discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: users-bounces@dpdk.org Dear Stephen, Thank you very much for your reply. Please see my answers inline. On 9/17/2023 11:27 PM, Stephen Hemminger wrote: > On Sun, 17 Sep 2023 21:37:30 +0200 > Gabor LENCSE wrote: > >> However, l2fwd also uses the "rte_exit()" function to terminate the >> program. The only difference is that it calls the "rte_exit()" function >> from the main program, and I do so in a thread started by the >> "rte_eal_remote_launch()" function. > Calling rte_exit in a thread other than main thread won't work because > the cleanup code is calling rte_eal_cleanup, and inside that it ends > up waiting for all workers. Since the thread you are calling from > is a worker, it ends up waiting for itself. > > rte_exit() > rte_eal_cleanup() > rte_service_finalize() > rte_eal_mp_wait_lcore() > > > void > rte_eal_mp_wait_lcore(void) > { > unsigned lcore_id; > > RTE_LCORE_FOREACH_WORKER(lcore_id) { > rte_eal_wait_lcore(lcore_id); > } > } Thank you very much for the detailed explanation! I have modified the send function of siitperf (just at one point as a quick hack) and also the bash shell script. Now it works well and produces meaningful self-test results without any problem with program termination. So, the issue is solved. :-) Of course, I will review all my rte_exit calls... It'll take a while... I am just curious, as I have no idea, why my old code worked all right with DPDK 16.11. Has rte_exit() been changed since then? (But, please do not spend too much time with this question!) > Either service handling needs to be smarter, the rte_exit() function > check if it is called from main lcore, and/or documentation needs update. > Not a simple fix because in order to safely do the cleanup logic > all threads have to gone to a quiescent state. Yes I think it definitely SHOULD be mentioned in DPDK documentation that the rte_exit() function may be called only from the main lcore. Now I have learnt it for all my life, but it will be useful for a lot of DPDK users. :-) Once again, thank you very much for your help! Best regards, Gábor p.s.: I have another, even worse problem with siitperf running with the new versions of DPDK. I will report it with a different subject line. >