nvme-fabrics: show well known discovery name
authorDaniel Wagner <dwagner@suse.de>
Tue, 21 Feb 2023 16:51:06 +0000 (17:51 +0100)
committerChristoph Hellwig <hch@lst.de>
Tue, 28 Feb 2023 13:14:44 +0000 (06:14 -0700)
commit26a57cb35548ae67c14871cccbf50da3edb01ea4
tree46eb6a61c4881c02d7f479d4c8eeb12d2692bcb1
parent76d54bf20cdcc1ed7569a89885e09636e9a8d71d
nvme-fabrics: show well known discovery name

The kernel always logs the unique subsystem name for a discovery
controller, even in the case user space asked for the well known.

This has lead to confusion as the logs of nvme-cli and the kernel
logs didn't match.

First, nvme-cli connects to the well known discovery controller to
figure out if it supports TP8013. If so then nvme-cli disconnects and
connects to the unique discovery controller. Currently, the kernel show
that user space connected twice to the unique one.

To avoid further confusion, show the well known discovery controller if
user space asked for it:

  $ nvme connect-all -v -t tcp -a 192.168.0.1
  nvme0: nqn.2014-08.org.nvmexpress.discovery connected
  nvme0: nqn.2014-08.org.nvmexpress.discovery disconnected
  nvme0: nqn.discovery connected

  kernel log:
  nvme nvme0: new ctrl: NQN "nqn.2014-08.org.nvmexpress.discovery", addr 192.168.0.1:8009
  nvme nvme0: Removing ctrl: NQN "nqn.2014-08.org.nvmexpress.discovery"
  nvme nvme0: new ctrl: NQN "nqn.discovery", addr 192.168.0.1:8009

Fixes: e5ea42faa773 ("nvme: display correct subsystem NQN")
Signed-off-by: Daniel Wagner <dwagner@suse.de>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/nvme/host/fabrics.h