[1/2] net/bonding: add error hint for invald args
Checks
Commit Message
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@bytedance.com>
---
drivers/net/bonding/rte_eth_bond_pmd.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
Comments
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@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) {
>
Hi Min Hu,
Thanks for the reply
Will fix it in v2.
Regards,
Wan Junjie
On Tue, Feb 15, 2022 at 5:12 PM Min Hu (Connor) <humin29@huawei.com> wrote:
>
> 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@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) {
> >
@@ -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) {