From: Stephen Hemminger <stephen@networkplumber.org>
To: "Nicolson Ken (ニコルソン ケン)" <ken.nicolson@jp.panasonic.com>
Cc: "users@dpdk.org" <users@dpdk.org>
Subject: Re: Detecting if rte_eal_init() has already been called
Date: Tue, 26 Dec 2023 20:56:02 -0800 [thread overview]
Message-ID: <20231226205602.56496841@hermes.local> (raw)
In-Reply-To: <OSZPR01MB774835807CDC015C94EDB655BC9FA@OSZPR01MB7748.jpnprd01.prod.outlook.com>
On Wed, 27 Dec 2023 03:54:12 +0000
Nicolson Ken (ニコルソン ケン) <ken.nicolson@jp.panasonic.com> wrote:
> Hi all,
>
> I'm loading two semi-independent DPDK-ready shared libraries into a master process. If both call rte_eal_init() I get a fatal error about calling it a second time. I tried the rte_eal_primary_proc_alive(NULL) API, but that failed to detect that the other library had already called rte_eal_init().
>
> I feel there should be a simple rte_eal_is_inited()-like API somewhere, but I cannot find it.
>
> Note, I cannot easily change the master process as it is a third-party tool that knows nothing about DPDK. For now I am just relying on the order of loading the libraries and skipping rte_eal_init() on the second.
>
> Thanks,
> Ken
Libraries should not be calling rte_eal_init()!
Even if you fix the init side, the shutdown cleanup handling would be impacted.
Maybe introduce an initializer and destructor in one place would be a workaround
prev parent reply other threads:[~2023-12-27 4:56 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-27 3:54 Nicolson Ken (ニコルソン ケン)
2023-12-27 4:56 ` Stephen Hemminger [this message]
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=20231226205602.56496841@hermes.local \
--to=stephen@networkplumber.org \
--cc=ken.nicolson@jp.panasonic.com \
--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).