Wen Xiong [Tue, 1 Mar 2022 21:32:18 +0000 (16:32 -0500)]
ioctl: Set lsp to action in nvme_get_log_persistent_event
Retrieving PEL fails because the lsp is set to NVME_LOG_LSP_NONE
instead of action:
# nvme -persistent-event-log -a 1 /dev/nvme0
NVMe status: Command Sequence Error: The command was aborted due to a protocol violation in a multi- command sequence(0xc)
Daniel Wagner [Tue, 1 Mar 2022 15:01:27 +0000 (16:01 +0100)]
tree: Ignore traddr case in nvme_lookup_ctrl()
Some FC discovery controllers return traddr strings with upper case
hexadecimal. There was is no requirement in the NVME-FC specification
that it be upper or lower case. Switch to strcasecmp for case
insentive traddr comparison.
Based on nvme-cli change 1264c6323937 ("nvme-cli: Make connect-all
matching be case insensitive")
Daniel Wagner [Tue, 1 Mar 2022 09:03:23 +0000 (10:03 +0100)]
fabrics: Do not swap bytes for system uuid
The kernel is taking care of swapping the system uuid bytes since f1d8e614d74b ("drivers/firmware/dmi_scan.c: check dmi version when get
system uuid"). Hence we should not swap them again. Instead just read
/sys/class/dmi/id/product_uuid and store the bytes directly into the
system_uuid buffer.
Daniel Wagner [Tue, 22 Feb 2022 15:06:52 +0000 (16:06 +0100)]
fabrics: add default port number for NVMe/TCP I/O controllers
As per section 7.4.9.3 "Transport Service Identifier" of the NVMe over
Fabrics 1.1 specification, the default IANA port number for a NVMe/TCP
discovery controller is 8009. But at the same time, it also clearly
states that NVMe/TCP I/O controllers should not use TCP port number
8009, but may instead use 4420 as the default here.
So make sure to fill these values appropriately, and pass it down.
Signed-off-by: Martin George <marting@netapp.com>
[dwagner: backport from monolithic branch] Signed-off-by: Daniel Wagner <dwagner@suse.de>
Martin Belanger [Thu, 17 Feb 2022 16:33:50 +0000 (17:33 +0100)]
types: Add Discovery Information Managment types
Add Discovery Information Management related types for TP8010.
Signed-off-by: Martin Belanger <martin.belanger@dell.com>
[dwagner: renaming, adding documation and reformating] Signed-off-by: Daniel Wagner <dwagner@suse.de>
Martin Belanger [Wed, 16 Feb 2022 15:11:05 +0000 (10:11 -0500)]
tree: Add cntrltype and dctype to the controller object
The Discovery Controller Type (dctype) is a new attribute defined
in TP8010. This new attribute, as well as the existing Controller
Type (cntrltype) attributes will now be exposed through the sysfs
starting with kernel 5.18. For older kernels, the cntrltype and
dctype must be retrieved by performing a Identify command.
Signed-off-by: Martin Belanger <martin.belanger@dell.com>
[dwagner: Removed nvme_fetch_cntrltype_dctype_from_id] Signed-off-by: Daniel Wagner <dwagner@suse.de>
Daniel Wagner [Thu, 17 Feb 2022 09:25:31 +0000 (10:25 +0100)]
log: Allow nvme_msg usage with invalid root pointer
24ac082f481d ("Add 'nvme_root_t' argument to nvme_msg()") and 19b12831a9ec ("Move global logging variables into nvme_root_t") moved
the logging controller knobs into the root object. In case the pointer
is invalid we should not try to use it. Instead just bailing out just
log the line.
Martin Belanger [Tue, 15 Feb 2022 20:54:38 +0000 (15:54 -0500)]
tree: Add host symbolic name
The host symbolic name was introduced in TP8010. It is used for
explicit registration with discovery controllers using the
discovery information management (DIM) command.x
Signed-off-by: Martin Belanger <martin.belanger@dell.com>
Daniel Wagner [Fri, 11 Feb 2022 12:45:57 +0000 (13:45 +0100)]
build: make Python memory allocations valgrind friendly
When testing with
meson test -C .build --wrap='valgrind --leak-check=full'
the Python binding will trigger 'Invalid read of size 4' warnings.
Tell Python to use malloc directly for all memory allocation which can
be properly traced by valgrind.
Daniel Wagner [Fri, 11 Feb 2022 12:20:14 +0000 (13:20 +0100)]
tree: Fix memleaks in __nvme_free_ns() and nvme_scan_subsystem()
valgrind reports that we are leaking memory in __nvme_free_ns() and
nvme_scan_subsystem(). Free ns->generic_name and path which makes
valgrind also happy.
Daniel Wagner [Mon, 7 Feb 2022 15:01:57 +0000 (16:01 +0100)]
build: Add kernel-doc CI build
We want to catching documentation failures early. Let's add a
dedicated documentation CI build. To keep build times low just
shortcut here and do not call meson to build the complete
documentation.
Daniel Wagner [Mon, 7 Feb 2022 14:31:24 +0000 (15:31 +0100)]
build: Make CI build fail on warnings
Currently, warnings are hidden in the logs and the build is marked as
succeeded. Mark all warnings as error so that we see them show up in
the review process.
Daniel Wagner [Thu, 3 Feb 2022 17:00:15 +0000 (18:00 +0100)]
doc: Mesonize documentation generation
Introduce a new config flag -Ddocs-build=true which controls if the
build system should generate documentation or not. If disabled but
-Ddocs=man is used then the pre compiled documentation will be
installed.
Furthmore, we are hooking up the sphinx tooling so that we generate
the HTML documentation ouf of the rst files.
Steven Seungcheol Lee [Mon, 17 Jan 2022 03:22:22 +0000 (12:22 +0900)]
ioctl: Add identify ioctl for CNS 09h, 0Ah
09h - Identify Namespace data structure for the specified
User Data Format index containing the namespace capabilities
for the NVM Command Set.
0Ah - I/O Command Set specific Identify Namespace data structure
for the specified User Data Format index containing
the namespace capabilities for the I/O Command Set
specified in the CSI field.
Signed-off-by: Steven Seungcheol Lee <sc108.lee@samsung.com>
Steven Seungcheol Lee [Mon, 17 Jan 2022 02:35:54 +0000 (11:35 +0900)]
ioctl: Modify identify command argument based on spec
CNS Specific identifier presents all names below for DWORD11 bits [15:00]
NVM Set Identifier(NVM Set List (04h))
Domain Identifier(Domain List (18h))
Endurance Group Identifier(Endurance Group List (19h))
Signed-off-by: Steven Seungcheol Lee <sc108.lee@samsung.com>