[dpdk-dev] [PATCH 26/36] mempool: introduce a function to create an empty mempool

Wiles, Keith keith.wiles at intel.com
Thu Apr 14 17:57:42 CEST 2016


>Introduce a new function rte_mempool_create_empty()
>that allocates a mempool that is not populated.
>
>The functions rte_mempool_create() and rte_mempool_xmem_create()
>now make use of it, making their code much easier to read.
>Currently, they are the only users of rte_mempool_create_empty()
>but the function will be made public in next commits.
>
>Signed-off-by: Olivier Matz <olivier.matz at 6wind.com>
>+/* create an empty mempool */
>+static struct rte_mempool *
>+rte_mempool_create_empty(const char *name, unsigned n, unsigned elt_size,
>+	unsigned cache_size, unsigned private_data_size,
>+	int socket_id, unsigned flags)
> {

When two processes need to use the same mempool, do we have a race condition with one doing a rte_mempool_create_empty() and the other process tries to use it when it finds that mempool before being fully initialized by the first process?

Regards,
Keith






More information about the dev mailing list