Thread (5 messages) 5 messages, 4 authors, 2021-12-21

Re: [PATCH] nvme-cli: nvmf-connect@.service: Remove matching from default syntax

From: James Smart <hidden>
Date: 2021-12-17 22:07:08

On 12/17/2021 12:43 PM, Martin Wilck wrote:
On Fri, 2021-12-17 at 11:32 -0800, James Smart wrote:
quoted
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.
Yes - I guess that is the definition of a referral. But there is no rule 
that state subsystems returned by a discovery controller must be behind 
the same transport target port (quite the contrary if one is not on fc).
So that's a rather larger restriction.
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.
I believe the devices are acting appropriately, and note, that is one 
particular implementation.

What is rudimentary is the linux implementation. Perhaps nvme-cli should 
be smarter about investigating, via sysfs, for the subsystem before 
initiating the connect request. It would need to look for subnqn and the 
target port address tuple data (more than just traddr, perhaps with 
per-transport rules).   Another thing to do is "lessen" the error 
notification. The corrects checks are in place in the kernel thus the 
messages, but perhaps we ought to make systemd less chatty by the style 
of error (or success) we return.

I'm ok with the matching argument - just not on by default. I also think 
this is yet another motivator for making transport/address/nqn vendor 
specific connect options table. This would allow us to turn on the 
option the vendor that was very verbose.
But as long as we haven't fixed this logic, I'm fine with your patch.

Martin
Thanks

-- james


Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help