* [PATCH iproute2-next] devlink: fix requiring either handle
@ 2019-11-20 17:56 Jakub Kicinski
2019-11-21 8:56 ` Jiri Pirko
2019-11-21 21:39 ` David Ahern
0 siblings, 2 replies; 3+ messages in thread
From: Jakub Kicinski @ 2019-11-20 17:56 UTC (permalink / raw)
To: dsahern
Cc: stephen, netdev, oss-drivers, jiri, Jakub Kicinski, Shalom Toledo,
Quentin Monnet
devlink sb occupancy show requires device or port handle.
It passes both device and port handle bits as required to
dl_argv_parse() so since commit 1896b100af46 ("devlink: catch
missing strings in dl_args_required") devlink will now
complain that only one is present:
$ devlink sb occupancy show pci/0000:06:00.0/0
BUG: unknown argument required but not found
Drop the bit for the handle which was not found from required.
Reported-by: Shalom Toledo <shalomt@mellanox.com>
Fixes: 1896b100af46 ("devlink: catch missing strings in dl_args_required")
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Reviewed-by: Quentin Monnet <quentin.monnet@netronome.com>
Tested-by: Shalom Toledo <shalomt@mellanox.com>
---
devlink/devlink.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/devlink/devlink.c b/devlink/devlink.c
index ea3f992ee0d7..0b8985f32636 100644
--- a/devlink/devlink.c
+++ b/devlink/devlink.c
@@ -1179,6 +1179,7 @@ static int dl_argv_parse(struct dl *dl, uint64_t o_required,
&opts->port_index, &handle_bit);
if (err)
return err;
+ o_required &= ~(DL_OPT_HANDLE | DL_OPT_HANDLEP) | handle_bit;
o_found |= handle_bit;
} else if (o_required & DL_OPT_HANDLE) {
err = dl_argv_handle(dl, &opts->bus_name, &opts->dev_name);
--
2.23.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH iproute2-next] devlink: fix requiring either handle
2019-11-20 17:56 [PATCH iproute2-next] devlink: fix requiring either handle Jakub Kicinski
@ 2019-11-21 8:56 ` Jiri Pirko
2019-11-21 21:39 ` David Ahern
1 sibling, 0 replies; 3+ messages in thread
From: Jiri Pirko @ 2019-11-21 8:56 UTC (permalink / raw)
To: Jakub Kicinski
Cc: dsahern, stephen, netdev, oss-drivers, Shalom Toledo,
Quentin Monnet
Wed, Nov 20, 2019 at 06:56:06PM CET, jakub.kicinski@netronome.com wrote:
>devlink sb occupancy show requires device or port handle.
>It passes both device and port handle bits as required to
>dl_argv_parse() so since commit 1896b100af46 ("devlink: catch
>missing strings in dl_args_required") devlink will now
>complain that only one is present:
>
>$ devlink sb occupancy show pci/0000:06:00.0/0
>BUG: unknown argument required but not found
>
>Drop the bit for the handle which was not found from required.
>
>Reported-by: Shalom Toledo <shalomt@mellanox.com>
>Fixes: 1896b100af46 ("devlink: catch missing strings in dl_args_required")
>Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
>Reviewed-by: Quentin Monnet <quentin.monnet@netronome.com>
>Tested-by: Shalom Toledo <shalomt@mellanox.com>
Acked-by: Jiri Pirko <jiri@mellanox.com>
Thanks!
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH iproute2-next] devlink: fix requiring either handle
2019-11-20 17:56 [PATCH iproute2-next] devlink: fix requiring either handle Jakub Kicinski
2019-11-21 8:56 ` Jiri Pirko
@ 2019-11-21 21:39 ` David Ahern
1 sibling, 0 replies; 3+ messages in thread
From: David Ahern @ 2019-11-21 21:39 UTC (permalink / raw)
To: Jakub Kicinski
Cc: stephen, netdev, oss-drivers, jiri, Shalom Toledo, Quentin Monnet
On 11/20/19 10:56 AM, Jakub Kicinski wrote:
> devlink sb occupancy show requires device or port handle.
> It passes both device and port handle bits as required to
> dl_argv_parse() so since commit 1896b100af46 ("devlink: catch
> missing strings in dl_args_required") devlink will now
> complain that only one is present:
>
> $ devlink sb occupancy show pci/0000:06:00.0/0
> BUG: unknown argument required but not found
>
> Drop the bit for the handle which was not found from required.
>
> Reported-by: Shalom Toledo <shalomt@mellanox.com>
> Fixes: 1896b100af46 ("devlink: catch missing strings in dl_args_required")
> Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
> Reviewed-by: Quentin Monnet <quentin.monnet@netronome.com>
> Tested-by: Shalom Toledo <shalomt@mellanox.com>
> ---
> devlink/devlink.c | 1 +
> 1 file changed, 1 insertion(+)
applied to iproute2-next. Thanks
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-11-21 21:39 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-11-20 17:56 [PATCH iproute2-next] devlink: fix requiring either handle Jakub Kicinski
2019-11-21 8:56 ` Jiri Pirko
2019-11-21 21:39 ` David Ahern
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).