All of lore.kernel.org
 help / color / mirror / Atom feed
From: Martin Wilck <mwilck@suse.com>
To: James Smart <jsmart2021@gmail.com>, linux-nvme@lists.infradead.org
Subject: Re: [PATCH] nvme-cli: nvmf-connect@.service: Remove matching from default syntax
Date: Fri, 17 Dec 2021 21:43:55 +0100	[thread overview]
Message-ID: <b7bf62931bd6d45128595646a7eb637a89d216aa.camel@suse.com> (raw)
In-Reply-To: <20211217193232.29034-1-jsmart2021@gmail.com>

On Fri, 2021-12-17 at 11:32 -0800, James Smart wrote:
> commit 53aab69a0add added the "--matching" argument to the systemd
> connect script that issues connect-all to a discovery controller.
> When
> this argument is used, only discovery log entries whose target port
> traddr's match the traddr of the discovery controller will be
> connected
> to.  This eliminates the ability to do referrals by the discovery
> controller.
> 
> Revert the commit so that the "--matching" argument is not default
> behavior.

Hm, I guess you have to do revert this if it breaks referrals.

The intention of my patch was not to suppress referrals. Unless I'm
mistaken, a referral is a log page entry that lists another discovery
controller, on which then another discovery is carried out. The "--
matching" parameter was intended to ignore log page entries listing
ordinary (non-discovery) subsystems on if their traddr didn't match the
discovery controller's traddr.

I still think connecting to those entries is wrong more often than not.
In the environment I was testing in back then, IIRC there were 4
discovery controllers, each listing every subsystem on every
controller. The host would try to connect to every subsystem 4 times,
resulting in error messages 3 out of 4 times. With --matching, these
errors could be avoided.

I believe the correct solution would be to fix the way referrals are
handled with --matching. If a discovery subsystem D1 refers to another
discovery subsystem D2, then on D2 those entries that match the traddr
of D2 should be considered "matching", and so on with additional
referrals. Obviously, "--matching" would need to be ignored for the
referral entries themselves.

But as long as we haven't fixed this logic, I'm fine with your patch.

Martin

> 
> Signed-off-by: James Smart <jsmart2021@gmail.com>
> CC: Martin Wilck <mwilck@suse.com>
> ---
>  nvmf-autoconnect/systemd/nvmf-connect@.service | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/nvmf-autoconnect/systemd/nvmf-connect@.service b/nvmf-
> autoconnect/systemd/nvmf-connect@.service
> index 5fbf081..c60f146 100644
> --- a/nvmf-autoconnect/systemd/nvmf-connect@.service
> +++ b/nvmf-autoconnect/systemd/nvmf-connect@.service
> @@ -11,4 +11,4 @@ Requires=nvmf-connect.target
>  [Service]
>  Type=simple
>  Environment="CONNECT_ARGS=%i"
> -ExecStart=/bin/sh -c "nvme connect-all --matching --quiet `/bin/echo
> -e '${CONNECT_ARGS}'`"
> +ExecStart=/bin/sh -c "nvme connect-all --quiet `/bin/echo -e
> '${CONNECT_ARGS}'`"



  reply	other threads:[~2021-12-17 20:44 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-17 19:32 [PATCH] nvme-cli: nvmf-connect@.service: Remove matching from default syntax James Smart
2021-12-17 20:43 ` Martin Wilck [this message]
2021-12-17 22:06   ` James Smart
2021-12-20 13:22   ` Hannes Reinecke
2021-12-21 13:02 ` Daniel Wagner

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=b7bf62931bd6d45128595646a7eb637a89d216aa.camel@suse.com \
    --to=mwilck@suse.com \
    --cc=jsmart2021@gmail.com \
    --cc=linux-nvme@lists.infradead.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.