From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.0 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5167DC004C9 for ; Sun, 5 May 2019 14:13:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1A42A206DF for ; Sun, 5 May 2019 14:13:04 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="cwgCVYOg" 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 Content-Transfer-Encoding: 8bit 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 --- 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