[PATCH v6 4/4] common/nfp: use new API to parse kvargs

Chaoyong He chaoyong.he at corigine.com
Thu Oct 10 05:24:11 CEST 2024



> -----Original Message-----
> From: Chengwen Feng <fengchengwen at huawei.com>
> Sent: Wednesday, October 9, 2024 12:51 PM
> To: thomas at monjalon.net; ferruh.yigit at amd.com; Chaoyong He
> <chaoyong.he at corigine.com>
> Cc: dev at dpdk.org; stephen at networkplumber.org
> Subject: [PATCH v6 4/4] common/nfp: use new API to parse kvargs
> 
> The nfp_parse_class_options() function could handle both key=value and
> only-key, so it should use rte_kvargs_process_opt() instead of
> rte_kvargs_process() to parse.
> 
> Signed-off-by: Chengwen Feng <fengchengwen at huawei.com>
> ---
>  drivers/common/nfp/nfp_common_pci.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/common/nfp/nfp_common_pci.c
> b/drivers/common/nfp/nfp_common_pci.c
> index 723035d0f7..5c36052f9d 100644
> --- a/drivers/common/nfp/nfp_common_pci.c
> +++ b/drivers/common/nfp/nfp_common_pci.c
> @@ -170,10 +170,8 @@ nfp_parse_class_options(const struct rte_devargs
> *devargs)
>  	if (kvargs == NULL)
>  		return dev_class;
> 
> -	if (rte_kvargs_count(kvargs, RTE_DEVARGS_KEY_CLASS) != 0) {
> -		rte_kvargs_process(kvargs, RTE_DEVARGS_KEY_CLASS,
> -				nfp_kvarg_dev_class_handler, &dev_class);
> -	}
> +	rte_kvargs_process_opt(kvargs, RTE_DEVARGS_KEY_CLASS,
> +			       nfp_kvarg_dev_class_handler, &dev_class);
> 
>  	rte_kvargs_free(kvargs);
> 
> --
> 2.17.1

Looks good to me.

Acked-by: Chaoyong He <chaoyong.he at corigine.com>



More information about the dev mailing list