Steven Seungcheol Lee [Thu, 9 Dec 2021 11:34:24 +0000 (20:34 +0900)]
util/json: fix build error of json_object_add_value_uint64 #1260
util/json used when system does not have json-c library
json_object_add_value_uint handled with unsigned long long (64bits)
That's why json_object_add_value_uint64 is redefined with it
Signed-off-by: Steven Seungcheol Lee <sc108.lee@samsung.com>
Daniel Wagner [Thu, 9 Dec 2021 12:48:30 +0000 (13:48 +0100)]
plugins: Force types for isalnum and isblank
The two users of isalnum and isblank hand in unsigned char and not
int as expected by the API. This triggers thye type checker in the
debug build, e.g.
../subprojects/libnvme/ccan/ccan/build_assert/build_assert.h:38:22: error: size of unnamed array is negative
38 | (sizeof(char [1 - 2*!(cond)]) - 1)
| ^
../ccan/ccan/str/str.h:189:16: note: in expansion of macro ‘BUILD_ASSERT_OR_ZERO’
189 | ((i) + BUILD_ASSERT_OR_ZERO(!__builtin_types_compatible_p(typeof(i), \
| ^~~~~~~~~~~~~~~~~~~~
../ccan/ccan/str/str.h:196:32: note: in expansion of macro ‘str_check_arg_’
196 | #define isalnum(i) str_isalnum(str_check_arg_(i))
| ^~~~~~~~~~~~~~
../plugins/memblaze/memblaze-nvme.c:410:13: note: in expansion of macro ‘isalnum’
410 | if (isalnum(*c) == 0) {
| ^~~~~~~
Brandon Paupore [Thu, 2 Dec 2021 21:40:39 +0000 (15:40 -0600)]
Use unique names for VULs, also return 0 on success
Previously nvme_log_id_to_string returned "WDC Vendor Unique Log ID" if
it was any vendor unique log ID. This causes problems when requesting
JSON output, as only the final vendor unique log ID would be shown.
Instead, append the log id to the string making each unique.
Also, wdc_log_page_directory previously returned whatever the
output_format was. Instead return 0 if the format was valid.
nvme-check-dhchap-key, nvme-gen-dhchap-key the line of === under title
need to be written same length as title
-> fix [asciidoc: FAILED: manpage document title is mandatory]
nvme-connect-all, nvme-connect, nvme-discover new options are added
Signed-off-by: Steven Seungcheol Lee <sc108.lee@samsung.com>
Hannes Reinecke [Tue, 23 Nov 2021 07:19:20 +0000 (08:19 +0100)]
fabrics: do not print 'unrecognized' address family for loop
fabrics implementations like 'loop' do not have a transport address,
and consequently the address family value doesn't make any sense here.
So do not try to translate the address family to a printable string
if the address itself is empty.
Daniel Wagner [Thu, 18 Nov 2021 09:40:59 +0000 (10:40 +0100)]
build: Don't use external script to set version
The meson documentation points out the the version string should be a
fixed string. Our trick with trying to figure out the version is not
working in all cases, e.g. 'meson dist' will create a wrong file name.
The idea is to update the version string when a new development cycle
starts and mark the release with a tag. This is what other projects
do as well. Let's follow their common practice.
Daniel Wagner [Fri, 12 Nov 2021 15:29:20 +0000 (16:29 +0100)]
scripts: Replace gen-hostnqn workaround with 'nvme gen-hostnqn'
The script was introduced to workaround the short commings 'nvme
gen-hostnqn'. In the meantime these have been address. Instead
removing the script completly keep it around for backwards
compatibiliy and just use 'nvme gen-hostnqn'.
Install additional files such as dracut, systemd and udev scipts.
Also add support for building and installing documentation.
Introduce a build option '-Ddocs=[all,man,html]' which builds (if
asciidoctor is availalbe) and installs the docs.
meson doesn't support pre compiled sources updated in the source
tree. This is a design decision. That means the man pages
(Documentation/*.1) and the html pages (Documentation/*.html) can't be
updated so easily as with Makefile.
The workaround provide a shell script which updates the in tree
pre compiled documentation
Hannes Reinecke [Tue, 16 Nov 2021 13:57:05 +0000 (14:57 +0100)]
fabrics: call nvme_ctrl_set_discovery_ctrl()
When creating a discovery connection the user might be using the
unique discovery NQN, so we should be calling nvme_ctrl_set_discovery_ctrl()
to mark the connection as a discovery connection.
Hannes Reinecke [Mon, 15 Nov 2021 11:29:23 +0000 (12:29 +0100)]
nvme: document 'config-file' commandline option
The 'config-file' commandline option is not documented in the
man pages. And we should reference the config file as a 'ghost'
file in the rpm spec to ensure it gets removed together with the
nvme-cli package.
Hannes Reinecke [Wed, 17 Nov 2021 10:00:04 +0000 (11:00 +0100)]
Compability for older json-c releases
commit 0b63a8b7cfb7 ("Check json-c libversion, recover commit d127537")
broke building on older releases when using 'make'.
As the original issue was about json-c not being able to parse full 64
numbers this patch separates out 32 and 64 json objects and adds a warning
if an overflow occurs on older json-c releases.
Daniel Wagner [Tue, 16 Nov 2021 21:25:45 +0000 (22:25 +0100)]
build: Update json-c dependencies
With commit 0b63a8b7cfb7 ("Check json-c libversion, recover commit d127537") with increased the minimum version of json-c. Let's update
the meson wrapper.
While at it also update the min version in meson.build to 0.14.
Jeff Lien [Wed, 29 Sep 2021 14:50:47 +0000 (09:50 -0500)]
ZNS report zones command fix for large number of zones When there are a large number of zones, the buffer required to contain the data becomes extremely large and the linux os is unable to handle that on all systems. This change will break up the transfer of the zone data into smaller chunks - 1024 zone entries at a time and 64k bytes total.
Signed-off-by: Jeff Lien <jeff.lien@wdc.com>
[dwagner: ported from nvme-cli-monolithic] Signed-off-by: Daniel Wagner <wagner@suse.de>
Minwoo Im [Sat, 18 Sep 2021 01:17:15 +0000 (10:17 +0900)]
nvme-print: print generic ns chardev in verbose mode
Generic device (e.g., /dev/ng0n1) is mapped to a block device (e.g.,
/dev/nvme0n1). This chardev can be taken in case that block device is
failed to initialize from the kernel due to some reasons (e.g.,
metadata initialization failed). This generic node information can be
shown in the verbose list mode with HIDDEN block device (nvme0n1 in the
below example).
root@localhost:~# nvme list -v
NVM Express Subsystems
Device Generic NSID Usage Format Controllers
------------ ------------ -------- -------------------------- ---------------- ----------------
nvme0n1 ng0n1 1 0.00 B / 0.00 B 1 B + 0 B nvme0
nvme0n2 ng0n2 2 268.44 MB / 268.44 MB 4 KiB + 0 B nvme0
The nvme0n1 is failed to initialize and it shows 0.00 B size which is
invalid. In this case, we can take /dev/ng0n1 alternatively from the
application through generic I/O path.
Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>
[dwagner: - ported from nvme-cli-monolithic
- fixed indention] Signed-off-by: Daniel Wagner <dwagner@suse.de>
add identify endurance group list (cns 0x19) support
Signed-off-by: Gollu Appalanaidu <anaidu.gollu@samsung.com>
[dwagner: ported from monolitic, removed nvme-ioctl.h/nvme.h change,
part of libnvme] Signed-off-by: Daniel Wagner <dwagner@suse.de>
Steven Seungcheol Lee [Mon, 6 Sep 2021 11:01:15 +0000 (20:01 +0900)]
zns: fix(Add missing fields rrl, frl, lbafe)
Based on NVMe-Zoned-Namespace-Command-Set-Specification-1.1a-2021.07.26-Ratified
Signed-off-by: Steven Seungcheol Lee <sc108.lee@samsung.com>
[dwagmer: dropped nvme.h changes, part of libnvme] Signed-off-by: Daniel Wagner <dwagner@suse.de>
Brandon Paupore [Thu, 12 Aug 2021 18:47:51 +0000 (13:47 -0500)]
Enable telemetry data area 4 in base and plugin
Signed-off-by: Brandon Paupore <brandon.paupore@wdc.com>
[dwagner: - ported from monolithic, nvme.h changes,
part of libnvme
- merged in da30c629f0f4 ("Add function to get specific
feature buffer lengths")] Signed-off-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: Gollu Appalanaidu <anaidu.gollu@samsung.com>
[dwagner: ported from monolithic, droped nvme-ioctl changes,
part of libnvme] Signed-off-by: Daniel Wagner <dwagner@suse.de>
Gollu Appalanaidu [Sun, 22 Aug 2021 17:55:03 +0000 (23:25 +0530)]
nvme: add support for fid supported and effects log(lid = 0x12)
Signed-off-by: Gollu Appalanaidu <anaidu.gollu@samsung.com>
[dwagner: ported from monolithic, droped nvme-ioctl changes,
part of libnvme] Signed-off-by: Daniel Wagner <dwagner@suse.de>
Gollu Appalanaidu [Fri, 13 Aug 2021 16:54:00 +0000 (22:24 +0530)]
nvme: add boot partition log support
Signed-off-by: Gollu Appalanaidu <anaidu.gollu@samsung.com>
[dwagner: ported from monolithic, droped nvme-ioctl changes,
part of libnvme] Signed-off-by: Daniel Wagner <dwagner@suse.de>
Steven Seungcheol Lee [Wed, 25 Aug 2021 08:24:02 +0000 (17:24 +0900)]
nvme: Add Identify for CNS 08h NVMe spec 2.0a based
I/O Command Set Independent Identify Namespace data structure (CNS
08h) Most of data comes from existing data of id-ns which is common
from All I/O command set
Signed-off-by: Steven Seungcheol Lee <sc108.lee@samsung.com>
[dwagner: ported from monolitic branch and updated context] Signed-off-by: Daniel Wagner <dwagner@suse.de>
Gollu Appalanaidu [Wed, 25 Aug 2021 17:32:17 +0000 (23:02 +0530)]
nvme: add spinup control feature (fid=0x1A)
Signed-off-by: Gollu Appalanaidu <anaidu.gollu@samsung.com>
[dwagner: ported from monolitic, removed nvme.h change, part of
libnvme]
qiSigned-off-by: Daniel Wagner <dwagner@suse.de>
Steven Seungcheol Lee [Thu, 26 Aug 2021 03:06:11 +0000 (12:06 +0900)]
nvme: PEL need to check gen number for verification of collected log
If the Persistent Event Log is not read with a single Get Log Page
command, then host software should read the Generation Number field in
the Persistent Event Log header after establishing a reporting context
but before reading the remainder of the log and then re-read the
Generation Number field after it has read the entire log.
If the generation numbers do not match, then:
- the reporting context may have been lost while reading the log;
- the Persistent Event Log contents read may be invalid; and
- host software should re-read the log.
While at it, fix bug (unallocated pointer free)
Signed-off-by: Steven Seungcheol Lee <sc108.lee@samsung.com>
[dwagner: ported from monolitic branch and updated context] Signed-off-by: Daniel Wagner <dwagner@suse.de>
Steven Seungcheol Lee [Thu, 26 Aug 2021 01:53:24 +0000 (10:53 +0900)]
Add New fields on PEL based on NVMe 2.0a
Persistent Event Log header got new fields below
[373:372] Generation Number
[377:374] Reporting Context Information (RCI)
Signed-off-by: Steven Seungcheol Lee <sc108.lee@samsung.com>
[dwagner: removed nvme-ioct.c changes, part of libnvme] Signed-off-by: Daniel Wagner <dwagner@suse.de>