]> www.infradead.org Git - users/sagi/nvme-cli.git/log
users/sagi/nvme-cli.git
3 years agoBug fix unsigned int and int should use 64bit api for json-c
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>
3 years agoMerge branch 'master' of https://github.com/michael-gebis/nvme-cli into michael-gebis...
Keith Busch [Fri, 6 Aug 2021 20:07:26 +0000 (13:07 -0700)]
Merge branch 'master' of https://github.com/michael-gebis/nvme-cli into michael-gebis-master

3 years agoAdd Identify CNS 0x18 Domain List Support
Gollu Appalanaidu [Mon, 19 Jul 2021 13:57:47 +0000 (19:27 +0530)]
Add Identify CNS 0x18 Domain List Support

Signed-off-by: Gollu Appalanaidu <anaidu.gollu@samsung.com>
3 years agonvme: support ns generic device to submit_io
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>
4 years agostrip trailing spaces from fabrics output
Keith Busch [Tue, 3 Aug 2021 16:45:22 +0000 (09:45 -0700)]
strip trailing spaces from fabrics output

Link: https://github.com/linux-nvme/nvme-cli/issues/1117
Signed-off-by: Keith Busch <kbusch@kernel.org>
4 years agonvme: Bug fix default data_len used if no argument given
Steven Seungcheol Lee [Tue, 3 Aug 2021 04:47:13 +0000 (13:47 +0900)]
nvme: Bug fix default data_len used if no argument given

current logic ignore given data by user
so make priority to use user argument first

this change make available vendor specific command on set-feature, get-feature with data_len

Signed-off-by: Steven Seungcheol Lee <sc108.lee@samsung.com>
4 years agoremove string representation timestamp set_feature
Keith Busch [Tue, 3 Aug 2021 14:41:58 +0000 (07:41 -0700)]
remove string representation timestamp set_feature

Require the integer representation be provided for this to avoid any
mismatched sizing problems.

Signed-off-by: Keith Busch <kbusch@kernel.org>
4 years agofix set_feature formatting
Keith Busch [Tue, 3 Aug 2021 14:23:21 +0000 (07:23 -0700)]
fix set_feature formatting

spaces to tabs, per linux coding style.

Signed-off-by: Keith Busch <kbusch@kernel.org>
4 years agonvme: add capacity management command support
Gollu Appalanaidu [Thu, 1 Jul 2021 18:52:11 +0000 (00:22 +0530)]
nvme: add capacity management command support

Host software issues this Capacity Management command to
configure/Create/Delete Endurance Groups and NVM Sets in an
NVM subsystem.

Signed-off-by: Gollu Appalanaidu <anaidu.gollu@samsung.com>
Signed-off-by: Karthik Balan <karthik.b82@samsung.com>
4 years agogen-hostnqn: Remove UUID validation heuristic
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.

Signed-off: Daniel Wagner <dwagner@suse.de>

4 years agoBash completions
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

4 years agomicron-nvme.h: formatting
Michael Gebis [Tue, 20 Jul 2021 05:40:50 +0000 (22:40 -0700)]
micron-nvme.h: formatting

4 years agonvme: add multiple update detected result value in fw commit
Gollu Appalanaidu [Sat, 3 Jul 2021 18:52:36 +0000 (00:22 +0530)]
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>
4 years agofix boot partitions register show in human readable format
Gollu Appalanaidu [Tue, 20 Jul 2021 08:00:04 +0000 (13:30 +0530)]
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.

Signed-off-by: Gollu Appalanaidu <anaidu.gollu@samsung.com>
4 years agoChange IOCTL for read, write and compare commands
Gollu Appalanaidu [Mon, 12 Jul 2021 13:37:19 +0000 (19:07 +0530)]
Change IOCTL for read, write and compare commands

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>
4 years agofix code style
Keith Busch [Mon, 19 Jul 2021 19:56:23 +0000 (12:56 -0700)]
fix code style

I accidently inserted a newline where it should not have been when
applying the previous patch.

Signed-off-by: Keith Busch <kbusch@kernel.org>
4 years agonvme-topology: fix controller check in scan_subsystem()
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>
4 years agoid-nvmset: Fixed typo
Michael Gebis [Thu, 15 Jul 2021 22:02:30 +0000 (15:02 -0700)]
id-nvmset: Fixed typo

4 years agoUse PRIx64 format specifier instead of lX for more portability.
Sushrut Shirole [Tue, 13 Jul 2021 22:02:53 +0000 (15:02 -0700)]
Use PRIx64 format specifier instead of lX for more portability.

Signed-off-by: Sushrut Shirole <sushrutshirole@gmail.com>
4 years agointel_nvme: fixed typo
FrancisPravin [Mon, 12 Jul 2021 14:35:15 +0000 (20:05 +0530)]
intel_nvme: fixed typo

4 years agowdc-nvme: fix uclibc compilation.
Sushrut Shirole [Fri, 9 Jul 2021 21:22:20 +0000 (14:22 -0700)]
wdc-nvme: fix uclibc compilation.

4 years agonvme add Storage Tag Check field in NVM Commands
Gollu Appalanaidu [Fri, 9 Jul 2021 08:19:58 +0000 (13:49 +0530)]
nvme add Storage Tag Check field in NVM Commands

Add Storage Tag Check(STC) field in Write, Read, Compare,
Write Zeroes and Verify commands

Signed-off-by: Gollu Appalanaidu <anaidu.gollu@samsung.com>
4 years agonvme: add CDW2 and CDW3 support for Write Zeroes and Verify Command
Gollu Appalanaidu [Thu, 8 Jul 2021 16:25:22 +0000 (21:55 +0530)]
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>
4 years agonvme: add verify command man page
Gollu Appalanaidu [Tue, 6 Jul 2021 20:08:23 +0000 (01:38 +0530)]
nvme: add verify command man page

Signed-off-by: Gollu Appalanaidu <anaidu.gollu@samsung.com>
4 years agonvme: style fix
Gollu Appalanaidu [Thu, 1 Jul 2021 18:57:37 +0000 (00:27 +0530)]
nvme: style fix

Signed-off-by: Gollu Appalanaidu <anaidu.gollu@samsung.com>
4 years ago[NVMe CLI] Add capability for unique plugin version
Jeff Lien [Fri, 18 Jun 2021 15:03:33 +0000 (10:03 -0500)]
[NVMe CLI] Add capability for unique plugin version

4 years agoAdd Timeout Parameter for Zone Management Commands
Brandon Paupore [Wed, 23 Jun 2021 17:31:22 +0000 (12:31 -0500)]
Add Timeout Parameter for Zone Management Commands

Signed-off-by: Brandon Paupore <brandon.paupore@wdc.com>
4 years agonvme: add status to error number for id_uuid and verify_cmd
Gollu Appalanaidu [Mon, 14 Jun 2021 19:23:20 +0000 (00:53 +0530)]
nvme: add status to error number for id_uuid and verify_cmd

Signed-off-by: Gollu Appalanaidu <anaidu.gollu@samsung.com>
4 years agonvme: extend existing id ctrl parameters as per 2.0
Gollu Appalanaidu [Sun, 13 Jun 2021 14:00:02 +0000 (19:30 +0530)]
nvme: extend existing id ctrl parameters as per 2.0

Signed-off-by: Gollu Appalanaidu <anaidu.gollu@samsung.com>
4 years agonvme: add the status codes from 2.0 spec
Gollu Appalanaidu [Sat, 12 Jun 2021 10:53:07 +0000 (16:23 +0530)]
nvme: add the status codes from 2.0 spec

Signed-off-by: Gollu Appalanaidu <anaidu.gollu@samsung.com>
4 years agonvme: add get log page 2.0 spec fields
Gollu Appalanaidu [Sat, 12 Jun 2021 09:20:14 +0000 (14:50 +0530)]
nvme: add get log page 2.0 spec fields

Add the Offset Type (OT) and Command Set Identifier (CSI) in
get_log and to nvme_get_log14 function as per the Spec 2.0.

Based on the requirement this can be added for the nvme_get_log13
and nvme_get_log when implementing specific log pages that use
these two parameters.

Signed-off-by: Gollu Appalanaidu <anaidu.gollu@samsung.com>
4 years agonvme: add identify controller structure 2.0 spec. fields
Gollu Appalanaidu [Fri, 11 Jun 2021 21:24:56 +0000 (02:54 +0530)]
nvme: add identify controller structure 2.0 spec. fields

Signed-off-by: Gollu Appalanaidu <anaidu.gollu@samsung.com>
4 years agonvme-topology: scan all controllers in scan_subsystem()
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.

Signed-off-by: Hannes Reinecke <hare@suse.de>
4 years agonvme-ioctl: return -1 on failure from nvme_get_nsid()
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()'.

Signed-off-by: Hannes Reinecke <hare@suse.de>
4 years agonvme: fix the fw-log structure and show fw log changes
Gollu Appalanaidu [Fri, 18 Jun 2021 18:07:53 +0000 (23:37 +0530)]
nvme: fix the fw-log structure and show fw log changes

Signed-off-by: Gollu Appalanaidu <anaidu.gollu@samsung.com>
4 years agonvme: add missing endianness annotations
Gollu Appalanaidu [Thu, 17 Jun 2021 17:39:58 +0000 (23:09 +0530)]
nvme: add missing endianness annotations

Signed-off-by: Gollu Appalanaidu <anaidu.gollu@samsung.com>
4 years agoPrint device name on connect
Martin Belanger [Fri, 18 Jun 2021 13:01:23 +0000 (09:01 -0400)]
Print device name on connect

4 years agonvme: fix errno for non nvme device return errors
Gollu Appalanaidu [Tue, 4 May 2021 15:54:52 +0000 (21:24 +0530)]
nvme: fix errno for non nvme device return errors

Fix the shell return error numbers(errno) in overall
nvme.c file.

Signed-off-by: Gollu Appalanaidu <anaidu.gollu@samsung.com>
4 years agonvme: Fix to print get and set feature hex digits correct width
Tokunori Ikegami [Thu, 27 May 2021 18:11:29 +0000 (03:11 +0900)]
nvme: Fix to print get and set feature hex digits correct width

Previously 2 hex digits not printed as "0x" was included the width specified.
To resolve this increase 2 digits number more if the value is not zero.

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
4 years agonvme: add the LBA format upper in Format NVM Command
Gollu Appalanaidu [Sun, 6 Jun 2021 19:23:59 +0000 (00:53 +0530)]
nvme: add the LBA format upper in Format NVM Command

Add the LBAFU in FormatNVM command as per the NVMe 2.0
Base Specification.

Signed-off-by: Gollu Appalanaidu <anaidu.gollu@samsung.com>
4 years agonvme-print: sanitize log style fix
Gollu Appalanaidu [Sat, 29 May 2021 18:01:41 +0000 (23:31 +0530)]
nvme-print: sanitize log style fix

Signed-off-by: Gollu Appalanaidu <anaidu.gollu@samsung.com>
4 years agofabrics: skip connect if transport type doesn't match
Martin George [Sat, 5 Jun 2021 09:46:26 +0000 (15:16 +0530)]
fabrics: skip connect if transport type doesn't match

Discovery log page data may include records belonging to different
transport types. If during a nvme connect-all, a connect is attempted
on a record that doesn't match the transport type passed here, it
would end up in a connect failure for that record. For e.g. one would
see the below error if a connect is attempted on a tcp record but the
transport type passed here is 'fc' and its associated parameters:

nvme_tcp: malformed src address passed: nn-0xXXXX:pn-0xYYYY

Fix this by proceeding with the connect only if the appropriate
transport type matches a given record during the connect-all.

Signed-off-by: Martin George <marting@netapp.com>
4 years agonvme: update passthru commands man page with latency parameter details
Gollu Appalanaidu [Fri, 4 Jun 2021 05:31:54 +0000 (11:01 +0530)]
nvme: update passthru commands man page with latency parameter details

Signed-off-by: Gollu Appalanaidu <anaidu.gollu@samsung.com>
4 years agovs-drive-info command opcode change for M5407 drives
Hanumanthu H [Fri, 4 Jun 2021 10:18:58 +0000 (15:48 +0530)]
vs-drive-info command opcode change for M5407 drives

4 years agoSupport micron vs-smart-add-log option for M54XX drives
Hanumanthu H [Tue, 1 Jun 2021 14:40:51 +0000 (20:10 +0530)]
Support micron vs-smart-add-log option for M54XX drives

4 years agonvme: add json, binary and human readable output format for id iocs
Gollu Appalanaidu [Fri, 28 May 2021 18:11:33 +0000 (23:41 +0530)]
nvme: add json, binary and human readable output format for id iocs

Signed-off-by: Gollu Appalanaidu <anaidu.gollu@samsung.com>
4 years agonvme: add persistent event log action field invalid check
Gollu Appalanaidu [Thu, 27 May 2021 06:32:28 +0000 (12:02 +0530)]
nvme: add persistent event log action field invalid check

Signed-off-by: Gollu Appalanaidu <anaidu.gollu@samsung.com>
4 years agonvme: add zone desc changed notice async event
Gollu Appalanaidu [Fri, 28 May 2021 13:52:45 +0000 (19:22 +0530)]
nvme: add zone desc changed notice async event

Add the Zone Descriptor Changed Notices in get feature
human readble output for the Async Event config feature
(FID = 0x0B) as per the TP4053 Zoned Namespaces

Signed-off-by: Gollu Appalanaidu <anaidu.gollu@samsung.com>
4 years agonvme: add optional copy format support id ctrl field
Gollu Appalanaidu [Fri, 28 May 2021 05:10:40 +0000 (10:40 +0530)]
nvme: add optional copy format support id ctrl field

Add the OCFS field in Identify Controller Structure, as per the
Ratified TP 4065b (Simple Copy Command).

Signed-off-by: Gollu Appalanaidu <anaidu.gollu@samsung.com>
4 years agonvme: add lsp and uuid index invalid value checks in get log
Gollu Appalanaidu [Thu, 27 May 2021 06:23:40 +0000 (11:53 +0530)]
nvme: add lsp and uuid index invalid value checks in get log

Add the invalid LSP and UUID Index value checks as per the field
lengths. Refactor the get_log function.

Signed-off-by: Gollu Appalanaidu <anaidu.gollu@samsung.com>
4 years agonvme: add latency parameter for passthru commands
Gollu Appalanaidu [Thu, 3 Jun 2021 16:45:41 +0000 (22:15 +0530)]
nvme: add latency parameter for passthru commands

Signed-off-by: Gollu Appalanaidu <anaidu.gollu@samsung.com>
4 years agowdc-nvme: fix the build failure
Gollu Appalanaidu [Thu, 3 Jun 2021 16:51:10 +0000 (22:21 +0530)]
wdc-nvme: fix the build failure

Signed-off-by: Gollu Appalanaidu <anaidu.gollu@samsung.com>
4 years agoAddressed review comments
Akhilesh RN [Thu, 27 May 2021 11:57:17 +0000 (17:27 +0530)]
Addressed review comments

4 years agoZN-350 - vs-fw-activate-history bug fix
Akhilesh RN [Wed, 26 May 2021 13:41:26 +0000 (19:11 +0530)]
ZN-350 - vs-fw-activate-history bug fix

4 years agoAdd --host-iface option
Martin Belanger [Thu, 20 May 2021 17:49:44 +0000 (13:49 -0400)]
Add --host-iface option

4 years agonvme-topology: no error message when openeing of controller fails
Daniel Wagner [Wed, 2 Jun 2021 13:42:42 +0000 (15:42 +0200)]
nvme-topology: no error message when openeing of controller fails

scan_ctrl() tries to open the controller device but this operation is
expected to fail for fabric setups when a path is down. This can lead
to the situation where the subsystem is in a healthy state, e.g. at
least one path is in live state. In this scenario a failure is printed
although everything is fine.

This is especially a problem for NVMe/TCP configs where the controller
remains in 'connecting' state for 10 minutes following a path
down. All that time 'nvme list' ends up in errors and that's a major
irritant for end users. This also makes CI automation more complex
than needed.

Just drop the error message as we have other error paths in this
function where we just bail out if they fail without printing an
error message.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
4 years agodefault flush to use block device nsid
Keith Busch [Tue, 1 Jun 2021 14:01:44 +0000 (07:01 -0700)]
default flush to use block device nsid

Kernel 5.13 added checks to ensure the ioctl path can't be abused to
access a different namespace than the one user space has permission to
open. This unfortunately breaks the all-nsid flush usage, so user
tooling needs to default to the device's namespace id.

Link: https://lore.kernel.org/linux-nvme/20210518144249.GE2709569@dhcp-10-100-145-180.wdc.com/T/#t
Link: https://github.com/linux-nvme/nvme-cli/issues/1066
Signed-off-by: Keith Busch <kbusch@kernel.org>
4 years agoZN-350 - wdc purge command bug fix
Akhilesh RN [Fri, 28 May 2021 10:09:59 +0000 (15:39 +0530)]
ZN-350 - wdc purge command bug fix

4 years agojson format support for micron vs-drive-info command
Hanumanthu H [Thu, 27 May 2021 08:46:23 +0000 (14:16 +0530)]
json format support for micron vs-drive-info command

4 years agozns: fix get_zdes_bytes return value in failed cases
Gollu Appalanaidu [Tue, 18 May 2021 04:25:55 +0000 (09:55 +0530)]
zns: fix get_zdes_bytes return value in failed cases

get_zdes_bytes shall return constant value in failed cases in
order to catch in called function

Check if the get_zdes_bytes returned proper data length or not.

Signed-off-by: Gollu Appalanaidu <anaidu.gollu@samsung.com>
4 years agocorrected-returns-in-sanitize-log
James Kahn [Wed, 26 May 2021 18:22:34 +0000 (14:22 -0400)]
corrected-returns-in-sanitize-log

4 years agonvme: fix parameter sizes
Gollu Appalanaidu [Wed, 26 May 2021 06:29:19 +0000 (11:59 +0530)]
nvme: fix parameter sizes

Fix the parameter sizes as per the data type in complete
nvme.c file.

Signed-off-by: Gollu Appalanaidu <anaidu.gollu@samsung.com>
4 years agofabrics: add fast_io_fail_tmo option
Sagi Grimberg [Mon, 17 May 2021 18:26:16 +0000 (11:26 -0700)]
fabrics: add fast_io_fail_tmo option

Option to fail fast I/O when connecting to a controller. It is useful
to set a fast-fail timeout for nvme in case upper layer SW wants to
detect unresponsive controllers early (e.g. mdraid).

Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Keith Busch <kbusch@kernel.org>
4 years agosystemd/nvmf-autoconnect.service: load nvme-fabrics before autoconnect
Sagi Grimberg [Wed, 26 May 2021 07:25:15 +0000 (00:25 -0700)]
systemd/nvmf-autoconnect.service: load nvme-fabrics before autoconnect

Upon boot nvme-fabrics needs to be loaded, so make sure to load
it before executing ExecStart. The driver will know to request
the transport module according to the transport parameter.

Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
4 years agonvme: add json output format for list_ns
Gollu Appalanaidu [Sun, 16 May 2021 04:19:02 +0000 (09:49 +0530)]
nvme: add json output format for list_ns

Signed-off-by: Gollu Appalanaidu <anaidu.gollu@samsung.com>
4 years agonvme-cli: Add lsi option for get-log command
Tokunori Ikegami [Tue, 27 Oct 2020 14:56:43 +0000 (23:56 +0900)]
nvme-cli: Add lsi option for get-log command

Previously lsi is set as 0 as hard coded value by the get-log command.
To set this parameter by the command add lsi option for the command.

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
4 years agozns: style fixes in zns plugin
Gollu Appalanaidu [Tue, 18 May 2021 04:19:20 +0000 (09:49 +0530)]
zns: style fixes in zns plugin

Signed-off-by: Gollu Appalanaidu <anaidu.gollu@samsung.com>
4 years agonvme-ioctl: remove unused function nvme_identify_ns_list
Gollu Appalanaidu [Sat, 15 May 2021 17:58:58 +0000 (23:28 +0530)]
nvme-ioctl: remove unused function nvme_identify_ns_list

Signed-off-by: Gollu Appalanaidu <anaidu.gollu@samsung.com>
4 years agonvme: add json output format for list_crl
Gollu Appalanaidu [Sun, 16 May 2021 07:20:15 +0000 (12:50 +0530)]
nvme: add json output format for list_crl

Signed-off-by: Gollu Appalanaidu <anaidu.gollu@samsung.com>
4 years agonvme: fix csi data type in list_ns
Gollu Appalanaidu [Sun, 16 May 2021 03:51:46 +0000 (09:21 +0530)]
nvme: fix csi data type in list_ns

Command Set Identifier (CSI) data type is 8 bits, fix that.

Signed-off-by: Gollu Appalanaidu <anaidu.gollu@samsung.com>
4 years agonvme: add uuid index in get and set features command
Gollu Appalanaidu [Sat, 15 May 2021 18:59:37 +0000 (00:29 +0530)]
nvme: add uuid index in get and set features command

Signed-off-by: Gollu Appalanaidu <anaidu.gollu@samsung.com>
4 years agonvme: adding get lba status command man page
Gollu Appalanaidu [Tue, 11 May 2021 05:34:49 +0000 (11:04 +0530)]
nvme: adding get lba status command man page

Signed-off-by: Gollu Appalanaidu <anaidu.gollu@samsung.com>
4 years agofix virtual mgmt parameter sizes
Keith Busch [Fri, 21 May 2021 16:57:36 +0000 (09:57 -0700)]
fix virtual mgmt parameter sizes

The option sizes need to match the parameter sizes.

Fixes: 4221cb85 ("nvme: fix and refactor virt mgmt cdw10 and cdw11 arguments")
Link: https://github.com/linux-nvme/nvme-cli/issues/1049
Signed-off-by: Keith Busch <kbusch@kernel.org>
4 years agoMicron plugin version 1.0.6
Hanumanthu H [Thu, 13 May 2021 08:06:40 +0000 (13:36 +0530)]
Micron plugin version 1.0.6

4 years agoRemoved unwanted print statement
Akhilesh RN [Thu, 22 Apr 2021 07:55:55 +0000 (13:25 +0530)]
Removed unwanted print statement

4 years agonvme: fix predictable latency log zsh completions
Gollu Appalanaidu [Tue, 11 May 2021 04:41:04 +0000 (10:11 +0530)]
nvme: fix predictable latency log zsh completions

Signed-off-by: Gollu Appalanaidu <anaidu.gollu@samsung.com>
4 years agonvme: add primary ctrl caps man page
Gollu Appalanaidu [Tue, 11 May 2021 06:56:57 +0000 (12:26 +0530)]
nvme: add primary ctrl caps man page

Signed-off-by: Gollu Appalanaidu <anaidu.gollu@samsung.com>
4 years ago[nvme-cli] Add support for new devices
Jeff Lien [Wed, 21 Apr 2021 15:12:03 +0000 (10:12 -0500)]
[nvme-cli] Add support for new devices

4 years agonvme-print: add controller register cap 44th bit
Gollu Appalanaidu [Sat, 17 Apr 2021 19:52:42 +0000 (01:22 +0530)]
nvme-print: add controller register cap 44th bit

Signed-off-by: Gollu Appalanaidu <anaidu.gollu@samsung.com>
4 years agonvme-print: add fna 3rd bit in identify ctrl
Gollu Appalanaidu [Sat, 17 Apr 2021 20:21:36 +0000 (01:51 +0530)]
nvme-print: add fna 3rd bit in identify ctrl

Add FNA 3rd bit to indicate whether FormatNVM command
supports Broadcast NSID (FFFFFFFFh) or not as per TP
4056d.

Signed-off-by: Gollu Appalanaidu <anaidu.gollu@samsung.com>
4 years agozns: trivial formatting fix
Gollu Appalanaidu [Thu, 8 Apr 2021 12:50:58 +0000 (18:20 +0530)]
zns: trivial formatting fix

Signed-off-by: Gollu Appalanaidu <anaidu.gollu@samsung.com>
4 years agonvme-print: print namespace write protect states in get feature
Gollu Appalanaidu [Thu, 29 Apr 2021 16:38:04 +0000 (22:08 +0530)]
nvme-print: print namespace write protect states in get feature

Print the Namespace write protect states for the get feature
with FID 0x84, Namespace write protect config.

Signed-off-by: Gollu Appalanaidu <anaidu.gollu@samsung.com>
4 years agonvme-cli: fix typos in reservation actions
Jonathan Teh [Fri, 7 May 2021 17:35:55 +0000 (18:35 +0100)]
nvme-cli: fix typos in reservation actions

Fix typos in short option for reservation register action and the full
name of reservation acquire action.

4 years agocompletions: fix syntax typo in zsh completions
Ronan Pigott [Thu, 6 May 2021 21:11:33 +0000 (14:11 -0700)]
completions: fix syntax typo in zsh completions

4 years agonvme-print: print both kelvin and celsius temperature values
Tokunori Ikegami [Thu, 6 May 2021 16:21:19 +0000 (01:21 +0900)]
nvme-print: print both kelvin and celsius temperature values

Previously celsisu values were printed by smart-log and get-feature commands.
But kelvin values were printed by id-ctrl command.
For human readable format print both kelvin and celsisu temperature values.

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
4 years agoAdd device id in JSON output
Martin Belanger [Fri, 23 Apr 2021 18:12:25 +0000 (14:12 -0400)]
Add device id in JSON output

4 years agoTag v1.14 v1.14
Keith Busch [Tue, 20 Apr 2021 19:51:14 +0000 (12:51 -0700)]
Tag v1.14

Shortlog below since v1.13: lots of fixes, cleanups, documentation
updates, and a few new features like replay protection.

Affe (4):
      Adding and updating some ns-id paramters to be inline with NVMe spec. rev. 1.4b
      Adding and updating some ns-id paramters to be inline with NVMe spec. rev. 1.4b
      Rebase and merge into HMT
      Rebased and removed empty printouts for reserved locations.

Akhilesh RN (1):
      ZN-350 changes

Alexandre Bouvier (1):
      Update 70-nvmf-autoconnect.conf.in

Brian King (1):
      nvme: Make gen-hostnqn use partition UUID on IBM POWER systems

Chaitanya Kulkarni (3):
      zns: NULL arg to free is perfectly acceptable
      zns: NULL arg to free is perfectly acceptable
      zns: for zra report zone make sure data len is set

Eric Curtin (5):
      Typo s/rtyep/rtype/g
      Trying to get a ppc64le build going
      Input expects device name without /dev
      Don't print error on failed to open in nvme-topology.c
      Man page update nvme discover

Erwan Velu (1):
      nvme-print: Adding enum nvme_feat

Eyal Ben-David (1):
      verify-no-dep : Fix makefile entry.

Francisco Munoz (2):
      Modify lat-stats cmd to cope with optane bucket format
      Fix return type for arconfig functions

Gollu Appalanaidu (67):
      nvme: add support for persistent event log page
      nvme: add support for predictable latency event aggregate log page
      nvme: add support for predictable latency per NVM set log page
      nvme: fix get lba status command nsid and data len fields
      nvme: fix device self test log
      nvme: device self test cdw10 specific fields
      nvme: add fix for sanitize OWPASS value and log page structure
      nvme: fix log-id data type and remove unnecessary log-id validtion
      nvme: fix get and set features feature-id data type
      nvme: add latest opcodes for command supported and effects log
      nvme: remove zns command set opcodes from the effects log
      nvme: print NSFEAT UIDREUSE bit in human readable format
      nvme: Round of the metadata size to fit into block count
      nvme: remove unused functions nvme_{read, write, compare}
      nvme-print: refactor sanitize log status string
      nvme-print: align switch-case with existing style
      nvme-status: add status to error no support for path related errors
      zns: fix namespace-id data type in multiple places
      nvme-print: add one space around the operators
      nvme-print: fix fetching status code type and status data type
      nvme: add identify controller nvm command set support
      zns: fix zone management receive command zra and zrasf data types
      nvme: remove unassigned variable "lbads" from format function
      nvme: add man page and completions of nvm command set id controller
      nvme-print: remove unused argument passing to json output format print
      nvme: add path related error status codes
      nvme-print: add status_to_string for IO command specific status codes
      nvme: add endurance group event configuration feature
      nvme-print: show feat fields for FID = {0x17,0x12} and refactoring
      nvme: fix printing set-feature FID and print cdw12, save fields
      nvme: fix status field masking and data type
      nvme: add support for endurance group event aggregate log
      nvme: add support for lba status log page
      nvme-cli: misc. fixes for memory allocation failure case
      nvme: fix identify controller structure fabrics identify fields
      nvme: change system error notification from fprintf to perror
      nvme-print: split pmrmsc into pmrmscl and pmrmscu
      nvme: fix security send & receive commands show status code
      nvme: fix securuty send and receive commands result field
      nvme-print: add NSSC field in directive receive show fields
      nvme-print: fix HMB get feature response in human readable format
      nvme-print: fix register size for raw format print
      nvme: use nvme_show_status when command status code is non-zero
      nvme: fix DPS description and improve the other fields descriptions
      nvme-print: improve command support and effects log json format
      nvme: add reservation notifacation log page
      nvme: refactor and improve the passthru function
      nvme: add namespace id config field for copy command
      nvme: fix dsm and copy commands free up buffers
      nvme: address 1.4 to 1.4b changes for Change NS event type
      nvme: remove trailing space
      nvme: add lba status information attributes feature support
      nvme: fix commenting style
      nvme: fix timestamp feature in set feature
      nvme: make else if and else statements uniform
      nvme: remove redundant structure of primary controller capabilities
      nvme: nvme get and set features buffer length clean up
      nvme: random fixes in primary controller capabilities
      nvme: fix human-readable format option in primary ctrl caps
      nvme: fix and refactor virt mgmt cdw10 and cdw11 arguments
      nvme: add rae field in sanitize-log
      nvme-print: print phase tag field separately in error-log fields
      zns: return response with status to errno conversion
      nvme-print: fix io-command set profile feature
      nvme: remove buf allocation check since NULL free is acceptable
      nvme: add space in persistent event log desc between words
      nvme: add one space around the operand and operator in d_raw

Hannes Reinecke (8):
      fabrics: ctrl_loss_tmo setting is invalid for 'loop'
      nvme-discover: add json output
      fabrics: correctly handle ctrl_loss_tmo settings for loop
      fabrics: fix infinite loop on invalid parameters
      nvme-discover: lookup existing persistent controllers
      util/json: unify struct json_object and struct json_array
      nvme: build against json-c library
      Read system UUID from DMI and merge hostnqn generation functions

Hanumanthu H (9):
      Add support for Replay Protection Memory Block (RPMB) commands
      Fix copyright typo
      Add support for Replay Protection Memory Block (RPMB) commands
      Fix copyright typo
      sync with latest repo
      Micron plugin changes - extended smart health info and others
      Micron plugin changes - version 1.0.4
      micron plugin version 1.0.5
      micron plugin version 1.0.5 - 51C2, 51C3 support

Jeff Lien (18):
      [nvme-cli] wdc plugin fix for vs-internal-log command for SN730 drive.
      [nvme-cli] Additional fixes to wdc plugin vs-internal-log command for SN730
      [NVMe-CLI] Review comment changes to wdc plugin vs-internal-log fix for SN730
      [nvme-cli] 2nd change to address review comments
      [nvme-cli] WDC Plugin fix to Fix clear-fw-activate-history command for SN640 Drives
      [nvme-cli] WDC plugin add support for cloud-SSD-plugin-version
      [nvme cli] Add WDC plugin command vs-pcie-stats [nvme cli] Fix vs-smart-add-log min/max user data erase counts
      [nvme cli] Fix drive capabilities to meet OCP Spec
      [nvme cli] Add Customer Serial Num to vs-drive-info command
      [NVME-CLI] WDC Plugin Fixes for SN-730   vs-nand-stats not printing json format   vs-nand-stats not printing raw format for several fields   vs-temperature-stats not printing json format   vs-drive-info not printing json format
      Fix build failure from incorrect indenting
      [nvme-cli] WDC plugin fixes for vs-fw-activate-history command   Change to use Power on Hours instead of Timestamp in certain cases   Fix Entry order so entries are displayed oldest to newest
      [nvme-cli] Add support for 0x2720 PCI Device ID
      [nvme-cli] Change to set default DA for SN730
      [nvme-cli] Add support for WDC Plugin cloud-SSD-plugin-version to SN355
      [nvme-cli] Fix Max/Min User data erase counts displayed in 0xC2 Log Page
      [NVMe-CLI] Add support for new customer ids to WDC plugin commmands
      [NVMe-CLI] SN730 Updates for FW Maintenance Release

Jonathan Teh (1):
      nvme-print: Show more async event config fields

Keith Busch (17):
      fix address print format
      provide value bounds check on numerical lists
      Merge branch 'ErwanAliasr1-evelu-feature'
      fix null string compiler warning
      fix 'list' verbose for controller namespaces
      Merge branch 'master' of https://github.com/hanumanthuh/nvme-cli into hanumanthuh-master
      Merge branch 'hanumanthuh-master'
      Merge branch 'master' into dst/fix
      Merge branch 'ganaidu707-dst/fix'
      fix 32-bit compile
      Merge branch 'HMT' of https://github.com/cgdeveloper1/nvme-cli into cgdeveloper1-HMT
      Merge branch 'cgdeveloper1-HMT'
      micron printf for 64-bit on 32-bit archs
      Squashed commit of the following:
      Merge branch 'fixes' of https://github.com/mwilck/nvme-cli into mwilck-fixes
      add timeout parameter to get-lba-status
      tag v1.14

Klaus Jensen (3):
      fix dsm and copy range setup
      zns: do not check metadata when pract is set
      zns: support piremap flag for zone append

Martin Belanger (1):
      print device name when creating a persistent device

Martin George (3):
      fabrics: permit kato int argument for discovery controllers
      fabrics: update discovery.conf error message
      fabrics: ensure zero kato for non-persistent controllers

Martin Wilck (9):
      do_discover: free cfg.device when resetting it
      nvme-connect-all(1): fix documentation for --quiet/-S
      nvme: add some simplifying macros for __attribute__((cleanup()))
      nvme-cli: add generic logging functionality
      nvme: convert some function arguments from "char *" to "const char *"
      fabrics: use "const char *" in struct config
      fabrics: fix some memory leaks
      fabrics: fix invalid memory access in discover_from_conf_file()
      fabrics: export symbols required for monitor functionality

Max Gurtovoy (1):
      nvme: add NVIDIA plugin for NVMe SNAP controllers

Minwoo Im (10):
      Add missing sub-command links from main man page
      zns: fix showing system error in report_zones
      nvme: set block size to blkdev before re-read partition
      nvme: refactor S_ISCHR/S_ISBLK with helpers
      nvme-print: fix Namespace ID to decimal format
      nvme-topology: fix returning invalid value in scan_subsystems()
      zns: print select_all field for Zone Management Send
      nvme-status: return negative status if !errno
      nvme: remove spurious command show 'rsvd'
      nvme-topology: fix build error for unused variable

Nate Roiger (2):
      Identify Primary Controller Capabilities support
      Address PR comments: Remove obsolete format options; Add JSON output.

Niklas Cassel (1):
      nvme-print: fix ZNS MAR/MOR print format

Sagi Grimberg (1):
      nvme-topology: have list-subsys print only controllers with attached namespace

Steven Seungcheol Lee (3):
      nvme.spec.in: using specific directory for nvme command on %post
      Makefile: remove duplicated line for zns.o
      nvme: Remove invalid device node from nvme list

Tomasz Zawadzki (4):
      add path to nvme list
      report scandir errors in legacy_list
      print topology for NVMe nodes in kernel and path
      skip display of missing controller fields

Zhangyi Huo (1):
      feat: clear-error-log support

asavah (1):
      fix missing sd-id128 include

dingjian (6):
      style: modify a prompt word
      chore: smart-log-add add more project support
      feat: support io latency histogram
      style: rename function
      feat: support high latency log
      feat: add timstamp support(Optional)

duanhaoqiang (1):
      Update nvme.c

swamytk (1):
      Fix: Seagate Uncorrectable Read Error Count reported twice #686

Signed-off-by: Keith Busch <kbusch@kernel.org>
4 years agoZN-350 changes
Akhilesh RN [Tue, 20 Apr 2021 07:38:15 +0000 (13:08 +0530)]
ZN-350 changes

4 years agonvme: add one space around the operand and operator in d_raw
Gollu Appalanaidu [Wed, 7 Apr 2021 10:10:21 +0000 (15:40 +0530)]
nvme: add one space around the operand and operator in d_raw

Signed-off-by: Gollu Appalanaidu <anaidu.gollu@samsung.com>
4 years agonvme: add space in persistent event log desc between words
Gollu Appalanaidu [Thu, 8 Apr 2021 11:42:02 +0000 (17:12 +0530)]
nvme: add space in persistent event log desc between words

Signed-off-by: Gollu Appalanaidu <anaidu.gollu@samsung.com>
4 years agonvme: remove buf allocation check since NULL free is acceptable
Gollu Appalanaidu [Thu, 8 Apr 2021 12:16:13 +0000 (17:46 +0530)]
nvme: remove buf allocation check since NULL free is acceptable

Cleaning up all the nvme-cli source filses where buffer allocation
check is ther before free up, NULL free is acceptable perfectly as
Chaitanya mentioned in another patch.

Signed-off-by: Gollu Appalanaidu <anaidu.gollu@samsung.com>
4 years agonvme-print: fix io-command set profile feature
Gollu Appalanaidu [Sat, 17 Apr 2021 19:13:49 +0000 (00:43 +0530)]
nvme-print: fix io-command set profile feature

IO Command Set Profile feature with FID 0x19 in TP 4056d
CQE CDW0 value printing is incorrect, fix that.

Signed-off-by: Gollu Appalanaidu <anaidu.gollu@samsung.com>
4 years agoadd timeout parameter to get-lba-status
Keith Busch [Thu, 15 Apr 2021 04:16:27 +0000 (21:16 -0700)]
add timeout parameter to get-lba-status

The spec suggests completing the command may take longer than typical
commands, so allow the user specify the timeout.

Link: https://github.com/linux-nvme/nvme-cli/issues/1010
Signed-off-by: Keith Busch <kbusch@kernel.org>
4 years agozns: for zra report zone make sure data len is set
Chaitanya Kulkarni [Wed, 31 Mar 2021 02:03:39 +0000 (19:03 -0700)]
zns: for zra report zone make sure data len is set

Make sure for the Zone Receive Action data length is set by the user.

Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
4 years agozns: NULL arg to free is perfectly acceptable
Chaitanya Kulkarni [Wed, 31 Mar 2021 02:03:38 +0000 (19:03 -0700)]
zns: NULL arg to free is perfectly acceptable

Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
4 years agozns: NULL arg to free is perfectly acceptable
Chaitanya Kulkarni [Wed, 31 Mar 2021 02:03:37 +0000 (19:03 -0700)]
zns: NULL arg to free is perfectly acceptable

Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
4 years agozns: return response with status to errno conversion
Gollu Appalanaidu [Wed, 7 Apr 2021 11:15:02 +0000 (16:45 +0530)]
zns: return response with status to errno conversion

Currently ZNS plugin nvme device status code 15 bits
being returned to shell which will take only 8 bits.
Convert the nvme status code to linux standard errno
with the help of status_to_errno function and return.

Signed-off-by: Gollu Appalanaidu <anaidu.gollu@samsung.com>
4 years agonvme-topology: fix build error for unused variable
Minwoo Im [Tue, 6 Apr 2021 12:46:09 +0000 (21:46 +0900)]
nvme-topology: fix build error for unused variable

Fix the following build error.

nvme-topology.c: In function ‘uuid_from_systemd’:
nvme-topology.c:766:8: error: unused variable ‘ret’ [-Werror=unused-variable]
  766 |  char *ret;
      |        ^~~

Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>
4 years agonvme-print: print phase tag field separately in error-log fields
Gollu Appalanaidu [Thu, 25 Mar 2021 17:58:30 +0000 (23:28 +0530)]
nvme-print: print phase tag field separately in error-log fields

Status Field in error-log 16 bits, 15 bits from q to 15 are represents
status field and 0th bit is phase tag, print phase tag seperately, in
1.4b spec its been clearly called out.

Signed-off-by: Gollu Appalanaidu <anaidu.gollu@samsung.com>
4 years agoFix return type for arconfig functions
Francisco Munoz [Fri, 26 Mar 2021 22:46:33 +0000 (15:46 -0700)]
Fix return type for arconfig functions

Changed function signatures to int in order to return negative
values on errors

Signed-off-by: Francisco Munoz <francisco.munoz.ruiz@intel.com>