KLZ-0 [Fri, 1 May 2020 19:22:40 +0000 (21:22 +0200)]
controller list argument is required in attach-ns/detach-ns commands
Empty controller-id list in the ioctl call for attach/detach of namespace results effectively in no operation, yet the nvme cli reports falsely success. The controller id list must be specified with at least 1 controller in the list.
Tomasz Kulasek [Fri, 20 Sep 2019 08:29:03 +0000 (10:29 +0200)]
remove block device checking for namespace
In SPDK project (see spdk.io) we have implemented the ability
to set up devices via CUSE device exposing controller and
namespaces as character devices.
Namespace devices are also exposed as character devices, so
nvme-cli tools will not recognize them as valid devices.
To allow to use nvme-cli tool with SPDK NVMe CUSE devices
we can't assume that namespaces are block devices.
Change-Id: I52aa79d24002b8dec10e6fdd0cb9a71bb6750358 Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
Yi Zhang [Fri, 1 May 2020 07:42:10 +0000 (15:42 +0800)]
nvme-print: nvme list -o json fix
Bellow error log will be triggered on non pcie transport, so only print the
ProductName for pcie transport, also add print "\n" and json_free_object fix
Failed to open /sys/class/nvme/nvme1/device/subsystem_vendor with errno No such file or directory
Failed to open /sys/class/nvme/nvme1/device/subsystem_device with errno No such file or directory
Failed to open /sys/class/nvme/nvme1/device/vendor with errno No such file or directory
Failed to open /sys/class/nvme/nvme1/device/device with errno No such file or directory
Failed to open /sys/class/nvme/nvme1/device/class with errno No such file or directory
{
"Devices" : [
{
"NameSpace" : 1,
"DevicePath" : "/dev/nvme1n1",
"Firmware" : "4.18.0-1",
"Index" : 1,
"ModelNumber" : "Linux",
"ProductName" : "NULL",
"SerialNumber" : "eb4695bf0da275a3",
"UsedBytes" : 268435456000,
"MaximumLBA" : 524288000,
"PhysicalSize" : 268435456000,
"SectorSize" : 512
}
]
}
Reported-by: Justin Tee <justin.tee@broadcom.com> Signed-off-by: Yi Zhang <yi.zhang@redhat.com> Signed-off-by: Keith Busch <kbusch@kernel.org>
Martin Wilck [Wed, 29 Apr 2020 17:03:57 +0000 (19:03 +0200)]
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.
nvme-topology.c: In function ‘verify_legacy_ns’:
nvme-topology.c:361:32: error: format not a string literal and no format arguments [-Werror=format-security]
361 | asprintf(&n->ctrl->address, tmp_address);
| ^~~~~~~~~~~
nvme-topology.c:360:4: error: ignoring return value of ‘asprintf’, declared with attribute warn_unused_result [-Werror=unused-result]
360 | asprintf(&n->ctrl->transport, "pcie");
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
nvme-topology.c:361:4: error: ignoring return value of ‘asprintf’, declared with attribute warn_unused_result [-Werror=unused-result]
361 | asprintf(&n->ctrl->address, tmp_address);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
make: *** [Makefile:96: nvme-topology.o] Error 1
This can be easily re produced on the gcc version :-
(Ubuntu 9.2.1-9ubuntu2) 9.2.1 20191008
fabrics: allow traddr to be host name for ip based transports
Some users would like to use well known hostnames instead of remembering
ip addresses. So, allow users to set traddr to be a host name and we will
attempt to resolve against a DNS.
This applies for IP based transports only (e.g. tcp, rdma) while fc and
loop will ignore this distinction.
Saar Gross [Wed, 8 Apr 2020 00:24:47 +0000 (17:24 -0700)]
nvme-print: fix offset calculation in NS ID Descriptor list
The offset for the next entry in the list is based on the length (len)
of the previous entry, but len is erroneously accumulated instead of
being set. This works fine for the first and second entry in the list
but will fail to reach the correct offset for the 3rd entry and beyond.
Sagi Grimberg [Tue, 24 Mar 2020 08:53:28 +0000 (01:53 -0700)]
nvmf: use discovery controller host identifiers for persistent controllers
It is possible that the user will create a persistent discovery controller
with a specific host identifiers (hostnqn and/or hostid). If we get a discovery
change log event on this discovery controller we need to use the same host
identifiers that otherwise we will may not see what the discovery change log
event intended us to see (as we connect with a different hostnqn for example).
Note that we take these identifiers only if they exist in sysfs which gives us
backward compatibility (as hostnqn and hostid are still new).
Sagi Grimberg [Tue, 24 Mar 2020 08:53:27 +0000 (01:53 -0700)]
nvme-print: list also hostnqn and hostid for verbose
Add it to the json output as the normal display is crowded enough as it is.
Note that we print them only if they exist in sysfs which gives us backward
compatibility (as hostnqn and hostid are still new).
Signed-off-by: Sagi Grimberg <sagi@grimberg.me> Signed-off-by: Keith Busch <kbusch@kernel.org>
Keith Busch [Tue, 31 Mar 2020 18:11:17 +0000 (03:11 +0900)]
suppress missing attribute warnings
Attribute existence is dependent on kernel versions. Don't automatically
warn if we fail to find the attribute, let the caller decide how to deal
with it.
Reported-by: Jeffrey Lien <Jeff.Lien@wdc.com> Signed-off-by: Keith Busch <kbusch@kernel.org>
Kevin Chau [Thu, 19 Sep 2019 01:22:35 +0000 (18:22 -0700)]
intel: Add enable-lat-stats function.
This adds the cli function for lat-stats-tracking. Enabling it allows
the drive to start tracking latency statistics during i/o.
Narasimhan V [Thu, 27 Feb 2020 10:31:37 +0000 (16:01 +0530)]
NVMe get features test fix
For One of the mandatory feature "Interrupt Vector Configuration",
the parameter cdw11 value should be equal to or less than the
number of interrupt vectors. Current implementaion uses the
IRQ number instead. This commit fixes it.
Signed-off-by: Narasimhan V <sim@linux.vnet.ibm.com>
Minwoo Im [Tue, 18 Feb 2020 06:55:00 +0000 (15:55 +0900)]
README: Fix include file location for plugin
If the CMD_INC_FILE is defined with file name without location, the
following error will happen.
In file included from plugins/foo/foo-nvme.h:17:0,
from plugins/foo/foo-nvme.c:4:
./define_cmd.h:12:34: fatal error: foo-nvme.h: No such file or directory
#include CMD_INCLUDE(CMD_INC_FILE)
^
Minwoo Im [Tue, 18 Feb 2020 06:52:08 +0000 (15:52 +0900)]
README: Include nvme.h in plugin template
The newly made plugin must have nvme.h file include, otherwise the
following errors will happen.
CC plugins/samsung/samsung-nvme.o
make: *** No rule to make target 'NVME-VERSION-FILE', needed by 'nvme'. Stop.
make: *** Waiting for unfinished jobs....
In file included from ./define_cmd.h:14:0,
from plugins/samsung/samsung-nvme.h:17,
from plugins/samsung/samsung-nvme.c:3:
./cmd_handler.h:75:2: error: ‘NULL’ undeclared here (not in a function)
NULL, \
^
./cmd_handler.h:79:28: note: in definition of macro ‘PLUGIN’
#define PLUGIN(name, cmds) cmds
^~~~
./plugins/samsung/samsung-nvme.h:11:5: note: in expansion of macro ‘COMMAND_LIST’
COMMAND_LIST(
^~~~~~~~~~~~
In file included from ./define_cmd.h:14:0,
from plugins/samsung/samsung-nvme.h:17,
from plugins/samsung/samsung-nvme.c:3:
./plugins/samsung/samsung-nvme.h: In function ‘init’:
./cmd_handler.h:105:2: error: implicit declaration of function ‘register_extension’ [-Werror=implicit-function-declaration]
register_extension(&plugin); \
^
./plugins/samsung/samsung-nvme.h:10:1: note: in expansion of macro ‘PLUGIN’
PLUGIN(NAME("samsung", "samsung"),
^~~~~~
cc1: all warnings being treated as errors
Makefile:92: recipe for target 'plugins/samsung/samsung-nvme.o' failed
make: *** [plugins/samsung/samsung-nvme.o] Error 1
Yi Zhang [Thu, 16 Jan 2020 07:56:58 +0000 (15:56 +0800)]
nvme-cli: memblaze: change to 100644 mode for memblaze-nvme.c
Bellow WARNING observed with rpmbuild -bb rpmbuild/SPECS/nvme-cli.spec
*** WARNING: plugins/memblaze/memblaze-nvme.c is executable but has
empty or no shebang, removing executable bit
Signed-off-by: Yi Zhang <yi.zhang@redhat.com> Signed-off-by: Keith Busch <kbusch@kernel.org>
Hannes Reinecke [Wed, 22 Jan 2020 07:45:18 +0000 (08:45 +0100)]
nvmf-autoconnect.service
Add a systemd service to automatically start 'nvme connect-all'
upon booting if an /etc/nvme/discovery.conf file exists.
The 'nvme-tcp' or 'nvme-rdma' modules need to be loaded earlier
by eg the modules-load service.
Jeff Lien [Tue, 7 Jan 2020 15:20:23 +0000 (09:20 -0600)]
[NVME-CLI] Add documentation file for vs-error-reason-identifier WDC
plugin command.
[NVME-CLI] Minor updates/corrections to the clear-fw-activate-history
and vs-fw-activate-history command help text.
Jeff Lien [Tue, 7 Jan 2020 15:16:09 +0000 (09:16 -0600)]
[NVME-CLI] Add support for WDC plugin command - vs-error-reason-identifier
[NVME-CLI] Reverse enable/disable bit on the vs-telemetry-controller-option
WDC plugin command