> From: Paul Szczepanek [mailto:paul.szczepa...@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.szczepa...@arm.com>
> Reviewed-by: Jack Bond-Preston <jack.bond-pres...@foss.arm.com>
> Reviewed-by: Nathan Brown <nathan.br...@arm.com>
> Acked-by: Morten Brørup <m...@smartsharesystems.com>
> ---

LGTM.

With or without the suggested changes below,

Reviewed-by: Morten Brørup <m...@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

Reply via email to