eal: deduplicate roundup code

RTE_CACHE_LINE_ROUNDUP() implementation repeated RTE_ALIGN_MUL_CEIL().
In other places RTE_CACHE_LINE_SIZE is assumed to be a power-of-2,
so define RTE_CACHE_LINE_ROUNDUP() using RTE_ALIGN_CEIL().

Signed-off-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
Reviewed-by: Morten Brørup <mb@smartsharesystems.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Chengwen Feng <fengchengwen@huawei.com>
This commit is contained in:
Dmitry Kozlyuk 2022-08-27 14:32:20 +03:00 committed by David Marchand
parent 1a7374c956
commit 107dc0664c

View File

@ -425,9 +425,7 @@ rte_is_aligned(void *ptr, unsigned align)
#define RTE_CACHE_LINE_MASK (RTE_CACHE_LINE_SIZE-1)
/** Return the first cache-aligned value greater or equal to size. */
#define RTE_CACHE_LINE_ROUNDUP(size) \
(RTE_CACHE_LINE_SIZE * ((size + RTE_CACHE_LINE_SIZE - 1) / \
RTE_CACHE_LINE_SIZE))
#define RTE_CACHE_LINE_ROUNDUP(size) RTE_ALIGN_CEIL(size, RTE_CACHE_LINE_SIZE)
/** Cache line size in terms of log2 */
#if RTE_CACHE_LINE_SIZE == 64