Hello Dmitry, On Wed, Oct 13, 2021 at 1:02 PM Dmitry Kozlyuk <dkozl...@oss.nvidia.com> wrote: > diff --git a/lib/mempool/rte_mempool.h b/lib/mempool/rte_mempool.h > index 663123042f..029b62a650 100644 > --- a/lib/mempool/rte_mempool.h > +++ b/lib/mempool/rte_mempool.h > @@ -262,6 +262,8 @@ struct rte_mempool { > #define MEMPOOL_F_SC_GET 0x0008 /**< Default get is > "single-consumer".*/ > #define MEMPOOL_F_POOL_CREATED 0x0010 /**< Internal: pool is created. */ > #define MEMPOOL_F_NO_IOVA_CONTIG 0x0020 /**< Don't need IOVA contiguous > objs. */ > +#define MEMPOOL_F_NON_IO 0x0040 > + /**< Internal: pool is not usable for device IO (DMA). */ > > /** > * @internal When debug is enabled, store some statistics. > @@ -991,6 +993,9 @@ typedef void (rte_mempool_ctor_t)(struct rte_mempool *, > void *); > * "single-consumer". Otherwise, it is "multi-consumers". > * - MEMPOOL_F_NO_IOVA_CONTIG: If set, allocated objects won't > * necessarily be contiguous in IO memory. > + * - MEMPOOL_F_NON_IO: If set, the mempool is considered to be > + * never used for device IO, i.e. for DMA operations. > + * It's a hint to other components and does not affect the mempool > behavior. > * @return > * The pointer to the new allocated mempool, on success. NULL on error > * with rte_errno set appropriately. Possible rte_errno values include:
- When rebasing on main, you probably won't be able to call this new flag. The diff should be something like: diff --git a/app/test/test_mempool.c b/app/test/test_mempool.c index d886f4800c..35c80291fa 100644 --- a/app/test/test_mempool.c +++ b/app/test/test_mempool.c @@ -214,7 +214,7 @@ static int test_mempool_creation_with_unknown_flag(void) MEMPOOL_ELT_SIZE, 0, 0, NULL, NULL, NULL, NULL, - SOCKET_ID_ANY, MEMPOOL_F_NO_IOVA_CONTIG << 1); + SOCKET_ID_ANY, MEMPOOL_F_NON_IO << 1); if (mp_cov != NULL) { rte_mempool_free(mp_cov); diff --git a/lib/mempool/rte_mempool.c b/lib/mempool/rte_mempool.c index 8d5f99f7e7..27d197fe86 100644 --- a/lib/mempool/rte_mempool.c +++ b/lib/mempool/rte_mempool.c @@ -802,6 +802,7 @@ rte_mempool_cache_free(struct rte_mempool_cache *cache) | MEMPOOL_F_SC_GET \ | MEMPOOL_F_POOL_CREATED \ | MEMPOOL_F_NO_IOVA_CONTIG \ + | MEMPOOL_F_NON_IO \ ) /* create an empty mempool */ struct rte_mempool * - While grepping, I noticed that proc-info also dumps mempool flags. This could be something to enhance, maybe amending current rte_mempool_dump() and having this tool use it. But for now, can you update this tool too? -- David Marchand