mempool: accept user flags only
authorDavid Marchand <david.marchand@redhat.com>
Mon, 18 Oct 2021 08:26:35 +0000 (10:26 +0200)
committerDavid Marchand <david.marchand@redhat.com>
Wed, 20 Oct 2021 08:03:55 +0000 (10:03 +0200)
commitafdaa60795d525aee4fd21121561df737014cee0
tree8484ba1d8c63fdedf047d3d49c48b1371345a787
parentfb11ae88165cdea37cc3b86f045ac0e899aa4e77
mempool: accept user flags only

As reported by Dmitry, RTE_MEMPOOL_F_POOL_CREATED is a flag only
manipulated internally.
This flag is not supposed to be requested from an application and would
probably result in an incorrect behavior if an application did pass it.

At least one other internal flag has been added recently and more may be
introduced later.

Rework the check and export a mask of valid user flags for use in the
unit test.

Fixes: b240af8b10f9 ("mempool: enforce valid flags at creation")

Reported-by: Dmitry Kozlyuk <dkozlyuk@nvidia.com>
Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
app/test/test_mempool.c
lib/mempool/rte_mempool.c
lib/mempool/rte_mempool.h