[dpdk-dev] [PATCH] mempool: fix mempool virt populate with small chunks
Burakov, Anatoly
anatoly.burakov at intel.com
Thu Jan 9 14:52:41 CET 2020
On 09-Jan-20 1:27 PM, Olivier Matz wrote:
> 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 at dpdk.org
>
> Signed-off-by: Olivier Matz <olivier.matz at 6wind.com>
> ---
>
The approach fixes the issue on my end, so
Tested-by: Anatoly Burakov <anatoly.burakov at intel.com>
> Is there a simple way to ensure that we won't forget to remove the
> wrapper for 20.11? Anatoly suggested me to use versioned symbols, but
> it's not clear to me how.
>
Yes, i'd like to do better than "ah shur we won't forget pinky swear".
Can't we do this with ABI versioning? E.g.
rte_populate_iova_v20() ... returns EINVAL
rte_populate_iova_v21() ... returns ENOBUFS
I'm pretty sure, even if it doesn't break, it will still be more likely
to not be forgotten because there's almost a guarantee that someone will
grep for symbol versioning macros across the codebase around 20.11
timeframe.
--
Thanks,
Anatoly
More information about the dev
mailing list