Maurizio Lombardi [Mon, 8 Nov 2021 13:26:56 +0000 (14:26 +0100)]
nvme-cli: ctrl-loss-tmo should accept -1 as value
When passing the parameter --ctrl-loss-tmo=-1
nvme-cli silently drops it and replaces its value with the
default one (600) despite the fact that -1 is valid
and accepted by the kernel.
ctrl_loss_tmo < 0 means that it will try to reconnect forever
This is due to the fact that -1 is treated like "variable unset"
by nvme-cli and the add_int_argument() function ignores
all arguments with such a value if allow_zero is true (the latter seems
to be completely unintended).
This patch fixes the bug by:
1) removing the "arg == -1" condition from add_int_argument() and letting
the caller take care of checking if -1 is an acceptable value
for a particular argument.
2) initializing ctrl_loss_tmo to its default value instead of -1.
Daniel Wagner [Mon, 8 Nov 2021 09:22:17 +0000 (10:22 +0100)]
fabrics: Only free initialized valued on exit
ctrl_matches_connectargs() bails out if addr, subsysnqn or transport
are not valid. If this is the case only attempt to free those pointers
as these pointers are properly inialized, e.g. either NULL or a valid.
Daniel Wagner [Mon, 8 Nov 2021 09:17:01 +0000 (10:17 +0100)]
nvme: Add json_array_add_value_string helper
Commit 225e38f45899 ("add json support for zns report zones")
introduced a dependency to json_array_add_value_string(). This
function is not defined if the json-c is used. Let's add the missing
wrapper to fix the build.
Jeff Lien [Wed, 29 Sep 2021 14:50:47 +0000 (09:50 -0500)]
[zns] 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.
Current code returns the value of strdup and callers of
hostnqn_read_file() check for the NULL value in order to determine the
success or failure. The value return by the strdup will never be NULL
unless strdup() results in an error that is making function return
success all the time resulting in blktests failures.
Check the string value to NULL before we return the pointer.
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>
Add missing user data buffer and metadata buffer size parameter for the
passthru I/O commands since driver code expects these values to be set
from the user space. Without this patch blktests/nvme/029 is failing.
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>
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
+fix bug(unallocated pointer free)
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.
Signed-off-by: Steven Seungcheol Lee <sc108.lee@samsung.com>
Brandon Paupore (1):
Add Timeout Parameter for Zone Management Commands
Daniel Wagner (2):
nvme-topology: no error message when openeing of controller fails
gen-hostnqn: Remove UUID validation heuristic
FrancisPravin (1):
intel_nvme: fixed typo
Gollu Appalanaidu (42):
nvme-print: print namespace write protect states in get feature
zns: trivial formatting fix
nvme-print: add fna 3rd bit in identify ctrl
nvme-print: add controller register cap 44th bit
nvme: add primary ctrl caps man page
nvme: fix predictable latency log zsh completions
nvme: adding get lba status command man page
nvme: add uuid index in get and set features command
nvme: fix csi data type in list_ns
nvme: add json output format for list_crl
nvme-ioctl: remove unused function nvme_identify_ns_list
zns: style fixes in zns plugin
nvme: add json output format for list_ns
nvme: fix parameter sizes
zns: fix get_zdes_bytes return value in failed cases
wdc-nvme: fix the build failure
nvme: add latency parameter for passthru commands
nvme: add lsp and uuid index invalid value checks in get log
nvme: add optional copy format support id ctrl field
nvme: add zone desc changed notice async event
nvme: add persistent event log action field invalid check
nvme: add json, binary and human readable output format for id iocs
nvme: update passthru commands man page with latency parameter details
nvme-print: sanitize log style fix
nvme: add the LBA format upper in Format NVM Command
nvme: fix errno for non nvme device return errors
nvme: add missing endianness annotations
nvme: fix the fw-log structure and show fw log changes
nvme: add identify controller structure 2.0 spec. fields
nvme: add get log page 2.0 spec fields
nvme: add the status codes from 2.0 spec
nvme: extend existing id ctrl parameters as per 2.0
nvme: add status to error number for id_uuid and verify_cmd
nvme: style fix
nvme: add verify command man page
nvme: add CDW2 and CDW3 support for Write Zeroes and Verify Command
nvme add Storage Tag Check field in NVM Commands
Change IOCTL for read, write and compare commands
fix boot partitions register show in human readable format
nvme: add multiple update detected result value in fw commit
nvme: add capacity management command support
Add Identify CNS 0x18 Domain List Support
Hannes Reinecke (2):
nvme-ioctl: return -1 on failure from nvme_get_nsid()
nvme-topology: scan all controllers in scan_subsystem()
Hanumanthu H (4):
Micron plugin version 1.0.6
json format support for micron vs-drive-info command
Support micron vs-smart-add-log option for M54XX drives
vs-drive-info command opcode change for M5407 drives
James Kahn (1):
corrected-returns-in-sanitize-log
Jeff Lien (2):
[nvme-cli] Add support for new devices
[NVMe CLI] Add capability for unique plugin version
Jonathan Teh (1):
nvme-cli: fix typos in reservation actions
Keith Busch (11):
fix virtual mgmt parameter sizes
default flush to use block device nsid
fix code style
fix set_feature formatting
remove string representation timestamp set_feature
strip trailing spaces from fabrics output
Merge branch 'master' of https://github.com/michael-gebis/nvme-cli into michael-gebis-master
Revert "Bug fix unsigned int and int should use 64bit api for json-c"
Merge branch 'master' of https://github.com/fixthething/nvme-cli into fixthething-master
Merge branch 'mi_features' of https://github.com/NateRoiger/nvme-cli into NateRoiger-mi_features
fix whitespace damage
Martin Belanger (3):
Add device id in JSON output
Add --host-iface option
Print device name on connect
Martin George (4):
fabrics: skip connect if transport type doesn't match
nvme-topology: fix controller check in scan_subsystem()
nvme-print: fix 'nvme list' segfault if controller is unavailable
fabrics: add default port number for NVMe/TCP I/O controllers
Maurizio Lombardi (1):
autoconnect: replace network.target with network-online.target
Michael Gebis (3):
id-nvmset: Fixed typo
micron-nvme.h: formatting
Bash completions
Minwoo Im (1):
nvme: support ns generic device to submit_io
Nate Roiger (2):
Add NVMe MI Features: Controller Metadata (0x7E) and Namespace Metadata (0x7F).
Merge branch 'master' into mi_features
Ronan Pigott (1):
completions: fix syntax typo in zsh completions
Steven Seungcheol Lee (2):
nvme: Bug fix default data_len used if no argument given
Bug fix unsigned int and int should use 64bit api for json-c
Sushrut Shirole (2):
wdc-nvme: fix uclibc compilation.
Use PRIx64 format specifier instead of lX for more portability.
Tokunori Ikegami (3):
nvme-print: print both kelvin and celsius temperature values
nvme-cli: Add lsi option for get-log command
nvme: Fix to print get and set feature hex digits correct width
fixthething (4):
Making security-send command more flexible by allowing data from stdin, and assuming transfer length to match input size if not specified.
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.
Changes requested by keithbusch; no default for cfg.tl.
Removing redundant parameter from nvme_sec_send
Martin George [Fri, 6 Aug 2021 12:05:20 +0000 (17:35 +0530)]
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.
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>
Minwoo Im [Fri, 9 Jul 2021 08:50:25 +0000 (17:50 +0900)]
nvme: support ns generic device to submit_io
Retrieve `logical_block_size` sysfs attribute when I/O subcommand(e.g.,
read, write, ...) is given instead requesting BLKSSZGET ioctl to the
generic device which is not supported.
Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>
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.
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.
Martin George [Mon, 19 Jul 2021 17:07:48 +0000 (10:07 -0700)]
nvme-topology: fix controller check in scan_subsystem()
Fix the current check in scan_subsystem() so that it iterates
through all the available controllers till it gets a 'live'
controller for that namespace.
Link: https://github.com/linux-nvme/nvme-cli/pull/1101 Fixes: ce9d818 ("nvme-topology: scan all controllers in scan_subsystem()") Signed-off-by: Martin George <marting@netapp.com> Reviewed-by: Daniel Wagner <dwagner@suse.de> Signed-off-by: Keith Busch <kbusch@kernel.org>
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.
Hannes Reinecke [Tue, 22 Jun 2021 11:48:36 +0000 (13:48 +0200)]
nvme-topology: scan all controllers in scan_subsystem()
When a controller is unavailable or resetting during scan_subsystem()
we should be checking all available controllers for this namespace
to avoid a spurious failure.
Hannes Reinecke [Tue, 22 Jun 2021 11:40:23 +0000 (13:40 +0200)]
nvme-ioctl: return -1 on failure from nvme_get_nsid()
If the call to 'fstat' fails we should be returning '-1' (as the
errno is already set by fstat()) to be compliant with the return
values from 'ioctl()'.