From patchwork Wed Nov 24 12:14:06 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ido Schimmel X-Patchwork-Id: 12636731 X-Patchwork-Delegate: mkubecek+ethtool@suse.cz Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B27D4C433F5 for ; Wed, 24 Nov 2021 12:16:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242370AbhKXMTW (ORCPT ); Wed, 24 Nov 2021 07:19:22 -0500 Received: from out4-smtp.messagingengine.com ([66.111.4.28]:37767 "EHLO out4-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243066AbhKXMRc (ORCPT ); Wed, 24 Nov 2021 07:17:32 -0500 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 2EA1C5C009F; Wed, 24 Nov 2021 07:14:22 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Wed, 24 Nov 2021 07:14:22 -0500 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=fm1; bh=Vk1NIusawVeGtXkYl 1sbngtRrfsptzyA6ZVWDvbEnqo=; b=CkBGLrbx9VdOGNqnjJmTMTg/EWT07Re9O k6XZEcyFyrB6v5lFrYXCtH8pNiB8622FK+GAME5fVNtm6eKi5/EOmxxg86kCSQbs ikQhHp9G2Nv/wyfKxJtuFsX/oegPERq0iDAWuc/6V/S3R96TTv9y3YS9x5mUL58k xIajUNgue6XpYJ45qoCbtZNLwD2gJTxg6/ICBZMAuJ/OaPcCgWgLqmY3uJqegDm8 f+ZpLh+xz0bz/0XlPHFAfbgU6yq3aA6Y0ZcBmtUQWti/3j1wZJv30B5E9tYLhm0L 9PVmMmod93Yh+/WXu/SAQiJFFrmxDLzVJku5sX7rN05OYhw/lbQjw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvuddrgeekgdeflecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhephffvufffkffoggfgsedtkeertdertd dtnecuhfhrohhmpefkughoucfutghhihhmmhgvlhcuoehiughoshgthhesihguohhstghh rdhorhhgqeenucggtffrrghtthgvrhhnpeetveeghfevgffgffekueffuedvhfeuheehte ffieekgeehveefvdegledvffduhfenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgr mhepmhgrihhlfhhrohhmpehiughoshgthhesihguohhstghhrdhorhhg X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 24 Nov 2021 07:14:20 -0500 (EST) From: Ido Schimmel To: netdev@vger.kernel.org Cc: mkubecek@suse.cz, andrew@lunn.ch, mlxsw@nvidia.com, Ido Schimmel Subject: [PATCH ethtool] cable-test: Fix premature process termination Date: Wed, 24 Nov 2021 14:14:06 +0200 Message-Id: <20211124121406.3330950-1-idosch@idosch.org> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: mkubecek+ethtool@suse.cz From: Ido Schimmel Unlike other ethtool operations, cable testing is asynchronous which allows several cables to be tested simultaneously. This is done by ethtool instructing the kernel to start the cable testing and listening to multicast notifications regarding its progress. The ethtool process terminates after receiving a notification about the completion of the test. Currently, ethtool processes all the cable test notifications, regardless of the reported device. This means that an ethtool process started for one device can terminate prematurely if completion was reported for a different device. Fix by ignoring notifications for devices other than the device for which the test was started. Fixes: 55f5e9aa3281 ("Add cable test support") Fixes: 9561db9b76f4 ("Add cable test TDR support") Reviewed-by: Andrew Lunn Signed-off-by: Ido Schimmel --- netlink/cable_test.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/netlink/cable_test.c b/netlink/cable_test.c index 17139f7d297d..9305a4763c5b 100644 --- a/netlink/cable_test.c +++ b/netlink/cable_test.c @@ -225,6 +225,7 @@ static int nl_cable_test_process_results(struct cmd_context *ctx) nlctx->is_monitor = true; nlsk->port = 0; nlsk->seq = 0; + nlctx->filter_devname = ctx->devname; ctctx.breakout = false; nlctx->cmd_private = &ctctx; @@ -496,6 +497,7 @@ static int nl_cable_test_tdr_process_results(struct cmd_context *ctx) nlctx->is_monitor = true; nlsk->port = 0; nlsk->seq = 0; + nlctx->filter_devname = ctx->devname; ctctx.breakout = false; nlctx->cmd_private = &ctctx;