[PATCH v12 2/6] mempool: add functions to get extra mempool info

Morten Brørup mb at smartsharesystems.com
Wed May 29 15:56:02 CEST 2024


> From: Paul Szczepanek [mailto:paul.szczepanek at arm.com]
> Sent: Wednesday, 29 May 2024 12.23
> 
> Add two functions:
> - rte_mempool_get_mem_range - get virtual memory range
> of the objects in the mempool,
> - rte_mempool_get_obj_alignment - get alignment of
> objects in the mempool.
> 
> Add two tests that test these new functions.
> 
> Signed-off-by: Paul Szczepanek <paul.szczepanek at arm.com>
> Reviewed-by: Jack Bond-Preston <jack.bond-preston at foss.arm.com>
> Reviewed-by: Nathan Brown <nathan.brown at arm.com>
> ---
> 
> +/**
> + * @warning
> + * @b EXPERIMENTAL: this API may change without prior notice.
> + *
> + * Get information about the memory range used by the mempool.
> + *
> + * @param[in] mp
> + *   Pointer to an initialized mempool.
> + * @param[out] mem_range_start
> + *   Returns lowest address in mempool.
> + * @param[out] mem_range_length
> + *   Returns the length of the memory range containing all the addresses
> + *   in the memory pool.
> + * @return
> + *   0 on success, -EINVAL if arguments are not valid.
> + *
> + **/
> +__rte_experimental
> +int rte_mempool_get_mem_range(struct rte_mempool *mp,
> +		void **mem_range_start, size_t *mem_range_length);

Paul,

Could you please add one more output parameter "bool *mem_range_contiguous" to this function, returning true if the memory chunks are contiguous.

It will be useful instead of implementing get_memhdr_info() locally in this other patch series:
https://inbox.dpdk.org/dev/MW4PR11MB58724AC82A34A3EEFEF78E898EF22@MW4PR11MB5872.namprd11.prod.outlook.com/

Please coordinate this change directly with Frank Du <frank.du at intel.com>.

-Morten



More information about the dev mailing list