> From: Paul Szczepanek [mailto:paul.szczepa...@arm.com] > Sent: Friday, 24 May 2024 10.37 > > +size_t rte_mempool_get_obj_alignment(struct rte_mempool *mp) > +{ > + if (mp == NULL) > + return 0; > + > + if (mp->flags & RTE_MEMPOOL_F_NO_CACHE_ALIGN) > + return sizeof(uint64_t); > + else > + return RTE_MEMPOOL_ALIGN; > +}
The object alignment depends on the underlying mempool driver. You cannot assume that it is either sizeof(uint64_t) or cache line aligned. Refer to the calc_mem_size driver operation, which also provides object alignment information: https://elixir.bootlin.com/dpdk/v24.03/source/lib/mempool/rte_mempool.h#L529 If you need this function, you need to add a new driver operation, and your function above can be the default for this operation, like for the the calc_mem_size driver operation: https://elixir.bootlin.com/dpdk/v24.03/source/lib/mempool/rte_mempool_ops.c#L120