netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ido Schimmel <idosch@idosch.org>
To: Andrew Lunn <andrew@lunn.ch>
Cc: Michal Kubecek <mkubecek@suse.cz>,
	netdev <netdev@vger.kernel.org>, Chris Healy <cphealy@gmail.com>
Subject: Re: [ethtool v5 2/6] Add cable test TDR support
Date: Mon, 22 Nov 2021 20:51:56 +0200	[thread overview]
Message-ID: <YZvmzIVHP8nReWJC@shredder> (raw)
In-Reply-To: <20200705175452.886377-3-andrew@lunn.ch>

On Sun, Jul 05, 2020 at 07:54:48PM +0200, Andrew Lunn wrote:
> +/* Receive the broadcasted messages until we get the cable test
> + * results
> + */
> +static int nl_cable_test_tdr_process_results(struct cmd_context *ctx)
> +{
> +	struct nl_context *nlctx = ctx->nlctx;
> +	struct nl_socket *nlsk = nlctx->ethnl_socket;
> +	struct cable_test_context ctctx;
> +	int err;
> +
> +	nlctx->is_monitor = true;
> +	nlsk->port = 0;
> +	nlsk->seq = 0;

Andrew, is this missing the following 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;

I don't have hardware with cable test support so wondered if you could
test it. I think that without this patch you would see problems with two
simultaneous cable tests. The first one to finish will terminate both
ethtool processes because the code is processing all cable tests
notifications regardless of the device for which the test was issued.

Context: I'm using a similar scheme for transceiver module firmware
update in order to support simultaneous update of several modules.

> +
> +	ctctx.breakout = false;
> +	nlctx->cmd_private = &ctctx;
> +
> +	while (!ctctx.breakout) {
> +		err = nlsock_process_reply(nlsk, nl_cable_test_tdr_results_cb,
> +					   nlctx);
> +		if (err)
> +			return err;
> +	}
> +
> +	return err;
> +}

  reply	other threads:[~2021-11-22 18:52 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-05 17:54 [PATCH ethtool v5 0/6] ethtool(1) cable test support Andrew Lunn
2020-07-05 17:54 ` [ethtool v5 1/6] Add " Andrew Lunn
2020-07-05 17:54 ` [ethtool v5 2/6] Add cable test TDR support Andrew Lunn
2021-11-22 18:51   ` Ido Schimmel [this message]
2021-11-23 21:17     ` Andrew Lunn
2020-07-05 17:54 ` [ethtool v5 3/6] json_writer/json_print: Import the iproute2 helper code for JSON output Andrew Lunn
2020-07-05 17:54 ` [ethtool v5 4/6] Add --json command line argument parsing Andrew Lunn
2020-07-05 17:54 ` [ethtool v5 5/6] ethtool.8.in: Document the cable test commands Andrew Lunn
2020-07-05 17:54 ` [ethtool v5 6/6] ethtool.8.in: Add --json option Andrew Lunn
2020-07-05 22:54 ` [PATCH ethtool v5 0/6] ethtool(1) cable test support Michal Kubecek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YZvmzIVHP8nReWJC@shredder \
    --to=idosch@idosch.org \
    --cc=andrew@lunn.ch \
    --cc=cphealy@gmail.com \
    --cc=mkubecek@suse.cz \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).