]> www.infradead.org Git - users/sagi/nvme-cli.git/log
users/sagi/nvme-cli.git
3 years agozns: Add list command
Andreas Hindborg [Mon, 13 Sep 2021 13:13:53 +0000 (13:13 +0000)]
zns: Add list command

Signed-off-by: Andreas Hindborg <andreas.hindborg@wdc.com>
3 years agoupdate libnvme
Keith Busch [Mon, 27 Sep 2021 20:21:28 +0000 (13:21 -0700)]
update libnvme

Signed-off-by: Keith Busch <kbusch@kernel.org>
3 years agofabrics: restore discover_from_conf_file to actually work
Sagi Grimberg [Sun, 26 Sep 2021 18:27:49 +0000 (21:27 +0300)]
fabrics: restore discover_from_conf_file to actually work

With all the rework, discover_from_conf_file was completely
broken. Have both discover and connect-all working with
params passed from /etc/nvme/discovery.conf

Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
3 years agoOptane clears latency stats evey time the log page is pulled.
Francisco Munoz [Thu, 23 Sep 2021 00:10:23 +0000 (17:10 -0700)]
Optane clears latency stats evey time the log page is pulled.
We only perfom a single query and place the result in a byte
array. Then,  we determine the right log page layout in terms of
the media version.

Signed-off-by: Francisco Munoz <francisco.munoz.ruiz@intel.com>
3 years agoFix error handling in `list-ctrl`
Andreas Hindborg [Wed, 15 Sep 2021 14:20:44 +0000 (14:20 +0000)]
Fix error handling in `list-ctrl`

This patch fixes a bug in `list-ctrl` where an error code was misinterpreted.

Signed-off-by: Andreas Hindborg <andreas.hindborg@wdc.com>
3 years agoBinary output support for list-ctrl command
Nate Roiger [Thu, 16 Sep 2021 13:56:28 +0000 (08:56 -0500)]
Binary output support for list-ctrl command

Signed-off-by: Nate Roiger <nate.roiger@hpe.com>
3 years agoRemove unused command line argument for `nvme list`
Andreas Hindborg [Wed, 15 Sep 2021 18:35:13 +0000 (18:35 +0000)]
Remove unused command line argument for `nvme list`

Remove the `--directory` argument for `nvme list`. The option has been without
effect since nvme-cli moved to libnvme.

Signed-off-by: Andreas Hindborg <andreas.hindborg@wdc.com>
3 years agoFix report zones buffer allocation
Youngjae Lee [Fri, 3 Sep 2021 01:32:21 +0000 (10:32 +0900)]
Fix report zones buffer allocation

3 years agoFix git submodule command
Youngjae Lee [Wed, 1 Sep 2021 12:59:41 +0000 (21:59 +0900)]
Fix git submodule command

3 years agoFix the memory leak for nvme discover command
Wu Bo [Tue, 31 Aug 2021 02:36:57 +0000 (10:36 +0800)]
Fix the memory leak for nvme discover command

3 years agonvme-plugins: add project info for smart-log-add
Jinhua Huang [Mon, 23 Aug 2021 10:04:10 +0000 (18:04 +0800)]
nvme-plugins: add project info for smart-log-add

add project info for smart-log-add command to get the correct log page format

3 years agofix file permissions (nvme-print.c)
Keith Busch [Tue, 24 Aug 2021 18:49:16 +0000 (11:49 -0700)]
fix file permissions (nvme-print.c)

It's not executable.

Signed-off-by: Keith Busch <kbusch@kernel.org>
3 years agoupdate readme to indicate libnvme submodule
Keith Busch [Mon, 23 Aug 2021 16:23:59 +0000 (09:23 -0700)]
update readme to indicate libnvme submodule

Signed-off-by: Keith Busch <kbusch@kernel.org>
3 years agofix list command bugs
chengjike [Mon, 23 Aug 2021 12:40:47 +0000 (20:40 +0800)]
fix list command bugs

When execute the "nvme list" command in a multipath environment, it generate a core dump. Such as:
[root@localhost ~]# nvme list
Node                  SN                   Model                                    Namespace Usage                      Format           FW Rev
--------------------- -------------------- ---------------------------------------- --------- -------------------------- ---------------- --------
Segmentation fault (core dumped)
[root@localhost ~]#

The reason is that when a device is a multipath disk, the value of "nvme_ns_t->c" is NULL.
This also happens when you execute "nvme list -o json" and "nvme list -v -o json" commands.

Signed-off-by: chengjike <chengjike.cheng@huawei.com>
Signed-off-by: Keith Busch <kbusch@kernel.org>
3 years agoMove to upstream libnvme
Hannes Reinecke [Thu, 12 Aug 2021 08:12:59 +0000 (10:12 +0200)]
Move to upstream libnvme

As all patches have been merged into upstream libnvme we can
switch back to the upstream tree.

Signed-off-by: Hannes Reinecke <hare@suse.de>
3 years agofabrics: skip '/dev/' prefix for persistent discovery controllers
Hannes Reinecke [Thu, 12 Aug 2021 08:19:53 +0000 (10:19 +0200)]
fabrics: skip '/dev/' prefix for persistent discovery controllers

When calling 'nvme discover --device' one has to remember to strip the
'/dev/' prefix from the nvme controller device name, which is
quite cumbersome and pointless, as we might as well do it internally.
So be a bit more lenient and accept full device node names on discover.

Signed-off-by: Hannes Reinecke <hare@suse.de>
3 years agofabrics: skip '/dev/' prefix on disconnect
Hannes Reinecke [Thu, 12 Aug 2021 08:19:53 +0000 (10:19 +0200)]
fabrics: skip '/dev/' prefix on disconnect

When calling 'nvme disconnect -d' one has to remember to strip the
'/dev/' prefix from the nvme controller device name, which is
quite cumbersome and pointless, as we might as well do it internally.
So be a bit more lenient and accept full device node names on disconnect.

Signed-off-by: Hannes Reinecke <hare@suse.de>
3 years agofabrics: rework nvmf_discover()
Hannes Reinecke [Thu, 12 Aug 2021 06:28:12 +0000 (08:28 +0200)]
fabrics: rework nvmf_discover()

The logic to check for matching controller devices was backwards,
and resulted in stale discovery controllers upon failure.
So rework the logic to first scan the controller device (if present),
and then check if it matches the command line options.
And with that we can rework the entire logic to be easier to follow.

Signed-off-by: Hannes Reinecke <hare@suse.de>
3 years agofabrics: fixup controller name on disconnect
Hannes Reinecke [Thu, 12 Aug 2021 07:34:15 +0000 (09:34 +0200)]
fabrics: fixup controller name on disconnect

We cannot reference the controller once it's disconnected; use
the argument instead.

Signed-off-by: Hannes Reinecke <hare@suse.de>
3 years agoutil/argconfig: fixup OPT_INCR
Hannes Reinecke [Thu, 12 Aug 2021 07:03:57 +0000 (09:03 +0200)]
util/argconfig: fixup OPT_INCR

To implement OPT_INCR we cannot simply increase the value in
'value_addr', as getopt() will load the value in 'val' into this
location upon every call to getopt().
As such we need to increase the 'val' setting for getopt() to
get the correct behaviour.

Signed-off-by: Hannes Reinecke <hare@suse.de>
3 years agofabrics: remove misplaced 'return 0'
Hannes Reinecke [Wed, 11 Aug 2021 16:04:01 +0000 (18:04 +0200)]
fabrics: remove misplaced 'return 0'

Remove a misplaced 'return 0' in discover_from_conf_file().

Signed-off-by: Hannes Reinecke <hare@suse.de>
3 years agogithub-workflow: do not build for PPC
Hannes Reinecke [Wed, 11 Aug 2021 08:38:43 +0000 (10:38 +0200)]
github-workflow: do not build for PPC

For some reason the library is build for PowerPC in addition to the
standard target, but that will make the CI unhappy as libnvme will
build and execute the 'configurator' program during building.
Which clearly will fail, as libnvme doesn't distinguish between
a host and target compiler.
So kill this step as it's of doubtful value anyway.

Signed-off-by: Hannes Reinecke <hare@suse.de>
3 years agonvme: fixup 'show-hostnqn' command
Hannes Reinecke [Wed, 11 Aug 2021 08:32:23 +0000 (10:32 +0200)]
nvme: fixup 'show-hostnqn' command

CI complained about a missing format for fprintf().

Signed-off-by: Hannes Reinecke <hare@suse.de>
3 years agonvme: use libnvme for printing status
Hannes Reinecke [Wed, 11 Aug 2021 07:50:15 +0000 (09:50 +0200)]
nvme: use libnvme for printing status

With commit fe62ba7 ("util: Add nvme_status_to_string()") libnvme
now has a 'nvme_status_to_string()' function, which clashes with
the one provided here.
So drop the function in favour of the libnvme one, and convert
all plugins to use nvme_show_status().

Signed-off-by: Hannes Reinecke <hare@suse.de>
3 years agogithub workflow: install json-c library
Hannes Reinecke [Wed, 11 Aug 2021 08:21:06 +0000 (10:21 +0200)]
github workflow: install json-c library

To avoid failures during CI run.

Signed-off-by: Hannes Reinecke <hare@suse.de>
3 years agoUpdate workflow to checkout libnvme
Hannes Reinecke [Wed, 11 Aug 2021 08:14:54 +0000 (10:14 +0200)]
Update workflow to checkout libnvme

Signed-off-by: Hannes Reinecke <hare@suse.de>
3 years agoUpdate libnvme integration for disconnect rename
Keith Busch [Mon, 9 Aug 2021 20:27:20 +0000 (13:27 -0700)]
Update libnvme integration for disconnect rename

Signed-off-by: Keith Busch <kbusch@kernel.org>
4 years agofabrics: remove log.c in favour of libnvme routines
Hannes Reinecke [Mon, 14 Jun 2021 14:26:45 +0000 (16:26 +0200)]
fabrics: remove log.c in favour of libnvme routines

The logging functions have been ported to libnvme, so remove our
copy and replace the 'quiet' parameter with the logging equivalent.

Signed-off-by: Hannes Reinecke <hare@suse.de>
4 years agoplugins: do not include "suffix.h" and "argconfig.h"
Hannes Reinecke [Wed, 16 Jun 2021 14:13:58 +0000 (16:13 +0200)]
plugins: do not include "suffix.h" and "argconfig.h"

Not required for most plugins.

Signed-off-by: Hannes Reinecke <hare@suse.de>
4 years agoConvert to libnvme
Hannes Reinecke [Wed, 16 Jun 2021 13:58:04 +0000 (15:58 +0200)]
Convert to libnvme

Convert cli and plugins to libnvme and remove old files.

Signed-off-by: Hannes Reinecke <hare@suse.de>
4 years agonvme: split off nvme-private.h header file
Hannes Reinecke [Wed, 16 Jun 2021 09:06:18 +0000 (11:06 +0200)]
nvme: split off nvme-private.h header file

Split off a private header file from nvme.h to contain all definitions
being replaced by libnvme.

Signed-off-by: Hannes Reinecke <hare@suse.de>
4 years agonvme: remove lightnvm
Hannes Reinecke [Wed, 16 Jun 2021 08:21:12 +0000 (10:21 +0200)]
nvme: remove lightnvm

Obsolete.

Signed-off-by: Hannes Reinecke <hare@suse.de>
4 years agolibnvme: Add libnvme submodule
Keith Busch [Thu, 4 Mar 2021 22:02:24 +0000 (14:02 -0800)]
libnvme: Add libnvme submodule

Signed-off-by: Keith Busch <kbusch@kernel.org>
Signed-off-by: Hannes Reinecke <hare@suse.de>
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>
4 years agoModify lat-stats cmd to cope with optane bucket format
Francisco Munoz [Fri, 26 Mar 2021 22:36:58 +0000 (15:36 -0700)]
Modify lat-stats cmd to cope with optane bucket format

Optane lat-stat thresholds are 8 bytes per bucket. Also
the amout of buckets is smaller when compared to nand ssds.
This change allows to query both types of ssds transparently.

Also added the command line option to print lat-stats in json
and introduced a plugin function to modify read/write bucket
thresholds for specific media versions.

Signed-off-by: Francisco Munoz <francisco.munoz.ruiz@intel.com>
4 years agonvme: Remove invalid device node from nvme list
Steven Seungcheol Lee [Mon, 5 Apr 2021 06:07:27 +0000 (15:07 +0900)]
nvme: Remove invalid device node from nvme list

normal print result
Node             SN                   Model                                    Namespace Usage                      Format           FW Rev
---------------- -------------------- ---------------------------------------- --------- -------------------------- ---------------- --------
/dev/nvme0n1     S39XNX0J6C3BBA       91721190020910SAM0PM1725A0004T00035000   1           0.00   B /   4.19  TB      4 KiB +  0 B   MVP41G7A
/dev/nvme0n2     S39XNX0J6C3BBA       91721190020910SAM0PM1725A0004T00035000   2           4.19  MB /   4.19  MB      4 KiB +  0 B   MVP41G7A

json print result (nvme0c0n* are invaild devices name, so will be removed from list)
[root@localhost nvme-cli]# nvme list -o json
{
  "Devices" : [
    {
      "NameSpace" : 1,
      "DevicePath" : "/dev/nvme0c0n1",
      ...
      "SectorSize" : 1
    },
    {
      "NameSpace" : 2,
      "DevicePath" : "/dev/nvme0c0n2",
      ...
      "SectorSize" : 1
    },
    {
      "NameSpace" : 1,
      "DevicePath" : "/dev/nvme0n1",
      ...
      "SectorSize" : 4096
    },
    {
      "NameSpace" : 2,
      "DevicePath" : "/dev/nvme0n2",
      ...
      "SectorSize" : 4096
    }
  ]
}

Signed-off-by: Steven Seungcheol Lee <sc108.lee@samsung.com>
4 years agonvme: add rae field in sanitize-log
Gollu Appalanaidu [Mon, 5 Apr 2021 10:11:47 +0000 (15:41 +0530)]
nvme: add rae field in sanitize-log

Added Retain Asynchronous Event (RAE) field for sanitize
log.

Signed-off-by: Gollu Appalanaidu <anaidu.gollu@samsung.com>
4 years agoMakefile: remove duplicated line for zns.o
Steven Seungcheol Lee [Mon, 5 Apr 2021 11:11:17 +0000 (20:11 +0900)]
Makefile: remove duplicated line for zns.o

code duplicated while squashing the commits

Signed-off-by: Steven Seungcheol Lee <sc108.lee@samsung.com>