diff mbox series

[ethtool] cable-test: Fix premature process termination

Message ID 20211124121406.3330950-1-idosch@idosch.org (mailing list archive)
State Accepted
Commit c5e7133411601492ec0000dd4301ec9629f390a4
Delegated to: Michal Kubecek
Headers show
Series [ethtool] cable-test: Fix premature process termination | expand

Checks

Context Check Description
netdev/tree_selection success Not a local patch

Commit Message

Ido Schimmel Nov. 24, 2021, 12:14 p.m. UTC
From: Ido Schimmel <idosch@nvidia.com>

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 <andrew@lunn.ch>
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
---
 netlink/cable_test.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

patchwork-bot+netdevbpf@kernel.org Dec. 2, 2021, 9:40 p.m. UTC | #1
Hello:

This patch was applied to ethtool/ethtool.git (master)
by Michal Kubecek <mkubecek@suse.cz>:

On Wed, 24 Nov 2021 14:14:06 +0200 you wrote:
> From: Ido Schimmel <idosch@nvidia.com>
> 
> 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.
> 
> [...]

Here is the summary with links:
  - [ethtool] cable-test: Fix premature process termination
    https://git.kernel.org/pub/scm/network/ethtool/ethtool.git/commit/?id=c5e713341160

You are awesome, thank you!
diff mbox series

Patch

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;