mempool: fix mempool virt populate with small chunks
authorOlivier Matz <olivier.matz@6wind.com>
Wed, 8 Jan 2020 15:05:41 +0000 (16:05 +0100)
committerOlivier Matz <olivier.matz@6wind.com>
Thu, 16 Jan 2020 12:41:10 +0000 (13:41 +0100)
commit89a90fb38833ad6723942fe0dae5e5473485af0e
tree0a94ec1399288d3d74774028627803afe7ffaccc
parent9160d6386472b70503e504df765440ecdb604d7d
mempool: fix mempool virt populate with small chunks

To populate a mempool with a virtual area, the mempool code calls
rte_mempool_populate_iova() for each iova-contiguous area. It happens
(rarely) that this area is too small to store one object. In this case,
rte_mempool_populate_iova() returns an error, which is forwarded by
rte_mempool_populate_virt().

This case should not throw an error in
rte_mempool_populate_virt(). Instead, the area that is too small should
just be ignored.

To fix this issue, change the return value of
rte_mempool_populate_iova() to -ENOBUFS when no object can be populated,
so it can be ignored by the caller. As this would be an API change, add
a compat wrapper to keep the current API unchanged. The wrapper will be
removed for 20.11.

Fixes: 354788b60cfd ("mempool: allow populating with unaligned virtual area")
Cc: stable@dpdk.org
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
doc/guides/rel_notes/deprecation.rst
lib/librte_mempool/meson.build
lib/librte_mempool/rte_mempool.c
lib/librte_mempool/rte_mempool.h
lib/librte_mempool/rte_mempool_version.map