]> 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 09:51:05 +0000 (10:51 +0100)
commitb6fc4263f3398b482115dce729e73cda92ab0207
tree8debda37a7589ded1284f5f8250e4e1cfb36eb0d
parent2e088e6f94b773233c06440763c1be43d0d705b3
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")
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
lib/librte_mempool/rte_mempool.c