]> www.infradead.org Git - users/hch/nvme-cli.git/commit
connect-all: add -m/--matching option
authorMartin Wilck <mwilck@suse.com>
Wed, 29 Apr 2020 17:03:57 +0000 (19:03 +0200)
committerKeith Busch <kbusch@kernel.org>
Thu, 30 Apr 2020 18:13:30 +0000 (12:13 -0600)
commita58556cc3022ec443f0db4a5218d8e2bfb3be481
tree66dcd1762310eb2f53f93d57f113a163da08d9fa
parent5c694eb1342336c0aa034a5ff8fe0bc74105c273
connect-all: add -m/--matching option

Discovery controllers often return discovery records that belong
to a different traddr than the discovery controller itself, like here:

nvme discover -t fc \
   --host-traddr=nn-0x20000090fae06325:pn-0x10000090fae06325 \
   --traddr=nn-0x200900a09890f5bf:pn-0x200a00a09890f5bf

Discovery Log Number of Records 2, Generation counter 25
=====Discovery Log Entry 0======
trtype:  fc
adrfam:  fibre-channel
subtype: nvme subsystem
treq:    not specified
portid:  0
trsvcid: none
subnqn:  nqn...
traddr:  nn-0x200900a09890f5bf:pn-0x200b00a09890f5bf
=====Discovery Log Entry 1======
trtype:  fc
adrfam:  fibre-channel
subtype: nvme subsystem
treq:    not specified
portid:  1
trsvcid: none
subnqn:  nqn...
traddr:  nn-0x200900a09890f5bf:pn-0x200a00a09890f5bf

Note that the traddr of record 0 matches the traddr used for the
discovery, while that of record 1 does not.

For NVMeoF-autoconnect, this means that connection attempts will
be made multiple times (the two records above will also be returned
for a discovery on nn-0x200900a09890f5bf:pn-0x200b00a09890f5bf),
which is unnecessary and leads to lots of confusing error messages
in the system log.

Add an option "-m / --matching" to the "nvme connect-all" command
that causes nvme to connect only those discovery entries that match
the traddr given on the command line.
fabrics.c