]> www.infradead.org Git - users/hch/nvme-cli.git/log
users/hch/nvme-cli.git
5 years agoCorrect self-test-log output
ekohande [Thu, 19 Sep 2019 01:20:34 +0000 (18:20 -0700)]
Correct self-test-log output

Changes determination of Device Self-Test in progress to be based on the
Current Device Self-Test Operation field as opposed to the Current
Device Self-Test Completion field.

Current implementation assumes that the Current Device Self-Test
Completion field will be 100% when no Device Self-Test operation is in
progress. This is an unsafe assumption as the NVMe Specification
explicitly specifies that the Current Device Self-Test Completion field
is invalid when no Device Self-Test operation in progress as indicated
by a value of 0 in the Current Device Self-Test Operation field.

A safe assumption is to use the Current Device Self-Test Operation field
which will be 0 when no Device Self-Test operation is in progress.

Signed-off-by: ekohande <abe.kohandel@intel.com>
5 years agoMerge pull request #566 from jeffreyalien/master
Keith Busch [Tue, 17 Sep 2019 14:58:24 +0000 (08:58 -0600)]
Merge pull request #566 from jeffreyalien/master

Add support to specify a specific file size and offset when getting DUI data for SN340

5 years agoMerge https://github.com/linux-nvme/nvme-cli
Jeff Lien [Fri, 13 Sep 2019 19:12:17 +0000 (14:12 -0500)]
Merge https://github.com/linux-nvme/nvme-cli

5 years ago[NVMe-CLI] Documentation file for WDC vs-fw-activate-history command.
Jeff Lien [Fri, 13 Sep 2019 19:03:02 +0000 (14:03 -0500)]
[NVMe-CLI] Documentation file for WDC vs-fw-activate-history command.

5 years ago[NVMe-CLI] Add new WDC plugin command vs-fw-activate-history.
Jeff Lien [Fri, 13 Sep 2019 18:59:09 +0000 (13:59 -0500)]
[NVMe-CLI] Add new WDC plugin command vs-fw-activate-history.

5 years agoMerge pull request #569 from minwooim/print-ctrltype-human
Keith Busch [Fri, 13 Sep 2019 18:31:23 +0000 (12:31 -0600)]
Merge pull request #569 from minwooim/print-ctrltype-human

nvme-print: fix to print ctrltype when human-readable

5 years agoMerge pull request #571 from zmedico/make-install-hostparams-depends-on-install-etc
Keith Busch [Fri, 13 Sep 2019 18:30:07 +0000 (12:30 -0600)]
Merge pull request #571 from zmedico/make-install-hostparams-depends-on-install-etc

make: install-hostparams depends on install-etc

5 years agoMerge pull request #565 from RevanthRajashekar/pmr_write_elasticity
Keith Busch [Fri, 13 Sep 2019 18:01:54 +0000 (12:01 -0600)]
Merge pull request #565 from RevanthRajashekar/pmr_write_elasticity

nvme: add Persistent Memory Region(PMR) Write Elasticity Status Regis…

5 years agoMerge pull request #570 from ikegami-t/master
Keith Busch [Fri, 13 Sep 2019 18:01:19 +0000 (12:01 -0600)]
Merge pull request #570 from ikegami-t/master

MAINT: compile warning error on 32 bit system

5 years agomake: install-hostparams depends on install-etc
Zac Medico [Fri, 13 Sep 2019 04:18:41 +0000 (21:18 -0700)]
make: install-hostparams depends on install-etc

It's possible for the install target to fail if the install-hostparams
target executes before the install-etc target:

/bin/sh: line 1: $(DESTDIR)$(SYSCONFDIR)/nvme/hostnqn: No such file or directory
make: *** [Makefile:113: install-hostparams] Error 1

Signed-off-by: Zac Medico <zmedico@gentoo.org>
5 years agoMAINT: compile warning error on 32 bit system
Tokunori Ikegami [Thu, 12 Sep 2019 18:09:13 +0000 (03:09 +0900)]
MAINT: compile warning error on 32 bit system

Since some pointer handlings are depended on 64 bit system.
So fix them as generic.

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
5 years agonvme-print: fix to print ctrltype when human-readable
Minwoo Im [Tue, 10 Sep 2019 14:15:57 +0000 (23:15 +0900)]
nvme-print: fix to print ctrltype when human-readable

The controller type should be printed out when the human-readable
option is given.

Signed-off-by: Minwoo Im <minwoo.im@samsung.com>
5 years agoMerge https://github.com/linux-nvme/nvme-cli
Jeff Lien [Fri, 6 Sep 2019 21:29:52 +0000 (16:29 -0500)]
Merge https://github.com/linux-nvme/nvme-cli

Conflicts:
plugins/wdc/wdc-nvme.c

5 years agonvme: add Persistent Memory Region(PMR) Write Elasticity Status Registers
Revanth Rajashekar [Fri, 6 Sep 2019 18:45:28 +0000 (12:45 -0600)]
nvme: add Persistent Memory Region(PMR) Write Elasticity Status Registers

    *update 'show-regs' to display the new PMR Write Elasticity Status
     registers (PMREBS, PMRSWTP)

Signed-off-by: Revanth Rajashekar <revanth.rajashekar@intel.com>
5 years ago[NVMe-CLI] Fix Potential Memory Leak with vs-internal-log command.
Jeff Lien [Fri, 6 Sep 2019 18:08:02 +0000 (13:08 -0500)]
[NVMe-CLI] Fix Potential Memory Leak with vs-internal-log command.

5 years agoregen docs
Keith Busch [Fri, 6 Sep 2019 16:36:45 +0000 (10:36 -0600)]
regen docs

Signed-off-by: Keith Busch <kbusch@kernel.org>
5 years agofix admin-passthru documentation typo
Keith Busch [Fri, 6 Sep 2019 16:36:02 +0000 (10:36 -0600)]
fix admin-passthru documentation typo

Short option for input file is '-i', not '-f'.

Link: https://github.com/linux-nvme/nvme-cli/issues/564
Signed-off-by: Keith Busch <kbusch@kernel.org>
5 years ago[NVMe-CLI] Fix empty file issue with vs-internal-log wdc plugin
Jeff Lien [Thu, 5 Sep 2019 20:59:33 +0000 (15:59 -0500)]
[NVMe-CLI] Fix empty file issue with vs-internal-log wdc plugin
command

5 years agonvme-cli: Fix namespace list output
Keith Busch [Wed, 4 Sep 2019 21:55:38 +0000 (15:55 -0600)]
nvme-cli: Fix namespace list output

Make sure to provide comma separated namespaces if a controller provides
more than one.

Signed-off-by: Keith Busch <kbusch@kernel.org>
5 years agoFix builds for missing uuid
Keith Busch [Wed, 4 Sep 2019 21:48:06 +0000 (15:48 -0600)]
Fix builds for missing uuid

The linux/uuid.h is not a source to define uuid_t.

Use uuid/uuid.h if it is available, otherwise redefine uuid_t in a
single place. Remove the duplicate from nvme.h, only define in
linux/nvme.h.

Signed-off-by: Keith Busch <kbusch@kernel.org>
5 years agoRevert "remove LIBUUID things from nvme.h"
Keith Busch [Wed, 4 Sep 2019 21:44:12 +0000 (15:44 -0600)]
Revert "remove LIBUUID things from nvme.h"

This reverts commit 1b526e64f713ee3d5e3b34cb40373f8e59c8318c.

5 years agoRevert "nvme-cli: Fix compile on non-libuuid machines"
Keith Busch [Wed, 4 Sep 2019 21:41:38 +0000 (15:41 -0600)]
Revert "nvme-cli: Fix compile on non-libuuid machines"

This reverts commit 28f539e79a1b02d82955353b50b0979c3cc27943.

5 years agoRevert "fix uuid include typo"
Keith Busch [Wed, 4 Sep 2019 21:41:20 +0000 (15:41 -0600)]
Revert "fix uuid include typo"

This reverts commit 70501d661cdb62a6c6226c8bcd2274be3af61484.

5 years ago[NVMe-CLI] Fix offset parameter size for vs-internal-log wdc plugin
Jeff Lien [Tue, 3 Sep 2019 19:39:25 +0000 (14:39 -0500)]
[NVMe-CLI] Fix offset parameter size for vs-internal-log wdc plugin
command.

5 years agoMerge pull request #562 from minwooim/fix-build-error-for-libuuid
Keith Busch [Tue, 3 Sep 2019 14:09:57 +0000 (08:09 -0600)]
Merge pull request #562 from minwooim/fix-build-error-for-libuuid

remove LIBUUID things from nvme.h

5 years agoMerge pull request #561 from minwooim/fix-build-error-for-asprintf
Keith Busch [Tue, 3 Sep 2019 14:09:40 +0000 (08:09 -0600)]
Merge pull request #561 from minwooim/fix-build-error-for-asprintf

fix build error due to asprintf()

5 years agoMerge pull request #555 from minwooim/for-2.0/id-ctrl-1.4-update
Keith Busch [Tue, 3 Sep 2019 14:08:48 +0000 (08:08 -0600)]
Merge pull request #555 from minwooim/for-2.0/id-ctrl-1.4-update

Update Identify Controller for 1.4

5 years agoremove LIBUUID things from nvme.h
Minwoo Im [Tue, 3 Sep 2019 01:25:37 +0000 (10:25 +0900)]
remove LIBUUID things from nvme.h

We have this structure in linux/nvme.h already.

cc -D_GNU_SOURCE -D__CHECK_ENDIAN__ -O2 -g -Wall -Werror -std=gnu99 -I. -DNVME_VERSION='"1.9.22.g6936.dirty"' -Iutil -o nvme-print.o -c nvme-print.c
In file included from nvme.h:35:0,
                 from nvme-print.h:4,
                 from nvme-print.c:7:
linux/nvme.h:24:3: error: conflicting types for ‘uuid_t’
 } uuid_t;
   ^~~~~~
In file included from nvme-print.h:4:0,
                 from nvme-print.c:7:
nvme.h:32:3: note: previous declaration of ‘uuid_t’ was here
 } uuid_t;
   ^~~~~~
Makefile:70: recipe for target 'nvme-print.o' failed

Signed-off-by: Minwoo Im <minwoo.im@samsung.com>
5 years agofix build error due to asprintf()
Minwoo Im [Tue, 3 Sep 2019 01:12:09 +0000 (10:12 +0900)]
fix build error due to asprintf()

Fixes a3b3e93286a3 ("nvme-cli: Code reorg")

$ gcc -v
minwoo@minwoo-desktop:~/work/nvme-cli.git$ (fix-build-error-for-asprintf) gcc -v
...
gcc version 7.4.0 (Ubuntu 7.4.0-1ubuntu1~18.04.1)

nvme-print.c: In function ‘show_relatives’:
nvme-print.c:3964:3: error: ignoring return value of ‘asprintf’, declared with attribute warn_unused_result [-Werror=unused-result]
   asprintf(&path, "/sys/class/nvme/%s", name);
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
nvme-print.c:3968:3: error: ignoring return value of ‘asprintf’, declared with attribute warn_unused_result [-Werror=unused-result]
   asprintf(&path, "/sys/block/%s/device", name);
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Minwoo Im <minwoo.im@samsung.com>
5 years agoid-ctrl: show Flush command behavior in VWC
Minwoo Im [Sun, 25 Aug 2019 13:28:50 +0000 (22:28 +0900)]
id-ctrl: show Flush command behavior in VWC

Volatile Write Cache(VWC) is now indicating the Flush command behavior
in VWC point-of-view.  If 2h, Flush command does not support for the
NSID set to FFFFFFFFh.  But in case of 3h, it will support.

Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>
5 years agofix uuid include typo
Keith Busch [Fri, 30 Aug 2019 19:27:18 +0000 (13:27 -0600)]
fix uuid include typo

Rushed a commit and typed it incorrectly. Fix it.

Signed-off-by: Keith Busch <kbusch@kernel.org>
5 years agonvme-cli: Fix compile on non-libuuid machines
Keith Busch [Fri, 30 Aug 2019 19:25:19 +0000 (13:25 -0600)]
nvme-cli: Fix compile on non-libuuid machines

Define uuid_t if not provided by libuuid.

Link: https://github.com/linux-nvme/nvme-cli/pull/559
Signed-off-by: Keith Busch <kbusch@kernel.org>
5 years ago[NVMe-CLI] Add updated documentation for additional parameters to specify file size
Jeff Lien [Fri, 30 Aug 2019 15:53:24 +0000 (10:53 -0500)]
[NVMe-CLI] Add updated documentation for additional parameters to specify file size
  in vs-internal-log command.

5 years agoMerge branch 'refactor'
Keith Busch [Fri, 30 Aug 2019 15:41:11 +0000 (09:41 -0600)]
Merge branch 'refactor'

5 years agoRegen docs
Keith Busch [Fri, 30 Aug 2019 14:30:57 +0000 (08:30 -0600)]
Regen docs

Signed-off-by: Keith Busch <kbusch@kernel.org>
5 years agonvme-cli: Code cleanup
Keith Busch [Fri, 30 Aug 2019 00:40:21 +0000 (18:40 -0600)]
nvme-cli: Code cleanup

There should be no functional change in this commit. This is a pure
style update.

Use the option macros for all plugins.

Update code style to conform to linux conventions.

Signed-off-by: Keith Busch <kbusch@kernel.org>
5 years agonvme-cli: Macro'ify argument defines
Keith Busch [Thu, 29 Aug 2019 19:38:14 +0000 (13:38 -0600)]
nvme-cli: Macro'ify argument defines

Defining arguments by field type is too repetive and creates excessively
long lines. Simplify this with some macros that handle the more tedious
parts.

Signed-off-by: Keith Busch <kbusch@kernel.org>
5 years agonvme-cli: Code reorg
Keith Busch [Wed, 28 Aug 2019 19:06:37 +0000 (13:06 -0600)]
nvme-cli: Code reorg

Move code lifted from 3rd party programs into new 'util' directory.

Add new file to define all nvme specific scan filter funtions and
relocate those functions to this file.

Add new file consolidating all linux directory hierarchy knowledge and
implement topology building functions there.

Finally, fix all the broken nvme block-char relationships.

Signed-off-by: Keith Busch <kbusch@kernel.org>
5 years agoMerge https://github.com/linux-nvme/nvme-cli
Jeff Lien [Thu, 29 Aug 2019 14:07:24 +0000 (09:07 -0500)]
Merge https://github.com/linux-nvme/nvme-cli

5 years ago[NVMe-CLI] Add support to specify file size in get DUI data for SN340.
Jeff Lien [Wed, 28 Aug 2019 21:24:04 +0000 (16:24 -0500)]
[NVMe-CLI] Add support to specify file size in get DUI data for SN340.

5 years agoRegenerate documentation
Keith Busch [Tue, 27 Aug 2019 14:08:21 +0000 (08:08 -0600)]
Regenerate documentation

Signed-off-by: Keith Busch <kbusch@kernel.org>
5 years agonvme-cli: Make 'list' more useful
Keith Busch [Mon, 26 Aug 2019 22:17:41 +0000 (16:17 -0600)]
nvme-cli: Make 'list' more useful

The original 'list' subcommand was a bit of an ad-hoc development. Not
a whole lot of forethought was made toward subsystems, multipathing,
multi-namespace capabilities.

Those more complicated topologies we see today have become difficult
for users to visualize and understand the relationships among many
devices co-existing in the same, and 'list' has not kept up with these
complications.

As newer kernels provide more information for user space to discover,
provide a more verbose option to list this information while maintaining
backward compatibility for kernels that do not provide nvme subsystem
suppport.

The following examples are using the column format, however I find the
json output more satisfying.

The old way (no verbose options):

  # nvme list
  Node             SN                   Model                                    Namespace Usage                      Format           FW Rev
  ---------------- -------------------- ---------------------------------------- --------- -------------------------- ---------------- --------
  /dev/nvme0n1     PHLE7200015N6P4BGN-1 7335943:ICDPC5ED2ORA6.4T                 1           3.20  TB /   3.20  TB    512   B +  0 B   QDV1RD07
  /dev/nvme1n1     PHLE7200015N6P4BGN-2 7335943:ICDPC5ED2ORA6.4T                 1           3.20  TB /   3.20  TB    512   B +  0 B   QDV1RD03
  /dev/nvme2n1     CVFT50850022400GGN   INTEL SSDPE2MD400G4                      1         400.09  GB / 400.09  GB      4 KiB +  0 B   8DV101J0
  /dev/nvme3n1     CVMD4215002W1P6DGN   INTEL SSDPEDME012T4                      1           1.20  TB /   1.20  TB      4 KiB +  0 B   8DV101B0
  /dev/nvme4n1     e559e5e004175109     Linux                                    1           3.20  TB /   3.20  TB    512   B +  0 B   5.3.0-rc
  /dev/nvme4n2     e559e5e004175109     Linux                                    2           3.20  TB /   3.20  TB    512   B +  0 B   5.3.0-rc
  /dev/nvme5n1     FUMB5256000J280A     INTEL SSDPED1D140GA                      1         140.04  GB / 140.04  GB    512   B +  0 B   E40A0208

And with the new 'verbose' flag:

  # nvme list -v
  NVM Express Subsystems

  Subsystem        Subsystem-NQN                                                                                    Controllers
  ---------------- ------------------------------------------------------------------------------------------------ ----------------
  nvme-subsys0     nqn.2014.08.org.nvmexpress:8086108ePHLE7200015N6P4BGN-17335943:ICDPC5ED2ORA6.4T                  nvme1
  nvme-subsys1     nqn.2014.08.org.nvmexpress:8086108ePHLE7200015N6P4BGN-27335943:ICDPC5ED2ORA6.4T                  nvme2
  nvme-subsys2     nqn.2014.08.org.nvmexpress:80868086CVFT50850022400GGN  INTEL SSDPE2MD400G4                       nvme0
  nvme-subsys3     nqn.2014.08.org.nvmexpress:80868086CVMD4215002W1P6DGN  INTEL SSDPEDME012T4                       nvme3
  nvme-subsys4     keith-loopback-testnqn                                                                           nvme4, nvme5
  nvme-subsys5     nqn.2014.08.org.nvmexpress:80868086FUMB5256000J280A    INTEL SSDPED1D140GA                       nvme6

  NVM Express Controllers

  Device   SN                   MN                                       FR       TxPort Address        Subsystem    Namespaces
  -------- -------------------- ---------------------------------------- -------- ------ -------------- ------------ ----------------
  nvme1    PHLE7200015N6P4BGN-1 7335943:ICDPC5ED2ORA6.4T                 QDV1RD07 pcie   0000:88:00.0   nvme-subsys0 nvme0n1
  nvme2    PHLE7200015N6P4BGN-2 7335943:ICDPC5ED2ORA6.4T                 QDV1RD03 pcie   0000:89:00.0   nvme-subsys1 nvme1n1
  nvme0    CVFT50850022400GGN   INTEL SSDPE2MD400G4                      8DV101J0 pcie   0000:5e:00.0   nvme-subsys2 nvme2n1
  nvme3    CVMD4215002W1P6DGN   INTEL SSDPEDME012T4                      8DV101B0 pcie   0000:d8:00.0   nvme-subsys3 nvme3n1
  nvme4    e559e5e004175109     Linux                                    5.3.0-rc loop                  nvme-subsys4 nvme4n1, nvme4n2
  nvme5    e559e5e004175109     Linux                                    5.3.0-rc loop                  nvme-subsys4 nvme4n1, nvme4n2
  nvme6    FUMB5256000J280A     INTEL SSDPED1D140GA                      E40A0208 pcie   10001:01:00.0  nvme-subsys5 nvme5n1

  NVM Express Namespaces

  Device       NSID     Usage                      Format           Controllers
  ------------ -------- -------------------------- ---------------- ----------------
  nvme0n1      1          3.20  TB /   3.20  TB    512   B +  0 B   nvme1
  nvme1n1      1          3.20  TB /   3.20  TB    512   B +  0 B   nvme2
  nvme2n1      1        400.09  GB / 400.09  GB      4 KiB +  0 B   nvme0
  nvme3n1      1          1.20  TB /   1.20  TB      4 KiB +  0 B   nvme3
  nvme4n1      1          3.20  TB /   3.20  TB    512   B +  0 B   nvme4, nvme5
  nvme4n2      2          3.20  TB /   3.20  TB    512   B +  0 B   nvme4, nvme5
  nvme5n1      1        140.04  GB / 140.04  GB    512   B +  0 B   nvme6

Signed-off-by: Keith Busch <kbusch@kernel.org>
5 years agoid-ctrl: show Persistent Event Log support in LPA
Minwoo Im [Sun, 25 Aug 2019 13:28:03 +0000 (22:28 +0900)]
id-ctrl: show Persistent Event Log support in LPA

Log Page Attribute(LPA) in Identify Controller data structure is now
indicating the support for the Persistent Event Log page in 4th bit.

Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>
5 years agoid-ctrl: show Persistent Event Log Size(PELS)
Minwoo Im [Sun, 25 Aug 2019 13:26:42 +0000 (22:26 +0900)]
id-ctrl: show Persistent Event Log Size(PELS)

1.4 also has introduced Persistent Event Log Page.  This field will
indicate size of the log in 64KB units.

Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>
5 years agoid-ctrl: show Endurance Group Maximum ID(ENDGIDMAX)
Minwoo Im [Sun, 25 Aug 2019 13:25:28 +0000 (22:25 +0900)]
id-ctrl: show Endurance Group Maximum ID(ENDGIDMAX)

1.4 has introduced the Enduracne Group concept.  This field will
indicate the maximum ID of the Endurance Group.

Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>
5 years agoid-ctrl: show FRU Globally Unique Identifier(FGUID)
Minwoo Im [Sun, 25 Aug 2019 13:24:41 +0000 (22:24 +0900)]
id-ctrl: show FRU Globally Unique Identifier(FGUID)

Field Replaceable Unit (FRU) ID has been added in 1.4.

Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>
5 years agoid-ctrl: show Controller Type(CNTRLTYPE)
Minwoo Im [Sun, 25 Aug 2019 13:22:42 +0000 (22:22 +0900)]
id-ctrl: show Controller Type(CNTRLTYPE)

CNTRLTYPE has been added in 1.4 spec.

Example:
cntrltype : 0
  [7:2] : 0     Reserved
  [1:0] : 0     Controller type not reported

Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>
5 years agoid-ctrl: update id-ctrl header for 1.4
Minwoo Im [Sun, 25 Aug 2019 13:16:52 +0000 (22:16 +0900)]
id-ctrl: update id-ctrl header for 1.4

Respin the id-ctrl structure based on the 1.4 spec.

Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>
5 years agosystemd: fix echo call with absolute path
Sagi Grimberg [Thu, 22 Aug 2019 22:09:37 +0000 (15:09 -0700)]
systemd: fix echo call with absolute path

Without placing the absolute path when formatting the
nvme connect-all args we can get the following error:
--
connect-all: unrecognized option '-e'
Discover NVMeoF subsystems and connect to them  [  --transport=<LIST>, -t <LIST> ]    --- transport type
  [  --traddr=<LIST>, -a <LIST> ]       --- transport address
  [  --trsvcid=<LIST>, -s <LIST> ]      --- transport service id (e.g. IP
                                            port)
  [  --host-traddr=<LIST>, -w <LIST> ]  --- host traddr (e.g. FC WWN's)
  [  --hostnqn=<LIST>, -q <LIST> ]      --- user-defined hostnqn (if default
                                            not used)
  [  --hostid=<LIST>, -I <LIST> ]       --- user-defined hostid (if default
                                            not used)
  [  --raw=<LIST>, -r <LIST> ]          --- raw output file
  [  --device=<LIST>, -d <LIST> ]       --- use existing discovery controller
                                            device
  [  --keep-alive-tmo=<LIST>, -k <LIST> ] --- keep alive timeout period in
                                            seconds
  [  --reconnect-delay=<LIST>, -c <LIST> ] --- reconnect timeout period in
                                            seconds
  [  --ctrl-loss-tmo=<LIST>, -l <LIST> ] --- controller loss timeout period in
                                            seconds
  [  --hdr_digest, -g ]                 --- enable transport protocol header
                                            digest (TCP transport)
  [  --data_digest, -G ]                --- enable transport protocol data
                                            digest (TCP transport)
  [  --nr-io-queues=<LIST>, -i <LIST> ] --- number of io queues to use
                                            (default is core count)
  [  --nr-write-queues=<LIST>, -W <LIST> ] --- number of write queues to use
                                            (default 0)
  [  --nr-poll-queues=<LIST>, -P <LIST> ] --- number of poll queues to use
                                            (default 0)
  [  --queue-size=<LIST>, -Q <LIST> ]   --- number of io queue elements to
                                            use (default 128)
  [  --persistent, -p ]                 --- persistent discovery connection
  [  --quiet, -Q ]                      --- suppress already connected errors
Usage: nvme connect-all <device> [OPTIONS]
Options:
: nvmf-connect@--device\x3dnvme0\t--transport\x3dtcp\t--traddr\x3d192.168.123.1\t--trsvcid\x3d8009\t--host-traddr\x3dnone.service: Main process exited, code=exited, status=70/n/a
: nvmf-connect@--device\x3dnvme0\t--transport\x3dtcp\t--traddr\x3d192.168.123.1\t--trsvcid\x3d8009\t--host-traddr\x3dnone.service: Failed with result 'exit-code'.

Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
5 years agonvmf-autoconnect: fix absolute path for systemctl
Sagi Grimberg [Thu, 22 Aug 2019 22:09:36 +0000 (15:09 -0700)]
nvmf-autoconnect: fix absolute path for systemctl

Without the absolute path udev gets the error:
failed to execute '/lib/udev/systemctl' 'systemctl --no-block start nvmf-connect@[...].service': No such file or directory

Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
5 years agomake: install udev rules in sysconfdir
Sagi Grimberg [Thu, 22 Aug 2019 22:09:35 +0000 (15:09 -0700)]
make: install udev rules in sysconfdir

When the libdir is set to /usr/lib the nvmf connect udev rules are
ignored, when placing it in /etc/udev rules are working as expected.

Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
5 years agomake: fix discovery.conf override
Sagi Grimberg [Thu, 22 Aug 2019 21:35:39 +0000 (14:35 -0700)]
make: fix discovery.conf override

it is located in sysconfdir and not sbindir

Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
5 years agofabrics: fix loop connect-all
Sagi Grimberg [Thu, 22 Aug 2019 21:31:41 +0000 (14:31 -0700)]
fabrics: fix loop connect-all

When we check the trtype, we handle loop like fc
which is wrong as it checks for the adrfam attribute
in the discovery record.

Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
5 years agonvme: fix compilation error
Sagi Grimberg [Thu, 22 Aug 2019 21:31:32 +0000 (14:31 -0700)]
nvme: fix compilation error

gcc 7.4.0.

nvme.c: In function ‘print_relatives’:
nvme.c:3505:3: error: ignoring return value of ‘asprintf’, declared with attribute warn_unused_result [-Werror=unused-result]
   asprintf(&path, "/sys/class/nvme/%s", devicename);
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
nvme.c:3509:3: error: ignoring return value of ‘asprintf’, declared with attribute warn_unused_result [-Werror=unused-result]
   asprintf(&path, "/sys/block/%s/device", devicename);
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
Makefile:57: recipe for target 'nvme' failed
make: *** [nvme] Error 1

Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
5 years agonvme-cli: Enhance format FNA detection
Keith Busch [Thu, 22 Aug 2019 16:20:18 +0000 (10:20 -0600)]
nvme-cli: Enhance format FNA detection

Always check the format attributes to verify if the controller will
apply the format to all namespaces, or if they can be individually
formatted. This is used to properly warn of the implications from sending
this command.

Signed-off-by: Keith Busch <keith.busch@intel.com>
5 years agonvme-cli: Warn and delay before formatting
Keith Busch [Wed, 21 Aug 2019 22:28:19 +0000 (16:28 -0600)]
nvme-cli: Warn and delay before formatting

By popular demand, have format print a warning that shows the relatives of
the device the format was sent to.

  If this command was issued to a block device, its relative are the
  parent controllers.

  If this command was issued to a controller device, its relative children
  are namespace block devices.

This provides a visual clue that /dev/nvme0 may or may not be the parent
controller to namespace /dev/nvme0n1, and provides ample time for the
user to abort the operation if they didn't mean to do this.

Here are some examples of what this change provides sending this command
to a controller first, then to a multipathed namespace:

  # nvme format /dev/nvme0 -n 1
  You are about to format nvme0, namespace 0x1.
  Controller nvme0 has child namespace(s):nvme2n1

  # nvme format /dev/nvme4n1
  You are about to format nvme4n1, namespace 0x1.
  Namespace nvme4n1 has parent controller(s):nvme4, nvme5

Link: https://github.com/linux-nvme/nvme-cli/issues/501
Signed-off-by: Keith Busch <kbusch@kernel.org>
5 years agoMerge pull request #553 from nbarrios1337/master
Keith Busch [Wed, 21 Aug 2019 21:15:48 +0000 (15:15 -0600)]
Merge pull request #553 from nbarrios1337/master

Fix bash-nvme-completion.sh typo

5 years agoMerge pull request #554 from birkelund/fix-mbuffer
Keith Busch [Wed, 21 Aug 2019 14:32:59 +0000 (08:32 -0600)]
Merge pull request #554 from birkelund/fix-mbuffer

nvme-cli: prefill metadata buffers

5 years agonvme-cli: prefill metadata buffers
Klaus Jensen [Wed, 21 Aug 2019 08:57:13 +0000 (10:57 +0200)]
nvme-cli: prefill metadata buffers

Make sure that the metadata buffer is initialized just like the data
buffer.

For read/write, prefill the metadata buffer with zeroes. For passthru,
reuse the prefill argument for the metadata buffer too.

Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
5 years agoFixed bash-nvme-completion.sh typo
Nicolas Barrios [Mon, 19 Aug 2019 00:53:50 +0000 (20:53 -0400)]
Fixed bash-nvme-completion.sh typo

Resolves #552

5 years agoTag release: v1.9 v1.9
Keith Busch [Thu, 15 Aug 2019 19:14:59 +0000 (13:14 -0600)]
Tag release: v1.9

Thank you to everyone who contributed to this release. Many updates for
the new 1.4 spec are rolling out, fabrics control enhancments, vendor
plugins/extentions, and the usual miscellaneous improvements to output
and options all included.

Shortlog:

Akinobu Mita (4):
      nvme-cli: add missing endianness conversions for telemetry log page
      nvme-cli: cleanup comments for telemetry log structure
      nvme-cli: add kernel-doc comment for struct telemetry_log_page_hdr
      nvme-cli: remove unused NVME_AER_NOTICE_*

Alexander Larin (1):
      Use 0x prefix for all hex values of id-ctrl output

Andy Lutomirski (1):
      Fix passing CFLAGS on the make command line.

Bart Van Assche (16):
      Remove superfluous casts
      Use NULL instead of 0 where a pointer is expected
      huawei: Declare local functions static
      seagate: Declare local functions static
      virtium: Declare local symbols static
      lightnvm: Fix an endianness issue
      virtium: Fix an endianness issue
      wdc: Fix endianness bugs
      Avoid using arrays with a variable length
      nvme-cli: Rework the code for getting and setting NVMf properties
      nvme-cli: Skip properties that are not supported
      Introduce NVMe 1.4 Identify Namespace fields in struct nvme_id_ns
      nvme-cli: Report the NVMe 1.4 NPWG, NPWA, NPDG, NPDA and NOWS fields
      nvme-cli: Restore support for older gcc versions
      nvme-cli: Restore RHEL 7 compatibility
      nvme-cli: Fix more endianness issues

Chaitanya Kulkarni (6):
      nvme-cli: cmbloc code cleanup
      nvme-cli: code cleanup adjust if statement
      nvme-cli: remove trailing space
      nvme-cli: use uniform if .. else format
      nvme-cli: use uniform if .. else format
      nvme-cli: use uniform if .. else format

Dominique Leuenberger (1):
      DOC: Move to DocBook 5 when using asciidoctor

Hannes Reinecke (3):
      nvme-cli: do not use 'queue_size' and 'nr_io_queues' for discovery controller
      nvme-cli: mask out invalid options during discovery
      nvme-cli: Update manpages to reflect discovery particulars

Haochen Tong (2):
      Fix code block style in the first section
      Update packaging state in Arch Linux

James Smart (8):
      nvme-cli: ignore arguments that pass in "none"
      nvme-cli: allow discover to address discovery controller by persistent name
      nvme-cli: Refactor to create a get_nvme_ctrl_info routine
      nvme-cli: extend ctrl_list_item for connect attributes
      nvme-cli: Add routine to compare ctrl_list_item to connect args
      nvme-cli: Add routine to search for controller with specific attributes
      nvme-cli: Expand --device argument processing
      nvme-cli: nvmf auto-connect scripts

Jeff Lien (4):
      [NVMe-CLI] WDC: Add support for 64 bit data addresses in Get DUI Data functions
      Add verbose capability to get DUI function to improve debug
      [NVMe-CLI] Add support for SN730 to WDC plugin commmands
      [NVMe-CLI] Add support for larger data sizes needed to get DUI data.

Jeffrey Lien (2):
      Fix Failure to read 0xCA Log Page on SN200 Device [NVMe-CLI] Fix Incorrect Data Formats with the 0xCA and 0xD0 Log Pages
      Add Disable IO flag to wdc_dump_dui_data function

Keith Busch (10):
      Revert "plugin: Return EINVAL instead of ENOTTY"
      Regen docs
      Reorder primary commands
      remove non-portable compile-time check
      Add a note to format on device naming conventions
      respin documentation
      doc: fixup 3rd party man page
      Spin documentation
      Fix sprintf truncate
      Regen docs

Kenneth Heitke (12):
      nvme: fix minor type in id-ctrl human readable output
      nvme-cli: add identify secondary controller list
      nvme-print: update self-test log to include 'aborted due to sanitize'
      nvme-print: remove Virtual Management support from ONCS
      nvme-print: add pretty print for estimated sanitize time
      nvme-print: add JSON for NVMe 1.4 NPWG, NPWA, NPDG, NPDA and NOWS fields
      nvme-print: Show value for Transport SGL Data Block Descriptor support
      nvme: add Verify command
      nvme: Enhanced Command Retry
      nvme: sanitize enhancements
      nvme: add support for Namespace Granularity
      nvme-print: show new CMBLOC bit fields added in NVMe 1.4

Max Gurtovoy (5):
      nvme: update list-ns nsid option
      nvme: update description for "nvme list" command
      fabrics: Fix memory leak of subsys list
      nvme-print: fix json object memory leak
      nvme: fix coding style issue

Minwoo Im (37):
      nvme: Close a fd leaked
      plugin: Return EINVAL instead of ENOTTY
      ioctl: Fix double-free in a loop of get_property
      ioctl: Fix wrong return case of get_property
      print: Introduce show_nvme_status to print nvme status
      print: Add const to return type of string
      get-telemtry-log: Print nvme status in case err > 0
      sanitize: Print nvme status in case ret > 0
      format: Do not return directly without freeing fd
      create-ns: Do not return directly without freeing fd
      list-ctrl: Do not return directly without freeing fd
      property: Introduce inline function to check 64bit reg
      property: Remove unnecessary wrapper function
      property: Fit print size for a property
      nvme.h: Fix typos in status code values
      nvme-cli: don't try to disconnect for ctrl with pcie transport
      nvme-cli: remove unnecessary initialize of local var
      nvme: Do not return in the middle of the subcommand
      fabrics: Do not return in the middle of the subcommand
      nvme: Return negative error value for internal errors
      nvme-status: Introduce nvme status module to map errno
      nvme: Return errno mapped for nvme error status
      fabrics: return error when discovery retry exhausted
      fabrics: Return errno mapped for fabrics error status
      format: check BLKRRPART failure
      nvme: clean up goto labels without whitespace
      lnvm: remove redundant whitespace in lnvm_init()
      lnvm: do not print 0 when the arg is not given
      lnvm: cast identity structure to (void *) directly
      doc: make description not only for PCIe
      doc: add extension plugins' command format
      lnvm: make data_len to sizeof() instead of magic number
      lnvm: introduce chunk-log command for chunk info
      lnvm: introduce alias geometry for id-ns for lnvm
      id-ctrl: add an indicator for get lba status capability
      id-ctrl: add 1.4 features to OAES
      get-lba-status: add Get LBA Status command

Quyen Truong (2):
      Add Virtium plugin extension
      Add Virtium plugin extension document

Revanth Rajashekar (2):
      nvme: add Persistent Memory Region (PMR) registers
      nvme: UUIDs for Vendor-Specific Information

Sagi Grimberg (4):
      spec, Makefile: add /etc/nvme files to package files
      spec, make: Add discovery.conf to the package files list
      nvme-cli: support persistent connections to a discovery controller
      nvme-cli: add --quiet option

Shun Sakai (1):
      Added openSUSE Leap to README.md

Simon Schricker (3):
      nvme-cli: fix typo, removing the duplicate 'are'
      nvme-cli: Increase size of ONTAP namespace path variable
      nvme-vendor: fix c99 declarations in vendor plugins

Yair Elharrar (1):
      nvme: change format default namespace id

Yoav Cohen (4):
      fix json print for list-subsys command
      add newline for command show-regs
      add free call for json object for commands show-regs
      add namespace to json output of nvme list

yongxing (1):
      NVMe-Cli Shannon Plugin-add support for shannon systems.

丁剑 (1):
      [Log] Memblaze add more log infomation for S.M.A.R.T.

Signed-off-by: Keith Busch <keith.busch@intel.com>
5 years agoRegen docs
Keith Busch [Thu, 15 Aug 2019 19:14:18 +0000 (13:14 -0600)]
Regen docs

Signed-off-by: Keith Busch <keith.busch@intel.com>
5 years agoMerge pull request #550 from RevanthRajashekar/uuid
Keith Busch [Wed, 14 Aug 2019 19:12:15 +0000 (13:12 -0600)]
Merge pull request #550 from RevanthRajashekar/uuid

nvme: UUIDs for Vendor-Specific Information

5 years agonvme: UUIDs for Vendor-Specific Information
Revanth Rajashekar [Wed, 14 Aug 2019 18:51:00 +0000 (12:51 -0600)]
nvme: UUIDs for Vendor-Specific Information

1. Add 'id-uuid' command to show the available UUID list
2. Update the get-log, get-feature, and set-feature commands
   to include a uuid-index parameter
a. If set, the index will be passed as part of DW14 to
   the controller
3. Update show_nvme_id_ctrl_ctratt() to show bit 9 of the CTRATT
   (UUID List Supported)
4. Update show_effects_log_human() to show the UUID selection bit
   of the effects log

Signed-off-by: Revanth Rajashekar <revanth.rajashekar@intel.com>
5 years agoMerge pull request #549 from RevanthRajashekar/master
Keith Busch [Tue, 13 Aug 2019 14:22:44 +0000 (08:22 -0600)]
Merge pull request #549 from RevanthRajashekar/master

nvme: add Persistent Memory Region (PMR) registers

5 years agonvme: add Persistent Memory Region (PMR) registers
Revanth Rajashekar [Tue, 6 Aug 2019 21:36:45 +0000 (15:36 -0600)]
nvme: add Persistent Memory Region (PMR) registers

*update 'show-regs' to display the new PMR registers (PMRCAP, PMRCTL, PMRSTS)
*update 'show-regs' to display the PMRS bit of the Controller Capabilities Register
*add support for error status NVME_SC_SANITIZE_PROHIBITED_PMR

Change-Id: Iec44c4c6cb6518dd6aacd870bd339668892d2525
Signed-off-by: Revanth Rajashekar <revanth.rajashekar@intel.com>
5 years agoMerge pull request #545 from sorairolake/Update-README-about-openSUSE
Keith Busch [Mon, 5 Aug 2019 13:45:43 +0000 (07:45 -0600)]
Merge pull request #545 from sorairolake/Update-README-about-openSUSE

Added openSUSE Leap to README.md

5 years agoMerge pull request #546 from minwooim/for-1.9/add-get-lba-status
Keith Busch [Mon, 5 Aug 2019 13:44:12 +0000 (07:44 -0600)]
Merge pull request #546 from minwooim/for-1.9/add-get-lba-status

Add support for Get LBA Status command

5 years agoget-lba-status: add Get LBA Status command
Minwoo Im [Sat, 3 Aug 2019 04:08:24 +0000 (13:08 +0900)]
get-lba-status: add Get LBA Status command

This command has been added in NVMe 1.4 spec.  This command can retrieve
some information about the unrecoverable LBAs from the device.

Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>
5 years agoAdded openSUSE Leap to README.md
Shun Sakai [Sun, 4 Aug 2019 02:39:37 +0000 (11:39 +0900)]
Added openSUSE Leap to README.md

5 years agoid-ctrl: add 1.4 features to OAES
Minwoo Im [Wed, 31 Jul 2019 09:35:00 +0000 (18:35 +0900)]
id-ctrl: add 1.4 features to OAES

Optional Asynchronous Events Supported now has few more fields from 1.4.

Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>
5 years agoMerge pull request #543 from hexchain/patch-1
Keith Busch [Fri, 2 Aug 2019 17:38:55 +0000 (11:38 -0600)]
Merge pull request #543 from hexchain/patch-1

Fix code block style in the first section

5 years agoMerge pull request #544 from hexchain/patch-2
Keith Busch [Fri, 2 Aug 2019 17:36:11 +0000 (11:36 -0600)]
Merge pull request #544 from hexchain/patch-2

Update packaging state in Arch Linux

5 years agoUpdate packaging state in Arch Linux
Haochen Tong [Fri, 2 Aug 2019 17:04:46 +0000 (01:04 +0800)]
Update packaging state in Arch Linux

The nvme-cli package is already available in the official repository.

5 years agoFix code block style in the first section
Haochen Tong [Fri, 2 Aug 2019 16:57:19 +0000 (00:57 +0800)]
Fix code block style in the first section

Use 4 spaces before code blocks to ensure proper formatting.

5 years agonvme-cli: nvmf auto-connect scripts
James Smart [Thu, 1 Aug 2019 23:13:48 +0000 (16:13 -0700)]
nvme-cli: nvmf auto-connect scripts

This set of scripts is a combination of those sent by Hannes, Sagi,
and I in earlier patches and RFC's.

Auto-connect operates by the nvme core layer or nvme-fc transport
generating a udev event with directory-controller addressing
information. The nvme core layer generates an event when a
persistent discovery controller generates a Discovery Log Change
Notification AEN.  The nvme-fc transport generates an event when
an FC rport that has a NVME Discovery controller is detected or
when a FC state change event occurs for for an FC rport that has
a NVME Discovery controller

The udev event is handled by a script that extracts the Discovery
controller addressing information and initiates a systemd service
to perform a "nvme connect-all" to the Discovery controller.
The "nvme connect-all" request is not called directly from the udev
handler itself as the request may take some time or stall altogether,
which would block other udev event handling.  By transitioning to
a sytemd service, the call can take as much time as needed to
complete.

The scripts consist of:
- A udev script that handles nvme core and nvme-fc udev events.
  The udev handler starts a nvmf-connect systemd service.
- A nvmf-connect systemd service. The service, in its instance
  name, is passed the connect arguments for the discovery
  controller. The service performs a "nvme connect-all" to the
  discovery controller.
- A nvmefc-boot-connections systemd service. This is a run-once
  service run after udev is enabled, which will replay events
  generated by NVME-FC devices detected during boot while udev
  is not yet running.
- To stop autoconnect an additional nvmefc-connect.target has
  been added, which will instruct systemd to cancel all
  outstanding autoconnect services.

Note: Although the nvme-fc subsystem is converting to use the
  same nvme core layer event mechanism, the nvme-fc-specific
  udev event that has been in existence for a while is contained
  in in the script so that the utilities may run against older
  kernels.

Signed-off-by: James Smart <jsmart2021@gmail.com>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Reviewed-by: Hannes Reinecke <hare@suse.com>
CC: Simon Schricker <sschricker@suse.com>
5 years agonvme-cli: add --quiet option
Sagi Grimberg [Thu, 1 Aug 2019 23:13:47 +0000 (16:13 -0700)]
nvme-cli: add --quiet option

Now we are going to have discovery log change events, so
instead of trying to figure out which NVM subsystem ports
are already connected, we let the driver do that and
only suppress the failure messages.

Example:
  nvme connect-all ... --quiet

This option will be used by the discovery log change corresponding
udev rule.

Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
Reviewed-by: James Smart <jsmart2021@gmail.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Reviewed-by: Minwoo Im <minwoo.im.dev@gmail.com>
5 years agonvme-cli: Expand --device argument processing
James Smart [Thu, 1 Aug 2019 23:13:46 +0000 (16:13 -0700)]
nvme-cli: Expand --device argument processing

The connect-all --device argument was used to specify a specific device
to be used as the discovery controller. The device is typically a
long-lived discovery controller that posted a discovery event.
No attempt was made to ensure the device is who it is supposed to be
before using it.

Revised the code to use the other arguments in the connect-all request
to validate that the device is the entity that was expected. If the
device doesn't match, the cli will look for an existing matching device
in the system (should be a discovery controller due to nqn) with the
same connect parameters and use it.  If one is not found on the system,
a new discovery controller will be created for the connect-all request.

The revision uses new routines to parse the connect arguments given
in the argstr parameter. As a couple of new fieldnames are needed, the
parse routine constants were expanded for them.

The revision uses the new routines to match the specified device vs
it's attributes as well as the search routine that looks for a device
with the connect arguments.

Signed-off-by: James Smart <jsmart2021@gmail.com>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Reviewed-by: Minwoo Im <minwoo.im.dev@gmail.com>
5 years agonvme-cli: Add routine to search for controller with specific attributes
James Smart [Thu, 1 Aug 2019 23:13:45 +0000 (16:13 -0700)]
nvme-cli: Add routine to search for controller with specific attributes

In preparation for searching controllers to match with connect args:

Create a new routine find_ctrl_with_connectargs() that will search the
controllers that exist in the system to find one that has attributes
that match the connect arguments specified.  If found, the routine
returns the controller name ("nvme?"). If not found, a NULL is returned.

Routine is defined as a global as a subsequent patch will use it
from the fabrics routines.

Signed-off-by: James Smart <jsmart2021@gmail.com>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Reviewed-by: Hannes Reinecke <hare@suse.com>
5 years agonvme-cli: Add routine to compare ctrl_list_item to connect args
James Smart [Thu, 1 Aug 2019 23:13:44 +0000 (16:13 -0700)]
nvme-cli: Add routine to compare ctrl_list_item to connect args

In preparation for searching controllers to match with connect args:

Create a new routine that receives a structure containing connect
arguments and a device name. The routine will build and fill in a
ctrl_list_item for the device and compare its attributes with the
connect arguments. The routine returns true/false on whether they
match.

Routine is defined as a global as a subsequent patch will use it
from the fabrics routines.

Signed-off-by: James Smart <jsmart2021@gmail.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
5 years agonvme-cli: extend ctrl_list_item for connect attributes
James Smart [Thu, 1 Aug 2019 23:13:43 +0000 (16:13 -0700)]
nvme-cli: extend ctrl_list_item for connect attributes

In preparation for searching controllers to match with connect args:

Extend the ctrl_list_item with elements that can be compared against
connect arguments. Extend the get_nvme_ctrl_info() routine to set
the fields.

subsysnqn was added as the ctrl_list_item may now be used outside of
a subsystem listing.

traddr, trsvid, and host_traddr are added. Their values come from
the address attribute.  A new parsing routine was added that extracts
the values from the address string.

The new parsing routine and supporting field names strings are
declared as a global interface as a subsequent patch will call it
from the fabrics routines.

Signed-off-by: James Smart <jsmart2021@gmail.com>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Reviewed-by: Hannes Reinecke <hare@suse.com>
5 years agonvme-cli: Refactor to create a get_nvme_ctrl_info routine
James Smart [Thu, 1 Aug 2019 23:13:42 +0000 (16:13 -0700)]
nvme-cli: Refactor to create a get_nvme_ctrl_info routine

In preparation for searching controllers to match with connect args:

Refactor the get_nvme_subsystem_info() routine to take the portion
that creates a ctrl_list_item and sets its values and put it in a
separate get_nvme_ctrl_info() routine.

Signed-off-by: James Smart <jsmart2021@gmail.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
5 years agonvme-cli: allow discover to address discovery controller by persistent name
James Smart [Thu, 1 Aug 2019 23:13:41 +0000 (16:13 -0700)]
nvme-cli: allow discover to address discovery controller by persistent name

To support discovery (connect/connect-all) to operate against a
persistent discovery controller, let the discovery controller to
be specified by its device node name rather than new connection
attributes.

Example:
  nvme connect-all ... --device=nvme5

Also centralize extraction of controller instance from the controller
name to a common helper.

Signed-off-by: James Smart <jsmart2021@gmail.com>
Reviewed-by: Max Gurtovoy <maxg@mellanox.com>
Reviewed-by: Minwoo Im <minwoo.im.dev@gmail.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
5 years agonvme-cli: support persistent connections to a discovery controller
Sagi Grimberg [Thu, 1 Aug 2019 23:13:40 +0000 (16:13 -0700)]
nvme-cli: support persistent connections to a discovery controller

Simply don't destroy the discovery controller after getting the
log pages. Note that persistent connection to a discovery subsystem
require to pass in a non-zero kato value, so if not provided we
simply use a default of 30 seconds kato.

Example:
  nvme connect-all ... --persistent

Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
Reviewed-by: James Smart <jsmart2021@gmail.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Reviewed-by: Max Gurtovoy <maxg@mellanox.com>
Reviewed-by: Minwoo Im <minwoo.im.dev@gmail.com>
5 years agonvme-cli: ignore arguments that pass in "none"
James Smart [Thu, 1 Aug 2019 23:13:39 +0000 (16:13 -0700)]
nvme-cli: ignore arguments that pass in "none"

As we want to support discovery uevents over different
transports, we want to allow the kernel to provide missing
information in the form of none and have nvme-cli properly
ignore it.

One example is the host_traddr. If it is not set (which means
that the default route determined the host address) we will
want to do the same for newly discovered controllers.

So allow users to pass 'none' arguments as well.

Example:
  nvme connect-all ... --hostnqn=none --hostid=none --host_traddr=none

Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: James Smart <jsmart2021@gmail.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Reviewed-by: Minwoo Im <minwoo.im.dev@gmail.com>
5 years agoMerge pull request #541 from kheitke/master
Keith Busch [Fri, 2 Aug 2019 14:56:45 +0000 (08:56 -0600)]
Merge pull request #541 from kheitke/master

nvme-print: show new CMBLOC bit fields added in NVMe 1.4

5 years agonvme-print: show new CMBLOC bit fields added in NVMe 1.4
Kenneth Heitke [Wed, 31 Jul 2019 18:57:23 +0000 (12:57 -0600)]
nvme-print: show new CMBLOC bit fields added in NVMe 1.4

* Bit 8 - CMB Queue Dword Alignment (CQDA)
* Bit 7 - CMB Data Metadata Mixed Memory Support (CDMMMS)
* Bit 6 - CMB Data Pointer and Command Independent Locations Support (CDPCILS)
* Bit 5 - CMB Data Pointer Mixed Locations Support (CDPMLS)
* Bit 4 - CMB Queue Physically Discontiguous Support (CQPDS)
* Bit 3 - CMB Queue Mixed Memory Support (CQMMS)

Reviewed-by: Edmund Nadolski <edmund.nadolski@intel.com>
Signed-off-by: Kenneth Heitke <kenneth.heitke@intel.com>
5 years agoMerge pull request #540 from kheitke/master
Keith Busch [Thu, 1 Aug 2019 21:03:01 +0000 (15:03 -0600)]
Merge pull request #540 from kheitke/master

nvme: add support for Namespace Granularity

5 years agonvme: add support for Namespace Granularity
Kenneth Heitke [Mon, 24 Jun 2019 23:33:27 +0000 (17:33 -0600)]
nvme: add support for Namespace Granularity

* Add 'id-ns-granularity' (Identify command CNS 16h)
* Show Namespace Granularity Support (ctratt) for Identify Controller

Signed-off-by: Kenneth Heitke <kenneth.heitke@intel.com>
5 years agoMerge pull request #539 from kheitke/master
Keith Busch [Thu, 1 Aug 2019 20:32:53 +0000 (14:32 -0600)]
Merge pull request #539 from kheitke/master

nvme: sanitize enhancements

5 years agonvme: sanitize enhancements
Kenneth Heitke [Wed, 29 May 2019 22:29:49 +0000 (16:29 -0600)]
nvme: sanitize enhancements

Added display of new SANICAP fields of the Identify Controller data structure
  * No-Deallocate Inhibited
  * No-Deallocate Modifies Media After Sanitize

Updated Sanitize Status Log Page to include new fields
  * Sanitize Status (SSTAT) field value (100b - completed successfully with deallocation)
  * Estimated Time For Overwrite With No-Deallocate Media Modification (bytes 23:20)
  * Estimated Time For Block Erase With No-Deallocate Media Modification (bytes 27:24)
  * Estimated Time For Crypto Erase With No-Deallocate Media Modification (bytes 31:28)

Added Get/Set Feature - Sanitize Configuration

Reviewed-by: Edmund Nadolski <edmund.nadolski@intel.com>
Signed-off-by: Kenneth Heitke <kenneth.heitke@intel.com>
5 years agoMerge pull request #536 from simson-suse/master
Keith Busch [Thu, 1 Aug 2019 14:41:47 +0000 (08:41 -0600)]
Merge pull request #536 from simson-suse/master

Mask out invalid options during discovery.

5 years agoMerge pull request #537 from minwooim/for-1.9/lnvm/introduce-get-log-page
Keith Busch [Thu, 1 Aug 2019 14:41:15 +0000 (08:41 -0600)]
Merge pull request #537 from minwooim/for-1.9/lnvm/introduce-get-log-page

lnvm: add chunk-log page

5 years agonvme-cli: Update manpages to reflect discovery particulars
Hannes Reinecke [Thu, 1 Aug 2019 09:04:08 +0000 (11:04 +0200)]
nvme-cli: Update manpages to reflect discovery particulars

Signed-off-by: Hannes Reinecke <hare@suse.com>
5 years agonvme-cli: mask out invalid options during discovery
Hannes Reinecke [Thu, 1 Aug 2019 08:47:41 +0000 (10:47 +0200)]
nvme-cli: mask out invalid options during discovery

When compiling the option string in build_options() we should ensure
to not add invalid options when doing a discovery. So add an additional
option 'discovery' to build_options() to identify these cases.

Signed-off-by: Hannes Reinecke <hare@suse.com>
5 years agonvme-cli: do not use 'queue_size' and 'nr_io_queues' for discovery controller
Hannes Reinecke [Tue, 12 Feb 2019 12:37:43 +0000 (13:37 +0100)]
nvme-cli: do not use 'queue_size' and 'nr_io_queues' for discovery controller

When connecting to a discovery controller 'queue_size' and 'nr_io_queues'
are invalid, so we shouldn't be adding them to the connect string.

Signed-off-by: Hannes Reinecke <hare@suse.com>
5 years agoMerge pull request #535 from kheitke/master
Keith Busch [Wed, 31 Jul 2019 19:11:58 +0000 (13:11 -0600)]
Merge pull request #535 from kheitke/master

nvme: Enhanced Command Retry

5 years agonvme: Enhanced Command Retry
Kenneth Heitke [Thu, 27 Jun 2019 19:01:07 +0000 (13:01 -0600)]
nvme: Enhanced Command Retry

* Show CRDT fields of Identify Controller data structure
* Show Host Behavior Supported state for Get Feature 16h
* Add support for error status NVME_SC_CMD_INTERRUPTED

Reviewed-by: Edmund Nadolski <edmund.nadolski@intel.com>
Signed-off-by: Kenneth Heitke <kenneth.heitke@intel.com>
5 years agoid-ctrl: add an indicator for get lba status capability
Minwoo Im [Wed, 31 Jul 2019 09:25:48 +0000 (18:25 +0900)]
id-ctrl: add an indicator for get lba status capability

NVMe 1.4 supports for the Get LBA Status Capability which can be
referred to 8.22.  The Identify Controller is now able to indicate
whether or not the Get LBA Status Capability is supported.

Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>
5 years agonvme: change format default namespace id
Yair Elharrar [Fri, 19 Jul 2019 07:18:59 +0000 (10:18 +0300)]
nvme: change format default namespace id

Reject format to char device without an explicit namespace argument
unless FNA requires format to all namespaces.

Signed-off-by: Yair Elharrar <yair@excelero.com>
[formatting, changelog]
Signed-off-by: Keith Busch <keith.busch@intel.com>