* [PATCH v2 net] devlink: Fix error handling in param and info_get dumpit cb
@ 2019-09-30 6:22 Vasundhara Volam
2019-09-30 6:50 ` Jiri Pirko
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Vasundhara Volam @ 2019-09-30 6:22 UTC (permalink / raw)
To: davem; +Cc: netdev, Vasundhara Volam, Andrew Lunn, Jiri Pirko, Michael Chan
If any of the param or info_get op returns error, dumpit cb is
skipping to dump remaining params or info_get ops for all the
drivers.
Fix to not return if any of the param/info_get op returns error
as not supported and continue to dump remaining information.
v2: Modify the patch to return error, except for params/info_get
op that return -EOPNOTSUPP as suggested by Andrew Lunn. Also, modify
commit message to reflect the same.
Cc: Andrew Lunn <andrew@lunn.ch>
Cc: Jiri Pirko <jiri@mellanox.com>
Cc: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
---
net/core/devlink.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/net/core/devlink.c b/net/core/devlink.c
index e48680e..f80151e 100644
--- a/net/core/devlink.c
+++ b/net/core/devlink.c
@@ -3172,7 +3172,7 @@ static int devlink_nl_cmd_param_get_dumpit(struct sk_buff *msg,
NETLINK_CB(cb->skb).portid,
cb->nlh->nlmsg_seq,
NLM_F_MULTI);
- if (err) {
+ if (err && err != -EOPNOTSUPP) {
mutex_unlock(&devlink->lock);
goto out;
}
@@ -3432,7 +3432,7 @@ static int devlink_nl_cmd_port_param_get_dumpit(struct sk_buff *msg,
NETLINK_CB(cb->skb).portid,
cb->nlh->nlmsg_seq,
NLM_F_MULTI);
- if (err) {
+ if (err && err != -EOPNOTSUPP) {
mutex_unlock(&devlink->lock);
goto out;
}
@@ -4088,7 +4088,7 @@ static int devlink_nl_cmd_info_get_dumpit(struct sk_buff *msg,
cb->nlh->nlmsg_seq, NLM_F_MULTI,
cb->extack);
mutex_unlock(&devlink->lock);
- if (err)
+ if (err && err != -EOPNOTSUPP)
break;
idx++;
}
--
1.8.3.1
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [PATCH v2 net] devlink: Fix error handling in param and info_get dumpit cb
2019-09-30 6:22 [PATCH v2 net] devlink: Fix error handling in param and info_get dumpit cb Vasundhara Volam
@ 2019-09-30 6:50 ` Jiri Pirko
2019-09-30 12:10 ` Andrew Lunn
2019-10-01 17:09 ` David Miller
2 siblings, 0 replies; 5+ messages in thread
From: Jiri Pirko @ 2019-09-30 6:50 UTC (permalink / raw)
To: Vasundhara Volam; +Cc: davem, netdev, Andrew Lunn, Jiri Pirko, Michael Chan
Mon, Sep 30, 2019 at 08:22:21AM CEST, vasundhara-v.volam@broadcom.com wrote:
>If any of the param or info_get op returns error, dumpit cb is
>skipping to dump remaining params or info_get ops for all the
>drivers.
>
>Fix to not return if any of the param/info_get op returns error
>as not supported and continue to dump remaining information.
>
>v2: Modify the patch to return error, except for params/info_get
>op that return -EOPNOTSUPP as suggested by Andrew Lunn. Also, modify
>commit message to reflect the same.
>
>Cc: Andrew Lunn <andrew@lunn.ch>
>Cc: Jiri Pirko <jiri@mellanox.com>
>Cc: Michael Chan <michael.chan@broadcom.com>
>Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Acked-by: Jiri Pirko <jiri@mellanox.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v2 net] devlink: Fix error handling in param and info_get dumpit cb
2019-09-30 6:22 [PATCH v2 net] devlink: Fix error handling in param and info_get dumpit cb Vasundhara Volam
2019-09-30 6:50 ` Jiri Pirko
@ 2019-09-30 12:10 ` Andrew Lunn
2019-09-30 13:34 ` Jiri Pirko
2019-10-01 17:09 ` David Miller
2 siblings, 1 reply; 5+ messages in thread
From: Andrew Lunn @ 2019-09-30 12:10 UTC (permalink / raw)
To: Vasundhara Volam, jiri; +Cc: davem, netdev, Jiri Pirko, Michael Chan
On Mon, Sep 30, 2019 at 11:52:21AM +0530, Vasundhara Volam wrote:
> If any of the param or info_get op returns error, dumpit cb is
> skipping to dump remaining params or info_get ops for all the
> drivers.
>
> Fix to not return if any of the param/info_get op returns error
> as not supported and continue to dump remaining information.
>
> v2: Modify the patch to return error, except for params/info_get
> op that return -EOPNOTSUPP as suggested by Andrew Lunn. Also, modify
> commit message to reflect the same.
>
> Cc: Andrew Lunn <andrew@lunn.ch>
> Cc: Jiri Pirko <jiri@mellanox.com>
> Cc: Michael Chan <michael.chan@broadcom.com>
> Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
> ---
> net/core/devlink.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/net/core/devlink.c b/net/core/devlink.c
> index e48680e..f80151e 100644
> --- a/net/core/devlink.c
> +++ b/net/core/devlink.c
> @@ -3172,7 +3172,7 @@ static int devlink_nl_cmd_param_get_dumpit(struct sk_buff *msg,
> NETLINK_CB(cb->skb).portid,
> cb->nlh->nlmsg_seq,
> NLM_F_MULTI);
> - if (err) {
> + if (err && err != -EOPNOTSUPP) {
> mutex_unlock(&devlink->lock);
> goto out;
> }
and out: is
out:
mutex_unlock(&devlink_mutex);
cb->args[0] = idx;
return msg->len;
}
Jiri: Is the intention really to throw away the error?
Looking at the rest of devlink, all the other _get_dumpit() functions,
except health_reporter_dump_get_dumpit(), do discard any errors.
As for this patch
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Andrew
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH v2 net] devlink: Fix error handling in param and info_get dumpit cb
2019-09-30 12:10 ` Andrew Lunn
@ 2019-09-30 13:34 ` Jiri Pirko
0 siblings, 0 replies; 5+ messages in thread
From: Jiri Pirko @ 2019-09-30 13:34 UTC (permalink / raw)
To: Andrew Lunn; +Cc: Vasundhara Volam, jiri, davem, netdev, Michael Chan
Mon, Sep 30, 2019 at 02:10:03PM CEST, andrew@lunn.ch wrote:
>On Mon, Sep 30, 2019 at 11:52:21AM +0530, Vasundhara Volam wrote:
>> If any of the param or info_get op returns error, dumpit cb is
>> skipping to dump remaining params or info_get ops for all the
>> drivers.
>>
>> Fix to not return if any of the param/info_get op returns error
>> as not supported and continue to dump remaining information.
>>
>> v2: Modify the patch to return error, except for params/info_get
>> op that return -EOPNOTSUPP as suggested by Andrew Lunn. Also, modify
>> commit message to reflect the same.
>>
>> Cc: Andrew Lunn <andrew@lunn.ch>
>> Cc: Jiri Pirko <jiri@mellanox.com>
>> Cc: Michael Chan <michael.chan@broadcom.com>
>> Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
>> ---
>> net/core/devlink.c | 6 +++---
>> 1 file changed, 3 insertions(+), 3 deletions(-)
>>
>> diff --git a/net/core/devlink.c b/net/core/devlink.c
>> index e48680e..f80151e 100644
>> --- a/net/core/devlink.c
>> +++ b/net/core/devlink.c
>> @@ -3172,7 +3172,7 @@ static int devlink_nl_cmd_param_get_dumpit(struct sk_buff *msg,
>> NETLINK_CB(cb->skb).portid,
>> cb->nlh->nlmsg_seq,
>> NLM_F_MULTI);
>> - if (err) {
>> + if (err && err != -EOPNOTSUPP) {
>> mutex_unlock(&devlink->lock);
>> goto out;
>> }
>
>and out: is
>
>out:
> mutex_unlock(&devlink_mutex);
>
> cb->args[0] = idx;
> return msg->len;
>}
>
>Jiri: Is the intention really to throw away the error?
>
>Looking at the rest of devlink, all the other _get_dumpit() functions,
>except health_reporter_dump_get_dumpit(), do discard any errors.
You are correct. The -EMSGSIZE dump errors should not be propagaged out
and -EOPNOTSUPP, but the rest should. I'll look into it.
Thanks!
>
>As for this patch
>
>Reviewed-by: Andrew Lunn <andrew@lunn.ch>
>
> Andrew
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v2 net] devlink: Fix error handling in param and info_get dumpit cb
2019-09-30 6:22 [PATCH v2 net] devlink: Fix error handling in param and info_get dumpit cb Vasundhara Volam
2019-09-30 6:50 ` Jiri Pirko
2019-09-30 12:10 ` Andrew Lunn
@ 2019-10-01 17:09 ` David Miller
2 siblings, 0 replies; 5+ messages in thread
From: David Miller @ 2019-10-01 17:09 UTC (permalink / raw)
To: vasundhara-v.volam; +Cc: netdev, andrew, jiri, michael.chan
From: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Date: Mon, 30 Sep 2019 11:52:21 +0530
> If any of the param or info_get op returns error, dumpit cb is
> skipping to dump remaining params or info_get ops for all the
> drivers.
>
> Fix to not return if any of the param/info_get op returns error
> as not supported and continue to dump remaining information.
>
> v2: Modify the patch to return error, except for params/info_get
> op that return -EOPNOTSUPP as suggested by Andrew Lunn. Also, modify
> commit message to reflect the same.
>
> Cc: Andrew Lunn <andrew@lunn.ch>
> Cc: Jiri Pirko <jiri@mellanox.com>
> Cc: Michael Chan <michael.chan@broadcom.com>
> Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Applied, thanks.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2019-10-01 17:09 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-09-30 6:22 [PATCH v2 net] devlink: Fix error handling in param and info_get dumpit cb Vasundhara Volam
2019-09-30 6:50 ` Jiri Pirko
2019-09-30 12:10 ` Andrew Lunn
2019-09-30 13:34 ` Jiri Pirko
2019-10-01 17:09 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).