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>
Steven Seungcheol Lee [Mon, 2 Aug 2021 07:00:35 +0000 (16:00 +0900)]
Bug fix unsigned int and int should use 64bit api for json-c
unsigned int should use json_object_new_uint64(json-c >= 0.14-20200419)
Error examples
nsze : 0xe8e088b0
{
"nsze":-387938128
}
After fix this
{
"nsze":3907029168
}
json_object_add_value_int also should use json_object_new_int64
since util/json.h support long long type, and other codes are using it for 64bit values
Signed-off-by: Steven Seungcheol Lee <sc108.lee@samsung.com>
Signed-off-by: Gollu Appalanaidu <anaidu.gollu@samsung.com>
[dwagner: removed nvme-ioctl.c changes, part of libnvme] Signed-off-by: Daniel Wagner <dwagner@suse.de>
Daniel Wagner [Fri, 23 Jul 2021 10:32:15 +0000 (12:32 +0200)]
gen-hostnqn: Remove UUID validation heuristic
The validation heuristic is getting triggered for valid system UUID
such as 37383638-3330-4d32-3237-33353032394e. The only UUID validation
is already implemented. Remove the heuristic as it blocks valid use
UUIDs and doesn't protect from misuse anyway.
Michael Gebis [Tue, 20 Jul 2021 01:03:56 +0000 (18:03 -0700)]
Bash completions
Added support for latest commands
Added support for latest plugins
[dwagner: updated resv-report command] Signed-off-by: Daniel Wagner <dwagner@suse.de>
nvme: add multiple update detected result value in fw commit
Add Multiple Update Detected (MUD) field in FW Commit command
CQE CDW0 as per NVMe 2.0 Spec.
Signed-off-by: Gollu Appalanaidu <anaidu.gollu@samsung.com>
[dwagner: removed nvme-ioctl changes; part of libnvme] Signed-off-by: Daniel Wagner <dwagner@suse.de>
fix boot partitions register show in human readable format
If BPINFO or BPRSEL or BPMBL are zero means it doesn't indicates
that boot parttitions feature is not supported. CAP registers BPS
bit indicatates this feature support, fix that.
Change the IOCTL and depricate SQE structure for NVM commands
Read, Write and Compare Commands to add support for the Storage
Tag field (CDW2 and CDW3).
Remove the unsed nvme_user_io structure and NVME_IOCTL_SUBMIT_IO.
Signed-off-by: Gollu Appalanaidu <anaidu.gollu@samsung.com>
[dwagner: removed nvme-ioctl changes, part of libnvme] Signed-off-by: Daniel Wagner <dwagner@suse.de>
nvme: add CDW2 and CDW3 support for Write Zeroes and Verify Command
Added support for the Variable Sized Expected Logical Block Storage Tag(ELBST)
and Expected Logical Block Reference Tag (ELBRT), CDW2 and CDW3 (00:47) bits
for NVM commands Write Zeroes and Verify commands.
Signed-off-by: Gollu Appalanaidu <anaidu.gollu@samsung.com>
[dwagner: removed nvme-ioctl.c changes, these are part of libnvme] Signed-off-by: Daniel Wagner <dwagner@suse.de>
fixthething [Sat, 6 Mar 2021 16:56:41 +0000 (11:56 -0500)]
Doing dword alignment whether source of misalignment comes from file size or specified transfer length. Zeroing buffer to ensure zero fill and no heap garbage.
Daniel Wagner [Mon, 8 Nov 2021 09:42:02 +0000 (10:42 +0100)]
build: Use CONFIG_JSONC consistently
The config flag for json-c hasn't been updated to the consistent
naming scheme everywhere. Let's use prefix it with CONFIG and use the
correct library name which is json-c.
Daniel Wagner [Tue, 2 Nov 2021 12:42:45 +0000 (13:42 +0100)]
workflow: Disable tests for libnvme
The testsuite for nvme-cli is already disable because they are not
ready to be used in our CI setup. The same seems to be the case for
libnvme. The Python tests are failing at this point. Let's disable
them until we figured out how to enable them safely for CI.
Daniel Wagner [Tue, 2 Nov 2021 12:32:47 +0000 (13:32 +0100)]
build: Prefix configuration switches
Although we decided to depend hard on json-c and libuuid, we still are
able to build and link without those libraries. Let's keep this
working for a little while longer before we pull the plug.
Daniel Wagner [Mon, 18 Oct 2021 15:40:18 +0000 (17:40 +0200)]
build: Set minimum version for json-c and add fallback support
Set minimum version for json-c to 0.13.
nvme-cli uses json_util_get_last_err() which got introduced in 0.13,
released in December 2017.
Also, meson supports embedded library build. This is very handy for
system which ship outdated an really outdated json-c library.
The include path for json.h has to be adapted. The json-c upstream
project is not clear which include prefix should be used ('#include
<json-c/json.h>" vs '#include <json.h>'. In order to support embedded
builds, we need to use the second version of the include. The source
code is added to the build, hence we use the include directory path of
the project layout. And json-c has all include files in the root
directory. This is no problem when using a installed version of json-c
as pkg-config adds '-I/usr/inlude/json-c' to the include paths:
$pkg-config --cflags json-c
-I/usr/include/json-c
So the simplest thing to support both build cased (external/embedded)
just drop the include prefix.
Olaf Schmerse [Mon, 18 Oct 2021 13:42:29 +0000 (15:42 +0200)]
nvme: fail on busy namespace
To avoid formarting a busy namespace accidently a new function called
open_exclusive() is implemented. Instead of opening it always it opens
the device file in exclusive mode (O_EXCL). If this fails with the error EBUSY an error
messages hints to the --force command line option. By calling nvme format with the --force option it
will continue formating the namespace.
This patch fixes issue: #1095 Signed-off-by: Olaf Schmerse <olaf.schmerse@ionos.com>