Detecting if rte_eal_init() has already been called
Stephen Hemminger
stephen at networkplumber.org
Wed Dec 27 05:56:02 CET 2023
On Wed, 27 Dec 2023 03:54:12 +0000
Nicolson Ken (ニコルソン ケン) <ken.nicolson at 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
More information about the users
mailing list