[dpdk-dev] [PATCH v10 3/5] kni: add app specific mempool create and free routines

Yigit, Ferruh ferruh.yigit at linux.intel.com
Tue Oct 15 17:40:12 CEST 2019


On 8/16/2019 7:12 AM, vattunuru at marvell.com wrote:
> From: Vamsi Attunuru <vattunuru at marvell.com>
> 
> When KNI operates in IOVA = VA mode, it requires mbuf memory
> to be physically contiguous to ensure KNI kernel module could
> translate IOVA addresses properly. Patch adds a KNI specific
> mempool create routine to populate the KNI packet mbuf pool
> with memory objects that are being on a page.
> 
> KNI applications need to use this mempool create & free routines
> so that mbuf related requirements in IOVA = VA mode are handled
> inside those routines based on the enabled mode.
> 
> Updated the release notes with these new routine details.
> 
> Signed-off-by: Vamsi Attunuru <vattunuru at marvell.com>

<...>

> @@ -975,7 +975,7 @@ main(int argc, char** argv)
>  		rte_exit(EXIT_FAILURE, "Could not parse input parameters\n");
>  
>  	/* Create the mbuf pool */
> -	pktmbuf_pool = rte_pktmbuf_pool_create("mbuf_pool", NB_MBUF,
> +	pktmbuf_pool = rte_kni_pktmbuf_pool_create("mbuf_pool", NB_MBUF,

This sample application is in our control but what about user applications?

If this is a must to switch to this API I think it should be at least documented
in the KNI documentation.

>  		MEMPOOL_CACHE_SZ, 0, MBUF_DATA_SZ, rte_socket_id());
>  	if (pktmbuf_pool == NULL) {
>  		rte_exit(EXIT_FAILURE, "Could not initialise mbuf pool\n");
> @@ -1043,6 +1043,9 @@ main(int argc, char** argv)
>  			continue;
>  		kni_free_kni(port);
>  	}
> +
> +	rte_kni_pktmbuf_pool_free(pktmbuf_pool);
> +
>  	for (i = 0; i < RTE_MAX_ETHPORTS; i++)
>  		if (kni_port_params_array[i]) {
>  			rte_free(kni_port_params_array[i]);
> diff --git a/lib/librte_kni/Makefile b/lib/librte_kni/Makefile
> index ab15d10..5e3dd01 100644
> --- a/lib/librte_kni/Makefile
> +++ b/lib/librte_kni/Makefile
> @@ -6,6 +6,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
>  # library name
>  LIB = librte_kni.a
>  
> +CFLAGS += -DALLOW_EXPERIMENTAL_API

Can you please list the experimental APIs called that requires this flag as
commented, same for meson. This is to help how to know this flag later.

<...>

> @@ -20,4 +20,6 @@ EXPERIMENTAL {
>  	global:
>  
>  	rte_kni_update_link;
> +	rte_kni_pktmbuf_pool_create;
> +	rte_kni_pktmbuf_pool_free;

Can you please add comment on which DPDK version these APIs added, like done is
"lib/librte_eal/rte_eal_version.map"

>  };
> 



More information about the dev mailing list