Re: [PATCH v4 2/2] mempool/cnxk: add halo support in mempool

Stephen Hemminger
2026-02-19T17:33:48Z

On Tue, 17 Feb 2026 16:09:22 +0530
Nawal Kishor <nkishor@marvell.com> wrote:

> +static struct rte_mempool_ops cn20k_mempool_ops = {
> + .name = "cn20k_mempool_ops",
> + .alloc = cn20k_mempool_alloc,
> + .free = cn10k_mempool_free,
> + .enqueue = cn10k_mempool_enq,
> + .dequeue = cn10k_mempool_deq,
> + .get_count = cn10k_mempool_get_count,
> + .calc_mem_size = cnxk_mempool_calc_mem_size,
> + .populate = cnxk_mempool_populate,
> +};
> +

If possible ops structures should be const to protect from modification.

> +static int
> +parse_halo_ena_handler(const char *key, const char *value, void *extra_args)
> +{
> + RTE_SET_USED(key);

Prefer __rte_unused attribute

> + uint8_t val;
> +
> + val = atoi(value);
> + if (val != 0 && val != 1)
> + return -EINVAL;
> +
> + *(uint8_t *)extra_args = val;
> + return 0;
> +}

Using atoi() allows non-string values. You should be using a more robust handler.

Actually kvargs should have handlers for common types, but that is an enhancement.