DPDK usage discussions
 help / color / mirror / Atom feed
* Detecting if rte_eal_init() has already been called
@ 2023-12-27  3:54 Nicolson Ken (ニコルソン ケン)
  2023-12-27  4:56 ` Stephen Hemminger
  0 siblings, 1 reply; 2+ messages in thread
From: Nicolson Ken (ニコルソン ケン) @ 2023-12-27  3:54 UTC (permalink / raw)
  To: users

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Detecting if rte_eal_init() has already been called
  2023-12-27  3:54 Detecting if rte_eal_init() has already been called Nicolson Ken (ニコルソン ケン)
@ 2023-12-27  4:56 ` Stephen Hemminger
  0 siblings, 0 replies; 2+ messages in thread
From: Stephen Hemminger @ 2023-12-27  4:56 UTC (permalink / raw)
  To: Nicolson Ken (ニコルソン ケン)
  Cc: users

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-12-27  4:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-27  3:54 Detecting if rte_eal_init() has already been called Nicolson Ken (ニコルソン ケン)
2023-12-27  4:56 ` Stephen Hemminger

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).