[PATCH 1/3] mempool: remove assumptions on maximum cache size

Morten Brørup mb at smartsharesystems.com
Fri Nov 13 18:32:58 CET 2026


> From: Kishore Padmanabha [mailto:kishore.padmanabha at broadcom.com]
> Sent: Friday, 13 November 2026 07.57
> 
> Since the cache size limit was removed, a mempool cache can be created
> with any size up to the number of objects in the mempool.
> RTE_MEMPOOL_CACHE_MAX_SIZE is therefore no longer an upper bound for
> the cache size, nor for the number of objects in the cache.
> 
> The put and get functions still passed assumptions derived from this
> constant to the compiler. They are wrong for a cache larger than
> RTE_MEMPOOL_CACHE_MAX_SIZE, and violating a compiler assumption is
> undefined behavior.
> 
> Remove the assumptions based on the constant, and assume that the
> number
> of objects in the cache does not exceed the cache size instead.
> 
> Fixes: b815acfdfc48 ("mempool: remove cache size limit")
> Signed-off-by: Kishore Padmanabha <kishore.padmanabha at broadcom.com>
> ---

Important fix, thank you!

Reviewed-by: Morten Brørup <mb at smartsharesystems.com>

If you have time/resources available, could you please check if similar fixes are required in other code where RTE_MEMPOOL_CACHE_MAX_SIZE used:
https://elixir.bootlin.com/dpdk/v26.11-rc1/A/ident/RTE_MEMPOOL_CACHE_MAX_SIZE

-Morten


More information about the dev mailing list