[dpdk-dev] [PATCH v8 1/3] mempool: support external mempool operations

Shreyansh Jain shreyansh.jain at nxp.com
Mon Jun 6 16:38:00 CEST 2016


Hi,

(Apologies for overly-eager email sent on this thread earlier. Will be more careful in future).

This is more of a question/clarification than a comment. (And I have taken only some snippets from original mail to keep it cleaner)

<snip>
> +MEMPOOL_REGISTER_OPS(ops_mp_mc);
> +MEMPOOL_REGISTER_OPS(ops_sp_sc);
> +MEMPOOL_REGISTER_OPS(ops_mp_sc);
> +MEMPOOL_REGISTER_OPS(ops_sp_mc);
<snip>

>From the above what I understand is that multiple packet pool handlers can be created.

I have a use-case where application has multiple pools but only the packet pool is hardware backed. Using the hardware for general buffer requirements would prove costly.
>From what I understand from the patch, selection of the pool is based on the flags below.

<snip>
> +	/*
> +	 * Since we have 4 combinations of the SP/SC/MP/MC examine the flags to
> +	 * set the correct index into the table of ops structs.
> +	 */
> +	if (flags & (MEMPOOL_F_SP_PUT | MEMPOOL_F_SC_GET))
> +		rte_mempool_set_ops_byname(mp, "ring_sp_sc");
> +	else if (flags & MEMPOOL_F_SP_PUT)
> +		rte_mempool_set_ops_byname(mp, "ring_sp_mc");
> +	else if (flags & MEMPOOL_F_SC_GET)
> +		rte_mempool_set_ops_byname(mp, "ring_mp_sc");
> +	else
> +		rte_mempool_set_ops_byname(mp, "ring_mp_mc");
> +

Is there any way I can achieve the above use case of multiple pools which can be selected by an application - something like a run-time toggle/flag?

-
Shreyansh


More information about the dev mailing list