netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH iproute2-master] devlink: Fix monitor command
@ 2019-05-05 14:12 Ido Schimmel
  2019-05-05 16:19 ` Jiri Pirko
  2019-05-06 15:43 ` Stephen Hemminger
  0 siblings, 2 replies; 3+ messages in thread
From: Ido Schimmel @ 2019-05-05 14:12 UTC (permalink / raw)
  To: netdev; +Cc: stephen, jiri, mlxsw, Ido Schimmel

From: Ido Schimmel <idosch@mellanox.com>

The command is supposed to allow users to filter events related to
certain objects, but returns an error when an object is specified:

# devlink mon dev
Command "dev" not found

Fix this by allowing the command to process the specified objects.

Example:

# devlink/devlink mon dev &
# echo "10 1" > /sys/bus/netdevsim/new_device
[dev,new] netdevsim/netdevsim10

# devlink/devlink mon port &
# echo "11 1" > /sys/bus/netdevsim/new_device
[port,new] netdevsim/netdevsim11/0: type notset flavour physical
[port,new] netdevsim/netdevsim11/0: type eth netdev eth1 flavour physical

# devlink/devlink mon &
# echo "12 1" > /sys/bus/netdevsim/new_device
[dev,new] netdevsim/netdevsim12
[port,new] netdevsim/netdevsim12/0: type notset flavour physical
[port,new] netdevsim/netdevsim12/0: type eth netdev eth2 flavour physical

Fixes: a3c4b484a1ed ("add devlink tool")
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
---
 devlink/devlink.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/devlink/devlink.c b/devlink/devlink.c
index dc6e73fec20c..6a4ce58b9ee9 100644
--- a/devlink/devlink.c
+++ b/devlink/devlink.c
@@ -3858,12 +3858,8 @@ static int cmd_mon(struct dl *dl)
 	if (dl_argv_match(dl, "help")) {
 		cmd_mon_help();
 		return 0;
-	} else if (dl_no_arg(dl)) {
-		dl_arg_inc(dl);
-		return cmd_mon_show(dl);
 	}
-	pr_err("Command \"%s\" not found\n", dl_argv(dl));
-	return -ENOENT;
+	return cmd_mon_show(dl);
 }
 
 struct dpipe_field {
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-05-06 15:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-05-05 14:12 [PATCH iproute2-master] devlink: Fix monitor command Ido Schimmel
2019-05-05 16:19 ` Jiri Pirko
2019-05-06 15:43 ` Stephen Hemminger

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).