[dpdk-dev] [PATCH v3] eal: refactor rte_eal_init into sub-functions
Bruce Richardson
bruce.richardson at intel.com
Fri Jan 19 18:26:37 CET 2024
On Fri, Jan 19, 2024 at 08:58:17AM -0800, Rahul Gupta wrote:
> From: Rahul Gupta <rahulgupt at microsoft.com>
>
> In continuation to the following email, I am sending this patch.
> (https://inbox.dpdk.org/dev/20231110172523.GA17466@microsoft.com/)
>
> Initialization requires rte_eal_init + rte_pktmbuf_pool_create which
> can consume a total time of 500-600 ms:
> a) For many devices FLR may take a significant chunk of time
> (200-250 ms in our use-case), this FLR is triggered during device
> probe in rte_eal_init().
> b) rte_pktmbuf_pool_create() can consume up to 300-350 ms for
> applications that require huge memory.
>
> This cost is incurred on each restart (which happens in our use-case
> during binary updates for servicing).
> This patch provides an optimization using pthreads that applications
> can use and which can save 200-230ms.
>
> In this patch, rte_eal_init() is refactored into two parts-
> a) 1st part is dependent code ie- it’s a perquisite of the FLR and
> mempool creation. So this code needs to be executed before any
> pthreads. Its named as rte_eal_init_setup()
> b) 2nd part of code is independent code ie- it can execute in parallel
> to mempool creation in a pthread. Its named as rte_eal_init_async().
>
> Existing applications requires to just call-
> rte_eal_init_wait_async_complete() after rte_eal_init() unless they wish
> to leverage the optimization.
>
This part here is a bit problematic. For something as ubiquitous as
rte_eal_init(), we should not be requiring existing application change.
Instead, can you create a new init function to replace rte_eal_init() in
the async case - and then eal_init can call that and then the
async_complete function, to avoid duplicating code.
The goal should be to have existing apps unaffected, but to allow a path to
faster startup for those that need it. In the original email you linked to
above, we had such a proposal: rte_eal_init_async() &
rte_eal_init_async_done().
Thanks,
/Bruce
More information about the dev
mailing list