mempool: fix non-IO flag inference
authorDmitry Kozlyuk <dkozlyuk@nvidia.com>
Fri, 22 Oct 2021 21:09:19 +0000 (00:09 +0300)
committerThomas Monjalon <thomas@monjalon.net>
Mon, 25 Oct 2021 14:52:56 +0000 (16:52 +0200)
commit6fda3ff6f040e02d2d746c953ec5cb47a2ddcbae
tree8dfb6d3e407de68812bc34d8e0ac04616a8bfa34
parentc28e2165ec360c39ea0e3a0c02b4229966697384
mempool: fix non-IO flag inference

When mempool had been created with RTE_MEMPOOL_F_NO_IOVA_CONTIG flag
but later populated with valid IOVA, RTE_MEMPOOL_F_NON_IO was unset,
while it should be kept. The unit test did not catch this
because rte_mempool_populate_default() it used was populating
with RTE_BAD_IOVA.

Keep setting RTE_MEMPOOL_NON_IO at an empty mempool creation
and add an assert for it in the unit test (remove the separate case).
Do not reset the flag if RTE_MEMPOOL_F_ON_IOVA_CONTIG is set.

Fixes: 11541c5c81dd ("mempool: add non-IO flag")

Signed-off-by: Dmitry Kozlyuk <dkozlyuk@nvidia.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
app/test/test_mempool.c
lib/mempool/rte_mempool.c