]> www.infradead.org Git - users/hch/nvme-cli.git/log
users/hch/nvme-cli.git
6 years agoMerge pull request #425 from bdeyal/plugins_refactor
Keith Busch [Wed, 24 Oct 2018 17:09:48 +0000 (11:09 -0600)]
Merge pull request #425 from bdeyal/plugins_refactor

Refactor plugins in a file hierarchy

6 years agoRefactor plugins in a file hierarchy
Eyal Ben David [Wed, 24 Oct 2018 15:08:16 +0000 (18:08 +0300)]
Refactor plugins in a file hierarchy

6 years agowdc: Fix strncpy warning
Keith Busch [Wed, 24 Oct 2018 16:21:56 +0000 (10:21 -0600)]
wdc: Fix strncpy warning

Some compilers were complaining copying from the constant source was
truncating it. The size is supposed to protect the destination buffer,
so this patch uses that size instead.

Signed-off-by: Keith Busch <keith.busch@intel.com>
6 years agoRe-gen documentation for new files
Keith Busch [Fri, 19 Oct 2018 17:16:43 +0000 (11:16 -0600)]
Re-gen documentation for new files

Signed-off-by: Keith Busch <keith.busch@intel.com>
6 years agonvme-cli wdc plugin: Add documentation for pfail dump.
Dong Ho [Thu, 18 Oct 2018 21:06:57 +0000 (21:06 +0000)]
nvme-cli wdc plugin: Add documentation for pfail dump.

Signed-off-by: Keith Busch <keith.busch@intel.com>
6 years agonvme-cli wdc plugin: Add get pfail dump command.
Dong Ho [Thu, 18 Oct 2018 21:06:53 +0000 (21:06 +0000)]
nvme-cli wdc plugin: Add get pfail dump command.

Signed-off-by: Keith Busch <keith.busch@intel.com>
6 years agoMerge pull request #420 from bsdimp/portable
Keith Busch [Fri, 19 Oct 2018 13:49:41 +0000 (07:49 -0600)]
Merge pull request #420 from bsdimp/portable

Portability fixes

6 years agoMerge pull request #421 from bdeyal/fix_rpm
Keith Busch [Mon, 15 Oct 2018 16:35:11 +0000 (10:35 -0600)]
Merge pull request #421 from bdeyal/fix_rpm

nvme-cli make rpm:  fix bash completion and require in nvme.spec.in

6 years agonvme.spec.in : fix bash completion path, require
Eyal Ben David [Mon, 15 Oct 2018 16:10:46 +0000 (19:10 +0300)]
nvme.spec.in : fix bash completion path, require

6 years agoUpdate documentation
Keith Busch [Fri, 12 Oct 2018 19:03:07 +0000 (13:03 -0600)]
Update documentation

Signed-off-by: Keith Busch <keith.busch@intel.com>
6 years agonvme-cli: Add help text for wdc-plugin command vs-internal-log. Update help text...
Jeffrey Lien [Fri, 12 Oct 2018 15:50:35 +0000 (15:50 +0000)]
nvme-cli: Add help text for wdc-plugin command vs-internal-log. Update help text for wdc-plugin command cap-diag.

Signed-off-by: Jeff Lien <jeff.lien@wdc.com>
6 years agonvme-cli: Add wdc-plugin command vs-internal-log and update wdc-plug cap-diag command...
Jeffrey Lien [Fri, 12 Oct 2018 15:50:05 +0000 (15:50 +0000)]
nvme-cli: Add wdc-plugin command vs-internal-log and update wdc-plug cap-diag command with transfer-size parameter.

Signed-off-by: Jeff Lien <jeff.lien@wdc.com>
6 years agoNVMe-CLI WDC Plugin - Simplify the device id checking routines.
Jeffrey Lien [Tue, 9 Oct 2018 18:10:51 +0000 (18:10 +0000)]
NVMe-CLI WDC Plugin - Simplify the device id checking routines.

This change will make one common function that will retrieve the pci
vendor and device id's and check them for a match of the passed in
id's.

Signed-off-by: Jeff Lien <jeff.lien@wdc.com>
6 years agoMerge pull request #418 from sephalon/oe-packaging
Keith Busch [Tue, 9 Oct 2018 13:46:50 +0000 (07:46 -0600)]
Merge pull request #418 from sephalon/oe-packaging

Makefile: fix bash completion install path

6 years agoMerge pull request #417 from PeterDaveHelloKitchen/update-README.md
Keith Busch [Tue, 9 Oct 2018 13:44:24 +0000 (07:44 -0600)]
Merge pull request #417 from PeterDaveHelloKitchen/update-README.md

Enable code block syntax highlight in README.md

6 years agoMakefile: fix bash completion install path
Stefan Wiehler [Tue, 9 Oct 2018 09:26:34 +0000 (11:26 +0200)]
Makefile: fix bash completion install path

Change path to bash-completion upstream recommendation used by most
distributions.

Signed-off-by: Stefan Wiehler <stefan.wiehler@missinglinkelectronics.com>
6 years agoEnable code block syntax highlight in README.md
Peter Dave Hello [Tue, 9 Oct 2018 08:58:49 +0000 (16:58 +0800)]
Enable code block syntax highlight in README.md

6 years agonvme-cli: fix a typo
Rami Rosen [Fri, 5 Oct 2018 16:57:54 +0000 (19:57 +0300)]
nvme-cli: fix a typo

This patch fixes a typo in nvme-cli usage text.

Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Rami Rosen <ramirose@gmail.com>
Signed-off-by: Keith Busch <keith.busch@intel.com>
6 years agonvme-cli: fix ioctl argument
Warner Losh [Fri, 5 Oct 2018 04:08:01 +0000 (22:08 -0600)]
nvme-cli: fix ioctl argument

The command argument for ioctl is unsigned long, not int. Fix all the
places that we pass cmd through to the ioctl call to handle it as an
unsigned long. This prevents a sign extension bug when IOCTL commands
encode with the top bit set.

6 years agoUse standard interfaces to get timezone offsets.
M. Warner Losh [Thu, 4 Oct 2018 21:37:17 +0000 (15:37 -0600)]
Use standard interfaces to get timezone offsets.

Use the tm_gmtoff returned from localtime() rather than the global
timezone.  The formal is more portable, while the latter is specific
to glibc.  There's no good reason to use the glibc specific interface.

6 years agoInitialize line.
M. Warner Losh [Thu, 4 Oct 2018 21:11:00 +0000 (15:11 -0600)]
Initialize line.

Ensure line is initialized to NULL. This ensures that the return
expression doesn't use a uninitialized variable when we can't read sys
nodes.

6 years agoWe don't need to include linux/types.h here.
Warner.Losh [Thu, 4 Oct 2018 20:51:13 +0000 (14:51 -0600)]
We don't need to include linux/types.h here.

6 years agonvme-cli: remove endian.h
Warner Losh [Thu, 4 Oct 2018 15:11:48 +0000 (09:11 -0600)]
nvme-cli: remove endian.h

endian.h isn't needed, so remove it.

6 years agoInclude sys/stat.h
Warner Losh [Thu, 4 Oct 2018 05:34:23 +0000 (23:34 -0600)]
Include sys/stat.h

S_* mode bits are defined in sys/stat.h, per POSIX. Include this for
extra portability.

6 years agoInclude libgen.h for basename prototype.
Warner Losh [Thu, 4 Oct 2018 05:29:04 +0000 (23:29 -0600)]
Include libgen.h for basename prototype.

Also, convert open_dev to take a char * and remove the cast from where
it's called. basenmae takes a char * and modifies the string. In this
case, such modifications are fine and only the const char * type was
in error.

6 years agoRemove unnecessary linux/types.h include.
Warner Losh [Thu, 4 Oct 2018 05:23:33 +0000 (23:23 -0600)]
Remove unnecessary linux/types.h include.

6 years agoRemove unnecessary asm/byteorder.h
Warner Losh [Thu, 4 Oct 2018 05:21:48 +0000 (23:21 -0600)]
Remove unnecessary asm/byteorder.h

These includes aren't necessary, so remove them.

6 years agoUse sys/ioctl.h to pull in definitions.
Warner Losh [Thu, 4 Oct 2018 05:18:38 +0000 (23:18 -0600)]
Use sys/ioctl.h to pull in definitions.

_IO* are part of the ioctl intereface, so use the more portable
sys/ioctl.h to get the definitions. Eliminate all uses of linux/fs.h
that were needed only for this.

6 years agonvme-cli: make read error handling uniform
Chaitanya Kulkarni [Thu, 27 Sep 2018 23:13:58 +0000 (16:13 -0700)]
nvme-cli: make read error handling uniform

Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
6 years agonvme-cli: fix indentation for dir_[send/receive]
Chaitanya Kulkarni [Mon, 1 Oct 2018 18:32:54 +0000 (11:32 -0700)]
nvme-cli: fix indentation for dir_[send/receive]

This is a cleanup patch to get rid of the inconsistent indentation
for the dir_send() and dir_receive() functions.

Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
6 years agonvme-cli: report subsystem-reset not supported by controller
David Milburn [Wed, 26 Sep 2018 13:25:57 +0000 (08:25 -0500)]
nvme-cli: report subsystem-reset not supported by controller

Add a little more description for "nvme subsystem-reset"
failures, currently driver reports "Inappropriate ioctl
for device".

$ nvme subsystem-reset /dev/nvme0
Subsystem-reset: Inappropriate ioctl for device

With this change report controller doesn't support
NVM Subsystem Reset.

$ nvme subsystem-reset /dev/nvme0
Subsystem-reset: NVM Subsystem Reset not supported.

6 years agonvme-cli: prevent resv action field overflow
Austin J Eberle [Tue, 25 Sep 2018 22:45:58 +0000 (16:45 -0600)]
nvme-cli: prevent resv action field overflow

Signed-off-by: Austin Eberle <ajeberle@us.ibm.com>
Signed-off-by: Keith Busch <keith.busch@intel.com>
6 years agoFix nvme test device selection to use controller value defined in the config.json...
Jeffrey Lien [Tue, 25 Sep 2018 14:45:07 +0000 (14:45 +0000)]
Fix nvme test device selection to use controller value defined in the config.json file. Before this fix, the value was hard coded to nvme0.

Signed-off-by: Jeff Lien <jeff.lien@wdc.com>
6 years agoAdd PCI device id checking for the WDC plugin commands.
Jeffrey Lien [Tue, 25 Sep 2018 14:58:34 +0000 (14:58 +0000)]
Add PCI device id checking for the WDC plugin commands.

Signed-off-by: Jeff Lien <jeff.lien@wdc.com>
6 years agoMerge branch 'master' of https://github.com/linux-nvme/nvme-cli
Keith Busch [Fri, 21 Sep 2018 19:30:59 +0000 (13:30 -0600)]
Merge branch 'master' of https://github.com/linux-nvme/nvme-cli

6 years agoUpdate gitignore for generated test files
Keith Busch [Fri, 21 Sep 2018 19:30:25 +0000 (13:30 -0600)]
Update gitignore for generated test files

Signed-off-by: Keith Busch <keith.busch@intel.com>
6 years agonvme-cli: tests: Add get_id_ctrl function
Dong Ho [Fri, 21 Sep 2018 18:10:39 +0000 (18:10 +0000)]
nvme-cli: tests: Add get_id_ctrl function

Signed-off-by: Dong Ho <dong.ho@wdc.com>
6 years agonvme-cli: tests: fix id_ns test coding style
Dong Ho [Fri, 21 Sep 2018 18:10:13 +0000 (18:10 +0000)]
nvme-cli: tests: fix id_ns test coding style

Simplified and fixed coding style to conform with the style of all other tests.

Signed-off-by: Dong Ho <dong.ho@wdc.com>
6 years agonvme-cli: tests: fix id_ctrl test coding style
Dong Ho [Fri, 21 Sep 2018 18:09:35 +0000 (18:09 +0000)]
nvme-cli: tests: fix id_ctrl test coding style

Simplified and fixed coding style to conform with the style of all other tests.

Signed-off-by: Dong Ho <dong.ho@wdc.com>
6 years agonvme-cli: tests: fix fw_log test coding style
Dong Ho [Fri, 21 Sep 2018 18:06:51 +0000 (18:06 +0000)]
nvme-cli: tests: fix fw_log test coding style

Simplified and fixed coding style to conform with the style of all other tests.

Signed-off-by: Dong Ho <dong.ho@wdc.com>
6 years agoMerge pull request #413 from bdeyal/fix_attach_ns_segfault
Keith Busch [Thu, 20 Sep 2018 15:32:14 +0000 (09:32 -0600)]
Merge pull request #413 from bdeyal/fix_attach_ns_segfault

attach-ns : fix segfault for ctrl list wrong input

6 years agonvme-cli: print "\n" after nvme list-subsys -o json
Yi Zhang [Thu, 20 Sep 2018 11:41:57 +0000 (19:41 +0800)]
nvme-cli: print "\n" after nvme list-subsys -o json

Signed-off-by: Yi Zhang <yi.zhang@redhat.com>
6 years agonvme-cli: kill nvme_passthru_admin()
Hannes Reinecke [Thu, 20 Sep 2018 09:09:39 +0000 (11:09 +0200)]
nvme-cli: kill nvme_passthru_admin()

The seagate plugin is the only one using it, and it's identical
to nvme_get_log13(). So replace the invocation with nvme_get_log13()
and remove the function.

Signed-off-by: Hannes Reinecke <hare@suse.com>
6 years agonvme-cli: Add 'rae' argument to nvme_get_log()
Hannes Reinecke [Thu, 20 Sep 2018 09:09:38 +0000 (11:09 +0200)]
nvme-cli: Add 'rae' argument to nvme_get_log()

We should be setting the 'rae' bit when sending a log page; we don't
want to accidentally overwriting any outstanding AENs when calling
nvme-cli.

Signed-off-by: Hannes Reinecke <hare@suse.com>
6 years agoseagate-nvme: fixup coding style
Hannes Reinecke [Thu, 20 Sep 2018 09:09:37 +0000 (11:09 +0200)]
seagate-nvme: fixup coding style

One really should try to adhere to one coding style in one file ...

Signed-off-by: Hannes Reinecke <hare@suse.com>
6 years agonvme-discover: Re-check generation counter after log page transfer
Hannes Reinecke [Thu, 20 Sep 2018 09:09:36 +0000 (11:09 +0200)]
nvme-discover: Re-check generation counter after log page transfer

The log page transfer might have been split up in several chunks, so
it might happen that the generation counter changed inbetween these
transfer. Hence we need to re-fetch the header again to figure out
if there had been changes to the generation counter; if so we need
to fetch the entire page again.

Signed-off-by: Hannes Reinecke <hare@suse.com>
6 years agonvme-ioctl: retrieve log pages in 4k chunks
Hannes Reinecke [Thu, 20 Sep 2018 09:09:35 +0000 (11:09 +0200)]
nvme-ioctl: retrieve log pages in 4k chunks

Some log pages increase with the scale of the subsystem, so the
overall size might be larger than the MDTS value for that controller.
In order to avoid having to pass in the MDTS value we should restrict
the transfer size to 4k and retrieve the log page in 4k chunks.

Signed-off-by: Hannes Reinecke <hare@suse.com>
6 years agonvme-discover: Retry discovery log if the generation counter changes
Hannes Reinecke [Thu, 20 Sep 2018 09:09:34 +0000 (11:09 +0200)]
nvme-discover: Retry discovery log if the generation counter changes

If the generation counter changes we need to validate if the number
of records has changed, too.
If so we need to retry retrieving the discovery log to the most recent
values. The retry will be terminated after MAX_DISC_RETRIES (currently
set to 10) to avoid infinite recursion.

Signed-off-by: Hannes Reinecke <hare@suse.com>
6 years agoattach-ns : fix segfault for ctrl list wrong input
Eyal Ben David [Thu, 20 Sep 2018 10:14:32 +0000 (13:14 +0300)]
attach-ns : fix segfault for ctrl list wrong input

6 years agoRegen documentation
Keith Busch [Thu, 6 Sep 2018 00:18:34 +0000 (18:18 -0600)]
Regen documentation

Signed-off-by: Keith Busch <keith.busch@intel.com>
6 years agofabrics: add disconnect-all command
Sagi Grimberg [Sat, 1 Sep 2018 01:36:05 +0000 (18:36 -0700)]
fabrics: add disconnect-all command

Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
Reviewed-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Signed-off-by: Keith Busch <keith.busch@intel.com>
6 years agonvme: commonize subsystems info in a helper
Sagi Grimberg [Sat, 1 Sep 2018 01:36:04 +0000 (18:36 -0700)]
nvme: commonize subsystems info in a helper

We will want that to reuse for other ops that
will require to scan subsystems or controllers

Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
Reviewed-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Signed-off-by: Keith Busch <keith.busch@intel.com>
6 years agofabrics: don't fail empty discovery log page
Sagi Grimberg [Sat, 1 Sep 2018 01:36:03 +0000 (18:36 -0700)]
fabrics: don't fail empty discovery log page

It can be possible that discovery subsystem will not return
any valid discovery records.

Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
Reviewed-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Signed-off-by: Keith Busch <keith.busch@intel.com>
6 years agofabrics: make some arguments integers
Sagi Grimberg [Sat, 1 Sep 2018 01:36:02 +0000 (18:36 -0700)]
fabrics: make some arguments integers

Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
Reviewed-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Signed-off-by: Keith Busch <keith.busch@intel.com>
6 years agoMerge pull request #410 from RalphCorderoy/avoid-truncating-path
Keith Busch [Wed, 5 Sep 2018 22:18:55 +0000 (16:18 -0600)]
Merge pull request #410 from RalphCorderoy/avoid-truncating-path

Enlarge local char[] so snprintf(3) can't truncate path.

6 years agoEnlarge local char[] so snprintf(3) can't truncate path.
Ralph Corderoy [Wed, 5 Sep 2018 21:16:07 +0000 (22:16 +0100)]
Enlarge local char[] so snprintf(3) can't truncate path.

The path is in a char[310], contributing at most 309 chars for the ‘%s’.
‘/subsysnqn’ is a further 10.  Plus one for the NUL.
309 + 10 + 1 = 320 so sspath[319] is too short.

6 years agonvme-cli: make malloc error handling uniform
Chaitanya Kulkarni [Wed, 5 Sep 2018 19:46:23 +0000 (12:46 -0700)]
nvme-cli: make malloc error handling uniform

This patch makes malloc() memory handling uniform by using errno based
error message.

Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
6 years agoMerge pull request #407 from bdeyal/fix_nvme_list
Keith Busch [Wed, 29 Aug 2018 16:08:02 +0000 (10:08 -0600)]
Merge pull request #407 from bdeyal/fix_nvme_list

nvme list : fix nvme list output if identify failed on device

6 years agoMerge branch 'master' into fix_nvme_list
Keith Busch [Wed, 29 Aug 2018 16:07:51 +0000 (10:07 -0600)]
Merge branch 'master' into fix_nvme_list

6 years agonvme-cli: mark functions static
Chaitanya Kulkarni [Mon, 27 Aug 2018 22:31:29 +0000 (15:31 -0700)]
nvme-cli: mark functions static

Mark nvme_property() and get_nvme_subsystem_info() static.

Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
6 years agonvme-cli: make wdc plug-in functions static
Chaitanya Kulkarni [Mon, 27 Aug 2018 22:31:28 +0000 (15:31 -0700)]
nvme-cli: make wdc plug-in functions static

Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
6 years agonvme-cli: fix indentation
Chaitanya Kulkarni [Mon, 27 Aug 2018 22:31:27 +0000 (15:31 -0700)]
nvme-cli: fix indentation

Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
6 years agonvme-cli: use uniform error message for open
Chaitanya Kulkarni [Mon, 27 Aug 2018 22:31:26 +0000 (15:31 -0700)]
nvme-cli: use uniform error message for open

This patch adds errno based error message after open() system call
when open() system call fails.

Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
6 years agonvme list : fix nvme list output if identify failed on device
Eyal Ben David [Tue, 28 Aug 2018 16:49:09 +0000 (19:49 +0300)]
nvme list : fix nvme list output if identify failed on device

changed files:
nvme.c        function list()
nvme-ioctl.c  function nvme_get_nsid() : return -errno if fstat fails

6 years agonvme-cli: Fix the displayed metadata length value on Big Endian systems.
Jeff Lien [Fri, 24 Aug 2018 18:34:27 +0000 (13:34 -0500)]
nvme-cli: Fix the displayed metadata length value on Big Endian systems.

On BE systems, the metadata length value displayed as part of the
format in the nvme list command is byte swapped.  So a value of 0
appears just fine but a value of 8 bytes is displayed as 0x0800.
This patch fixes that is the value is correct for both LE and BE
systems.

Signed-off-by: Jeff Lien <jeff.lien@wdc.com>
6 years agonvme-cli: netapp plugin handle empty strings
Schremmer, Steven [Thu, 23 Aug 2018 19:33:12 +0000 (19:33 +0000)]
nvme-cli: netapp plugin handle empty strings

Handle controller fields with strings of length 0.

Signed-off-by: Steve Schremmer <steve.schremmer@netapp.com>
6 years agonvme-cli: fix scaandir() return value
Chaitanya Kulkarni [Mon, 20 Aug 2018 00:36:03 +0000 (20:36 -0400)]
nvme-cli: fix scaandir() return value

Don't use unsigned int for scandir() return value as it can return -1.

Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
6 years agonvme-cli: code cleanup for passthru() handlers
Chaitanya Kulkarni [Mon, 20 Aug 2018 00:36:05 +0000 (20:36 -0400)]
nvme-cli: code cleanup for passthru() handlers

Get rid of the duplicate free of the metadata pointer in case memory
allocation fails for the data pointer.

Close wfd file in case of any resource allocation failure if
applicable.

Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
6 years agonvme-cli: fix dead-code nvmf log page discovery
Chaitanya Kulkarni [Mon, 20 Aug 2018 00:36:07 +0000 (20:36 -0400)]
nvme-cli: fix dead-code nvmf log page discovery

Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
6 years agonvme-cli: remove always true condition for u8
Chaitanya Kulkarni [Mon, 20 Aug 2018 00:36:04 +0000 (20:36 -0400)]
nvme-cli: remove always true condition for u8

Get rid of the always true condition of (cfg.owpass >= 0) since
cfg.owpass is defined as __u8.

Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
6 years agonvme-cli: don't use unsigned for fd in lnvm-nvme.c
Chaitanya Kulkarni [Mon, 20 Aug 2018 00:36:06 +0000 (20:36 -0400)]
nvme-cli: don't use unsigned for fd in lnvm-nvme.c

Change the data type of the fd from unsigned int -> int.

Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
6 years agonvme-cli: fix sparse warnings for declaration
Chaitanya Kulkarni [Sun, 19 Aug 2018 16:57:31 +0000 (12:57 -0400)]
nvme-cli: fix sparse warnings for declaration

Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
6 years agonvme-cli: wdc-plugin mark array static declaration
Chaitanya Kulkarni [Sun, 19 Aug 2018 17:06:57 +0000 (13:06 -0400)]
nvme-cli: wdc-plugin mark array static declaration

The array deFeatureIdList is only used in wdc-nvme.c,
use static declaration.

6 years agonvme-cli: make show_registers_cap() static
Chaitanya Kulkarni [Sun, 19 Aug 2018 17:14:16 +0000 (13:14 -0400)]
nvme-cli: make show_registers_cap() static

The function show_registers_cap() us only used in the nvme-print.c,
mark this function static.

Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
6 years agoFix nvme id namespace struct
Keith Busch [Mon, 20 Aug 2018 16:23:16 +0000 (10:23 -0600)]
Fix nvme id namespace struct

Off by one in the reserved field.

Link: https://github.com/linux-nvme/nvme-cli/issues/405
Signed-off-by: Keith Busch <keith.busch@intel.com>
6 years agonvme-discover: sanitize options
Hannes Reinecke [Fri, 17 Aug 2018 07:29:05 +0000 (09:29 +0200)]
nvme-discover: sanitize options

The discovery controller doesn't accept any KATO or number of I/O
queue changes, but we do want to change the reconnect delay and
the controller loss timeout.

Signed-off-by: Hannes Reinecke <hare@suse.com>
6 years agonvme-vendor: fixup c99 declaration in huawei plugin
Hannes Reinecke [Fri, 17 Aug 2018 07:29:04 +0000 (09:29 +0200)]
nvme-vendor: fixup c99 declaration in huawei plugin

We can't use c99 declaration with older compilers.

Signed-off-by: Hannes Reinecke <hare@suse.com>
6 years agonvme-ana-log: fixup compiler warning in show_ana_log()
Hannes Reinecke [Fri, 17 Aug 2018 07:29:03 +0000 (09:29 +0200)]
nvme-ana-log: fixup compiler warning in show_ana_log()

Add the correct type cast to keep the compiler happy.

Signed-off-by: Hannes Reinecke <hare@suse.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
6 years agoMerge pull request #398 from bdeyal/master
Keith Busch [Thu, 16 Aug 2018 18:53:58 +0000 (12:53 -0600)]
Merge pull request #398 from bdeyal/master

nvme-get-property : Add documentation

6 years agoMerge pull request #403 from bdeyal/pci_ids
Keith Busch [Mon, 13 Aug 2018 14:56:13 +0000 (08:56 -0600)]
Merge pull request #403 from bdeyal/pci_ids

nvme-models.c - search for pci.ids

6 years agoFix print format specifier for 64-bit
Keith Busch [Mon, 13 Aug 2018 14:40:51 +0000 (08:40 -0600)]
Fix print format specifier for 64-bit

For cross platform compatibility, we use PRI macros instead of hard
coding 64-bit specifiers.

Signed-off-by: Keith Busch <keith.busch@intel.com>
6 years agonvme-cli: add ana-log documentation
Chaitanya Kulkarni [Mon, 13 Aug 2018 05:59:20 +0000 (22:59 -0700)]
nvme-cli: add ana-log documentation

Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
6 years agonvme-cli: add minimal ana-log page support
Chaitanya Kulkarni [Mon, 13 Aug 2018 05:59:19 +0000 (22:59 -0700)]
nvme-cli: add minimal ana-log page support

This patch adds a new command to retrieve the ANA Log page.
We update identify ctrl/ns data structure to support this command.
We also add ana based error codes and different identifiers to the
linux/nvme.h header file in order to support this command.

Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Signed-off-by: Hannes Reinecke <hare@suse.com>
6 years agonvme-cli add ns write protect feature support
Chaitanya Kulkarni [Sun, 12 Aug 2018 23:30:51 +0000 (16:30 -0700)]
nvme-cli add ns write protect feature support

Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
6 years agonvme-models.c - search for pci.ids
Eyal Ben David [Sat, 4 Aug 2018 21:15:51 +0000 (00:15 +0300)]
nvme-models.c - search for pci.ids

Take from PCI_IDS_PATH or look at some default locations
Updated docs for the envrironment in nvme-list.txt
Regenerated man and html pages.

6 years agofabrics: write keep-alive-timeout to fabrics device on connect
Johannes Thumshirn [Thu, 9 Aug 2018 09:25:23 +0000 (11:25 +0200)]
fabrics: write keep-alive-timeout to fabrics device on connect

Commit 7099227b07a8 ("fabrics: add option to supply keep-alive-timeout
for connect-all") introduced a keep-alive-timeout option for
connect-all but forgot to write it down to the kernel's fabrics
device in connect_ctrl().

Pass down the keep-alove-timeouts if we're connecting to a non
discovery controller.

Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
Fixes: 7099227b07a8 ("fabrics: add option to supply keep-alive-timeout for connect-all")
Signed-off-by: Keith Busch <keith.busch@intel.com>
6 years agofabrics: write ctrl_loss_tmo to fabrics device on connect
Johannes Thumshirn [Thu, 9 Aug 2018 09:25:22 +0000 (11:25 +0200)]
fabrics: write ctrl_loss_tmo to fabrics device on connect

Commit 388c9dbe86be ("fabrics: add ctrl-loss-tmo to connect-all")
introduced the '--ctrl-loss-tmo' option for the connect-all command,
but we forgor to pass down the option to the kernel in connect_ctrl().

Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
Fixes: 388c9dbe86be ("fabrics: add ctrl-loss-tmo to connect-all")
fixup! fabrics: write ctrl_loss_tmo to fabrics device on connect
Signed-off-by: Keith Busch <keith.busch@intel.com>
6 years agonvme-get-property : Add documentation
Eyal Ben David [Sat, 4 Aug 2018 20:12:05 +0000 (23:12 +0300)]
nvme-get-property : Add documentation

6 years agoMerge pull request #397 from minwooim/v1.7/fix_typo_in_list
Keith Busch [Fri, 3 Aug 2018 14:20:04 +0000 (08:20 -0600)]
Merge pull request #397 from minwooim/v1.7/fix_typo_in_list

nvme-cli: fix typo in json_print_list_items

6 years agonvme-cli: fix typo in json_print_list_items
Minwoo Im [Fri, 3 Aug 2018 09:52:02 +0000 (18:52 +0900)]
nvme-cli: fix typo in json_print_list_items

Fix the typo like below:
MaximiumLBA -> MaximumLBA

Issue: #396: Typo in nvme list command
Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>
7 years agoMerge pull request #387 from narasimhan-v/create_max_ns_test
Keith Busch [Thu, 2 Aug 2018 18:50:52 +0000 (12:50 -0600)]
Merge pull request #387 from narasimhan-v/create_max_ns_test

Use tnvmcap register for creating namespace

7 years agoMerge pull request #389 from talshorer/master
Keith Busch [Thu, 2 Aug 2018 18:50:23 +0000 (12:50 -0600)]
Merge pull request #389 from talshorer/master

don't execute a command if --dry-run is supplied

7 years agoMerge pull request #390 from bdeyal/master
Keith Busch [Thu, 2 Aug 2018 18:50:08 +0000 (12:50 -0600)]
Merge pull request #390 from bdeyal/master

nvme-print.c : fix ns-descs JSON output

7 years agonvme-print.c : fix ns-descs JSON output
Eyal Ben David [Sun, 15 Jul 2018 14:11:21 +0000 (17:11 +0300)]
nvme-print.c : fix ns-descs JSON output

7 years agonvme-cli: remove unnecessary assignments
Chaitanya Kulkarni [Thu, 26 Jul 2018 21:59:13 +0000 (14:59 -0700)]
nvme-cli: remove unnecessary assignments

This removes the unnecessary assignment of the variable.

Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
7 years agoMerge pull request #393 from puneetk/smart-log-add-patch
Keith Busch [Wed, 25 Jul 2018 19:48:22 +0000 (13:48 -0600)]
Merge pull request #393 from puneetk/smart-log-add-patch

Remove trailing "\n" so that the output is valid json

7 years agoRemove trailing "\n" so that the output is valid json
puneet kandhari [Wed, 25 Jul 2018 19:46:26 +0000 (14:46 -0500)]
Remove trailing "\n" so that the output is valid json

7 years agoRelease 1.6 v1.6
Keith Busch [Wed, 18 Jul 2018 18:47:00 +0000 (12:47 -0600)]
Release 1.6

It's been far too long, and we've lots of fixes and updates, so tagging
a new release. Shortlog of all the commits since the 1.5 release are
below. Special thanks to everyone who contributed, including the people
not listed here who filed and verified issues.

521852 (2):
      Adding ppc big endian support
      Updating version to 1.1

Alexey Timofeyev (3):
      nvme-cli: Fix build breaks for GCC 8.1 Signed-off-by: Alexey Timofeyev <alexey.timofeyev@sk.com>
      nvme-cli: Fix build breaks for GCC 8.1 Signed-off-by: Alexey Timofeyev <alexey.timofeyev@sk.com>
      nvme-cli: add support of RAE

Andrew Meir (3):
      Add toshiba plugin code and command documentation.
      Add toshiba plugin to makefile rules.
      Fixes for log page access.

Chaitanya Kulkarni (5):
      nvme-cli: allow block device for delete-ns
      nvme-cli: fix get_nsid() return value check
      nvme-cli: fix compilation error
      nvme-cli: add changed log ns support
      nvme-cli: add changed-ns-list-log documentation

Daniel Verkamp (1):
      nvme-cli: fix typo in 'disconnect' docs

Eyal Ben David (3):
      nvme-ioctl.c : nvme_get_properties(): fix 64bit offset advance
      Add a single get-property command for NVMeOF.
      nvme.c, list_ns: use le32_to_cpu in display

James Smart (4):
      nvme-cli: correct spelling of discovery
      nvme-cli: show partial results if controller fails during list and list-subsys
      nvme-cli: Wait for device file if not present after successful add_ctrl
      nvme-cli: Add ioctl retry support for "connect-all"

JasonChiuCC (2):
      nvme-cli: fix show command typo
      nvme-cli: Modify Get Features-Asynchronous Event Configuration

Javier González (1):
      lightnvm: enable to set OP on target creation

Jeff Lien (10):
      NVMe-CLI WDC-Plugin Add drive-essentials command
      NVMe-CLI WDC-Plugin Add drive-essentials documentation
      NVMe-CLI WDC-Plugin Add clear-pcie-corr command
      NVMe-CLI WDC-Plugin Add clear-pcie-corr documentation.
      NVMe-CLI WDC-Plugin Update drive essentials code with review comments.
      NVMe-CLI Fix fw_log Command json output
      Add nvme fw-log commmand test
      Add nvme id-ctrl command test
      Add nvme id-ns command test
      NVMe-CLI Fix id-ns fpi field when Human Readable option selected.

Johannes Thumshirn (3):
      Documentation: add manpage entry for connect's --ctrl-loss-tmo setting
      fabrics: add option to supply keep-alive-timeout for connect-all
      fabrics: add ctrl-loss-tmo to connect-all

Keith Busch (34):
      Allow hierarchy of similiarly named plugins
      Fix verbose decoding for coalescing aggregation time
      Use NSID all for error log
      Use '-' for compounded word telemetry-log subcommand
      flush: Use device NSID if issuing through block device
      Fix freeing wrong address
      Update makefile dependencies
      Add decoding for new controller attributes
      Add support for decoding IO Determinism features
      Add support for NVMe Sets log page
      Add read-recover level feature decoding
      Ignore cscope files
      Fix fabrics property commands
      Add manpage for endurance log
      Regenerate documentation
      Don't print non-existent command line options
      Add remaining fields from NVM Sets
      Fix parameter descriptions
      get-log: Make log identifier a required parameter
      Use fixed-width integer types for long suffixed parameters
      Fix intel media wear json output
      Remove error print for telemetry log arg parse
      Regenrate documentation
      Regenerate man pages
      Revert "nvme-cli: Add ioctl retry support for "connect-all""
      Revert "nvme-cli: Wait for device file if not present after successful add_ctrl"
      Add man pages for new device self test commands
      Replace host-gen telemetry short-option 'h' with 'g'
      Fix json output of 128-bit numbers
      Fix format specifier for 32-bit
      Update doc
      intel: fix latency stats printing
      fix reservation report 0's based dword count
      lightnvm: fix type coercion

Klaus Birkelund Abildgaard Jensen (1):
      nvme-cli: add support for DLFEAT

Matias Bjørling (1):
      Add open-channel 2.0 identify support

Max Gurtovoy (1):
      nvme-cli: fabrics: Fix passing "host_traddr" for all transports

Maxim (2):
      Add user parameter to specify data area region from telemetry log
      Wrote man page for telemetry

Minwoo Im (55):
      nvme-cli: make sanitize description const
      nvme-cli: update print for sanitize-log command with output-format
      nvme-cli: add print for command specific info field of error log page
      nvme-cli: Remove unnecessary nsid field in error-log
      nvme-cli: add support for json output format of sanitize-log command
      Update subcommand alias description in README.md
      nvme-cli: add BPS bit field to CAP controller register
      nvme-cli: lnvm: add whitespace between words in a description
      nvme-cli: lnvm: remove unnecessary force parameter of ns-id in lnvm
      nvme-cli: lnvm: add check for fd after open operation
      nvme-cli: lnvm: add human-readable print format to ns-id subcommand
      nvme-cli: update error-log documentation
      nvme-cli: intel: update smart-log-add command documentation
      nvme-cli: intel: fix smart-log-add documentation
      nvme-cli: intel: add check for fd after open to intel commands
      nvme-cli: intel: add const to descriptions of subcommand option
      nvme-cli: add support for options to effects-log subcommand
      nvme-cli: update documentation of effects-log
      nvme-cli: tests: remove nsid parameter in a testcase of error-log
      nvme-cli: tests: fix typo in get_feature_test
      nvme-cli: add error handling for a failure of malloc
      nvme-cli: fix memory leak in list_ctrl()
      nvme-cli: fix memory leak in ns_descs()
      nvme-cli: fix memory leak in fw_download()
      nvme-cli: fix memory leak in set_feature()
      nvme-cli: fix memory leak in sec_send()
      nvme-cli: fix memory leak in dir_send()
      nvme-cli: fix memory leak in sec_recv()
      nvme-cli: fix memory leak in dir_receive()
      nvme-cli: wdc: add const to descriptions
      nvme-cli: wdc: fix mismatch in document for smart-add-log
      nvme-cli: fix memory leak in passthru()
      nvme-cli: lnvm: Make it return error status when argconfig_parse fails
      nvme-cli: memblaze: fix memory leak in memblaze-nvme.c
      nvme-cli: memblaze: add error return after parse_and_open()
      nvme-cli: add command specific field to json output of error-log
      nvme-cli: make it have bpid in cdw10 for fw-commit
      nvme-cli: add print for command name to effects-log
      nvme-cli: fix leaks in subcommands
      nvme-cli: move print-function to nvme-print
      nvme-cli: make return negative value in nvme_get_nsid() when not blkdev
      nvme-cli: convert iekey into a no_argument parameter
      nvme-cli: update documentations to sync up with subcommands
      nvme-cli: add helper for sanitize command
      nvme-cli: adjust json print according to uint format
      nvme-cli: make it use NVME_IDENTIFY_DATA_SIZE
      nvme-cli: fix seg_fault by cmd options in endurance_log
      nvme-cli: fix leak in endurance_log command
      nvme-cli: make it return 0 in case of non-fabric for show-regs
      nvme-cli: fix perror when blkdev not given when get-ns-id
      nvme-cli: add support for id-nvmset subcommand
      nvme-cli: update new fields in id-ns subcommand
      nvme-cli: update the document for id-nvmset subcommand
      nvme-cli: print firmware activation notices support bit to id_ctrl
      nvme-cli: adjust memset size for data buffer in submit_io

Muhammad Ahmad (2):
      Fixed a bug where cdw11 was being overwritten by cdw12
      Updatign the plugin version

Oleksii Timofieiev (5):
      nvme-cli: Add support of unsigned long long to json routines Signed-off-by: Oleksii Timofieiev <tim.oleksii@gmail.com>
      nvme-cli: wdc: Removed superfluous output in WDC plugin
      nvme-cli: handle long commands in help message by adjusting minimal padding Signed-off-by: Oleksii Timofieiev <tim.oleksii@gmail.com>
      nvme-cli: Fixed incosistency of error handling in intel plugin Signed-off-by: Oleksii Timofieiev <tim.oleksii@gmail.com>
      Fix endianess in WDC plugin.

Pavel Borzenkov (1):
      nvme-cli: fix typo in Intel SMART json output

Revanth Rajashekar (5):
      nvme-cli: Implemented Device self test and log.
      nvme-cli: Implement printing the get timestamp feature.
      nvme-cli: Implement printing the get host controlled thermal management feature.
      nvme-cli: Implement printing the get Keep Alive Timer feature
      nvme-cli: Implement printing get NOPSC feature

Rodrigo R. Galvao (1):
      nvme-cli: Add friendly status messages

Sagi Grimberg (2):
      fabrics: fail early if argconfig_parse failed
      fabrics: omit newline character when reading nvme host nqn

Schremmer, Steven (2):
      nvme-cli: add NetApp plugin
      nvme-cli: add netapp smdevices man page

Scott Bauer (4):
      nvme-cli: Implement get_telemetry_log from 1.3 spec
      nvme/vendor: Add get log LSP/LSO fields from 1.3 spec
      nvme-cli: Implement nvme_get_log13
      nvme-cli: telemetry-log add controller initiated log gathering

Stephen Tubbs (1):
      Add support for Micron plugin

Takashi Iwai (2):
      Documentation: fix title markers
      Documentation: allow to format with asciidoctor

Vijay Kumar (2):
      Fix double free in list_subsys
      Log error incase of failure in get_nvme_subsystem_info()

muhammad.ahmad@seagate.com (7):
      Initial checkin for Seagate Plugin
      Removed Duplicate commands.
      refactored some strings
      Initial checkin for Seagate Plugin
      Removed Duplicate commands.
      refactored some strings
      Making gcc compiler (5.4.0 among others) happy

Signed-off-by: Keith Busch <keith.busch@intel.com>
7 years agolightnvm: fix type coercion
Keith Busch [Tue, 17 Jul 2018 21:56:25 +0000 (15:56 -0600)]
lightnvm: fix type coercion

The lightnvm passthrough command wasn't actually aligned to the ioctl's
structure because it had an extra dword, and some compilers were having a
hard time dealing with some of the other structure casting. This fixes
the passthrough structure by removing the erroneous dword, and uses
temporary void pointers for type casting.

Link: https://github.com/linux-nvme/nvme-cli/issues/386
Signed-off-by: Keith Busch <keith.busch@intel.com>
7 years agodon't execute a command if --dry-run is supplied
Tal Shorer [Fri, 13 Jul 2018 14:41:42 +0000 (17:41 +0300)]
don't execute a command if --dry-run is supplied

Previously, issuing a command with --dry-run but without
--show-command would actually execute the command

Signed-off-by: Tal Shorer <tal.shorer@gmail.com>