[dpdk-dev] [PATCH v3] mempool: remove non-EAL thread note from header
olivier.matz at 6wind.com
Fri Mar 24 15:04:44 CET 2017
On Thu, 23 Mar 2017 09:20:58 -0500, Gage Eads <gage.eads at intel.com> wrote:
> Commit 30e6399892276 ("mempool: support non-EAL thread") added the
> capability for non-EAL threads to use the mempool library. This commit
> removes the note indicating that the mempool library cannot be used safely
> by non-EAL threads.
> Also, fix a typo.
> Signed-off-by: Gage Eads <gage.eads at intel.com>
> v2: Changed commit message to referenced commit 30e63998 instead of 4b5062755
> v3: Fix checkpatch error
> lib/librte_mempool/rte_mempool.h | 6 +-----
> 1 file changed, 1 insertion(+), 5 deletions(-)
> diff --git a/lib/librte_mempool/rte_mempool.h b/lib/librte_mempool/rte_mempool.h
> index 991feaa..b1186fd 100644
> --- a/lib/librte_mempool/rte_mempool.h
> +++ b/lib/librte_mempool/rte_mempool.h
> @@ -53,11 +53,7 @@
> * Note: the mempool implementation is not preemptable. A lcore must
> * not be interrupted by another task that uses the same mempool
> - * (because it uses a ring which is not preemptable). Also, mempool
> - * functions must not be used outside the DPDK environment: for
> - * example, in linuxapp environment, a thread that is not created by
> - * the EAL must not use mempools. This is due to the per-lcore cache
> - * that won't work as rte_lcore_id() will not return a correct value.
> + * (because it uses a ring which is not preemptible).
> #include <stdio.h>
I agree the comment is not correct today. But I think we should
still highlight that usual functions [ex: rte_mempool_get(),
rte_mempool_put()] won't work when called on a non-EAL thread.
Maybe it could be reworded in that way:
Note: the mempool implementation is not preemptable. A lcore must not be
interrupted by another task that uses the same mempool (because it uses
a ring which is not preemptible). Also, usual mempool functions like
rte_mempool_get() or rte_mempool_put() are designed to be called from an
EAL thread due to the internal per-lcore cache. When using a mempool
from a non-EAL thread, a user cache has to be provided to
rte_mempool_generic_get() or rte_mempool_generic_put().
What do you think?
More information about the dev