[PATCH 1/2] net/bonding: add error hint for invald args

Min Hu (Connor) humin29 at huawei.com
Tue Feb 15 10:12:56 CET 2022


Hi, wan,
	The headline has spelling errors.

在 2022/2/14 16:13, Wan Junjie 写道:
> When invalid args exsit, application exits with no error hint.
> Adding a log message here will help users to know the reson.
> 
> Signed-off-by: Wan Junjie <wanjunjie at bytedance.com>
> ---
>   drivers/net/bonding/rte_eth_bond_pmd.c | 4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c
> index bfa931098e..aa6519f83c 100644
> --- a/drivers/net/bonding/rte_eth_bond_pmd.c
> +++ b/drivers/net/bonding/rte_eth_bond_pmd.c
> @@ -3439,8 +3439,10 @@ bond_probe(struct rte_vdev_device *dev)
>   
>   	kvlist = rte_kvargs_parse(rte_vdev_device_args(dev),
>   		pmd_bond_init_valid_arguments);
> -	if (kvlist == NULL)
> +	if (kvlist == NULL) {
> +		RTE_BOND_LOG(ERR, "Invalid args in %s", rte_vdev_device_args(dev));
>   		return -1;
> +	}
>   
>   	/* Parse link bonding mode */
>   	if (rte_kvargs_count(kvlist, PMD_BOND_MODE_KVARG) == 1) {
> 


More information about the dev mailing list