[dpdk-dev] [PATCH] fib: add rib extension size parameter

Thomas Monjalon thomas at monjalon.net
Mon Oct 25 19:23:37 CEST 2021


06/09/2021 17:55, Vladimir Medvedkin:
> This patch adds a new parameter to the fib configuration to specify
> the size of the extension for internal RIB structure.

It looks to be an announced API change.
What happens if the new field is not initialized in the app?
At least it would deserve a note in the release notes in API changes I think.

> --- a/examples/l3fwd/l3fwd_fib.c
> +++ b/examples/l3fwd/l3fwd_fib.c
> @@ -426,6 +426,7 @@ setup_fib(const int socketid)
>  	/* Create the fib IPv4 table. */
>  	config_ipv4.type = RTE_FIB_DIR24_8;
>  	config_ipv4.max_routes = (1 << 16);
> +	config_ipv4.rib_ext_sz = 0;
>  	config_ipv4.default_nh = FIB_DEFAULT_HOP;
>  	config_ipv4.dir24_8.nh_sz = RTE_FIB_DIR24_8_4B;
>  	config_ipv4.dir24_8.num_tbl8 = (1 << 15);
> @@ -475,6 +476,7 @@ setup_fib(const int socketid)
>  
>  	config.type = RTE_FIB6_TRIE;
>  	config.max_routes = (1 << 16) - 1;
> +	config.rib_ext_sz = 0;
>  	config.default_nh = FIB_DEFAULT_HOP;
>  	config.trie.nh_sz = RTE_FIB6_TRIE_4B;
>  	config.trie.num_tbl8 = (1 << 15);
> diff --git a/lib/fib/rte_fib.c b/lib/fib/rte_fib.c
> index b354d4b..6ca180d 100644
> --- a/lib/fib/rte_fib.c
> +++ b/lib/fib/rte_fib.c
> @@ -164,7 +164,7 @@ rte_fib_create(const char *name, int socket_id, struct rte_fib_conf *conf)
>  		return NULL;
>  	}
>  
> -	rib_conf.ext_sz = 0;
> +	rib_conf.ext_sz = conf->rib_ext_sz;
>  	rib_conf.max_nodes = conf->max_routes * 2;
>  
>  	rib = rte_rib_create(name, socket_id, &rib_conf);
> diff --git a/lib/fib/rte_fib.h b/lib/fib/rte_fib.h
> index acad209..570b4b6 100644
> --- a/lib/fib/rte_fib.h
> +++ b/lib/fib/rte_fib.h
> @@ -84,6 +84,8 @@ struct rte_fib_conf {
>  	/** Default value returned on lookup if there is no route */
>  	uint64_t default_nh;
>  	int	max_routes;
> +	/** Size of the node extension in the internal RIB struct */
> +	unsigned int rib_ext_sz;
>  	union {
>  		struct {
>  			enum rte_fib_dir24_8_nh_sz nh_sz;





More information about the dev mailing list