[RFC PATCH 4/4] fib6: add VRF functional and unit tests
Stephen Hemminger
stephen at networkplumber.org
Sun Mar 22 17:45:19 CET 2026
On Sun, 22 Mar 2026 15:42:15 +0000
Vladimir Medvedkin <vladimir.medvedkin at 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.
More information about the dev
mailing list