]> git.droids-corp.org - dpdk.git/commit
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, 9 Jan 2020 13:19:53 +0000 (14:19 +0100)
commit3dfb587d6785fb3a89e30ecf4503f77103b48f6a
treea9b124a6af2ed6397313bc40e2f435c823b4fbc2
parent10060dba6455461088d24e03d3cfeba639d53022
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/rte_mempool.c
lib/librte_mempool/rte_mempool.h