From patchwork Sun May 5 14:12:43 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ido Schimmel X-Patchwork-Id: 1095454 X-Patchwork-Delegate: shemminger@vyatta.com Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=idosch.org Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="cwgCVYOg"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 44xnrz1S6Sz9s3l for ; Mon, 6 May 2019 00:13:07 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727647AbfEEONC (ORCPT ); Sun, 5 May 2019 10:13:02 -0400 Received: from out4-smtp.messagingengine.com ([66.111.4.28]:38339 "EHLO out4-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726965AbfEEONC (ORCPT ); Sun, 5 May 2019 10:13:02 -0400 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id A0E1820EB0; Sun, 5 May 2019 10:13:01 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Sun, 05 May 2019 10:13:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :message-id:mime-version:subject:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=WG0/d3GOaBcpCO2xB UGXgu3XyBD/3FCJFZwhkkWD36M=; b=cwgCVYOg01pZOQV9rZE8As0sTXycrcKOR 4BHT0imOtigeE4mKjWoEW3dplSvvTiQMRta6pJ2yEwR7LfvJRvJcnRY08HHRDgUg KgTlndXJgWCsZ/v+7iNOom1MRNCGU2lB/VSG2KfnvAQuB7EGARTUFLklgqh38E7m xfs1oFJlKNwneM7ZgW7m4GKLl4PCGbHKPL2LqUYPgZp34ZSGkKqQuuJy+TKbHel0 2zpw1gYTACEuLRq7kV4Y96v534wHsV5jIg+gMdFFkFz3IwCz6Q6Q2ZtipbFCSyZY V4tOG6aqEQYSSoSQ3pRw7s0Mj5H/uCE65I8wNQZulimteKRhs6gDg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduuddrjeehgdektdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhephffvufffkffoggfgsedtkeertdertd dtnecuhfhrohhmpefkughoucfutghhihhmmhgvlhcuoehiughoshgthhesihguohhstghh rdhorhhgqeenucfkphepudelfedrgeejrdduieehrddvhedunecurfgrrhgrmhepmhgrih hlfhhrohhmpehiughoshgthhesihguohhstghhrdhorhhgnecuvehluhhsthgvrhfuihii vgeptd X-ME-Proxy: Received: from splinter.mtl.com (unknown [193.47.165.251]) by mail.messagingengine.com (Postfix) with ESMTPA id F0B98103C8; Sun, 5 May 2019 10:12:59 -0400 (EDT) From: Ido Schimmel To: netdev@vger.kernel.org Cc: stephen@networkplumber.org, jiri@mellanox.com, mlxsw@mellanox.com, Ido Schimmel Subject: [PATCH iproute2-master] devlink: Fix monitor command Date: Sun, 5 May 2019 17:12:43 +0300 Message-Id: <20190505141243.9768-1-idosch@idosch.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Ido Schimmel 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 Acked-by: Jiri Pirko --- 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 {