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

Morten Brørup mb at smartsharesystems.com
Fri May 31 11:32:45 CEST 2024


> From: Paul Szczepanek [mailto:paul.szczepanek at arm.com]
> Sent: Thursday, 30 May 2024 11.41
> 
> 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>
> Acked-by: Morten Brørup <mb at smartsharesystems.com>
> ---

LGTM.

With or without the suggested changes below,

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


> @@ -843,12 +843,17 @@ test_mempool(void)
>  	int ret = -1;
>  	uint32_t nb_objs = 0;
>  	uint32_t nb_mem_chunks = 0;
> +	void *start = NULL;
> +	size_t length = 0;
> +	size_t alignment = 0;
> +	bool ret_bool = false;

Suggestion, for consistency:
ret_bool -> contiguous



> +int rte_mempool_get_mem_range(struct rte_mempool *mp,
> +		void **mem_range_start, size_t *mem_range_length,
> +		bool *contiguous)

Suggestion, for consistency:
contiguous -> mem_range_contiguous

Also in the header file.

> +{
> +	if (mp == NULL)
> +		return -EINVAL;
> +
> +	void *address_low = (void *)UINTPTR_MAX;
> +	void *address_high = 0;
> +	size_t address_diff = 0;
> +	size_t mem_total_size = 0;

Suggestion, for consistency:
mem_total_size -> total_size



More information about the dev mailing list