From: Gabor LENCSE <lencse@hit.bme.hu>
To: Stephen Hemminger <stephen@networkplumber.org>
Cc: users@dpdk.org
Subject: Re: rte_exit() does not terminate the program -- is it a bug or a new feature?
Date: Mon, 18 Sep 2023 20:23:25 +0200 [thread overview]
Message-ID: <9d41e20b-f0b9-eba0-484c-8bafc96c5ca9@hit.bme.hu> (raw)
In-Reply-To: <20230917142753.596c988a@hermes.local>
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 <lencse@hit.bme.hu> 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.
>
next prev parent reply other threads:[~2023-09-18 18:23 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-15 8:24 Gabor LENCSE
2023-09-15 15:06 ` Stephen Hemminger
2023-09-15 18:28 ` Gabor LENCSE
2023-09-15 21:33 ` Stephen Hemminger
2023-09-17 19:37 ` Gabor LENCSE
2023-09-17 21:27 ` Stephen Hemminger
2023-09-18 18:23 ` Gabor LENCSE [this message]
2023-09-18 18:49 ` Stephen Hemminger
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=9d41e20b-f0b9-eba0-484c-8bafc96c5ca9@hit.bme.hu \
--to=lencse@hit.bme.hu \
--cc=stephen@networkplumber.org \
--cc=users@dpdk.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).