[RFC PATCH v2 3/7] app/test-fib: fix size of the tables for large counts

Stephen Hemminger stephen at networkplumber.org
Thu Oct 15 00:52:27 CEST 2026


On Wed, 14 Oct 2026 18:39:17 +0000
Vladimir Medvedkin <vladimir.medvedkin at intel.com> wrote:

> diff --git a/app/test-fib/main.c b/app/test-fib/main.c
> index d85d94fdd1..0bc8dd2aa4 100644
> --- a/app/test-fib/main.c
> +++ b/app/test-fib/main.c
> @@ -1260,12 +1260,12 @@ main(int argc, char **argv)
>  			BURST_SZ);
>  
>  	/* Alloc routes table*/
> -	config.rt  = rte_malloc(NULL, rt_ent_sz * config.nb_routes, 0);
> +	config.rt  = rte_malloc(NULL, (size_t)rt_ent_sz * config.nb_routes, 0);
>  	if (config.rt == NULL)
>  		rte_exit(-ENOMEM, "Can not alloc rt\n");
>  
>  	/* Alloc table with ip's for lookup*/
> -	config.lookup_tbl  = rte_malloc(NULL, lookup_ent_sz *
> +	config.lookup_tbl  = rte_malloc(NULL, (size_t)lookup_ent_sz *
>  		config.nb_lookup_ips, 0);

if you are going to change these, then fix a couple related things.
  - comments have bad spacing in there
  - use rte_calloc() for arrays
  - not sure why rte_malloc is used at all, this is test code. Doesn't need to be hugepages.


More information about the dev mailing list