[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20211124121406.3330950-1-idosch@idosch.org>
Date: Wed, 24 Nov 2021 14:14:06 +0200
From: Ido Schimmel <idosch@...sch.org>
To: netdev@...r.kernel.org
Cc: mkubecek@...e.cz, andrew@...n.ch, mlxsw@...dia.com,
Ido Schimmel <idosch@...dia.com>
Subject: [PATCH ethtool] cable-test: Fix premature process termination
From: Ido Schimmel <idosch@...dia.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@...n.ch>
Signed-off-by: Ido Schimmel <idosch@...dia.com>
---
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;
--
2.31.1
Powered by blists - more mailing lists