Re: [RFC PATCH 4/4] fib6: add VRF functional and unit tests

Stephen Hemminger
2026-03-23T16:15:24Z

On Sun, 22 Mar 2026 15:42:15 +0000
Vladimir Medvedkin <vladimir.medvedkin@intel.com> wrote:

>
> + /* Allocate VRF IDs array for lookups if using multiple VRFs */
> + if (config.nb_vrfs > 1) {
> + vrf_ids = rte_malloc(NULL, sizeof(uint16_t) * config.nb_lookup_ips, 0);

Since this won't be shared across processes, use regular malloc, not hugepages.

> + if (vrf_ids == NULL) {
> + printf("Can not alloc VRF IDs array\n");
> + return -ENOMEM;
> + }
> + /* Generate random VRF IDs for each lookup */
> + for (i = 0; i < config.nb_lookup_ips; i++)
> + vrf_ids[i] = rte_rand() % config.nb_vrfs;
> +

Use rte_rand_max here.