]> www.infradead.org Git - users/sagi/nvme-cli.git/log
users/sagi/nvme-cli.git
5 years agoMerge branch 'dera-plugin' of github.com:Dequan-Dera/nvme-cli into dera-plugin
wudequan [Thu, 21 Nov 2019 03:41:44 +0000 (11:41 +0800)]
Merge branch 'dera-plugin' of github.com:Dequan-Dera/nvme-cli into dera-plugin

5 years agoAdd Dera plugin extension.
wudequan [Mon, 18 Nov 2019 02:44:12 +0000 (10:44 +0800)]
Add Dera plugin extension.
Add stat sub-command to retrieve Dera device status and additional SMART log.

5 years agoAdd Dera plugin extension.
wudequan [Mon, 18 Nov 2019 02:44:12 +0000 (10:44 +0800)]
Add Dera plugin extension.
Add stat sub-command to retrieve Dera device status and additional SMART log.

5 years agonvme-cli: Update PMR Capability and PMR Status
Revanth Rajashekar [Tue, 29 Oct 2019 00:02:30 +0000 (18:02 -0600)]
nvme-cli: Update PMR Capability and PMR Status
1. Adding Controller Memory Space Supported(CMSS) in PMRCAP
2. Adding Persistent Memory Region Status(CBAI) in PMRSTS

Signed-off-by: Revanth Rajashekar <revanth.rajashekar@intel.com>
5 years agonvme-cli: Update Controller Capabilities Register
Revanth Rajashekar [Mon, 28 Oct 2019 23:43:38 +0000 (17:43 -0600)]
nvme-cli: Update Controller Capabilities Register
1. Add Controller Memory Buffer Supported (CMBS)

Signed-off-by: Revanth Rajashekar <revanth.rajashekar@intel.com>
5 years agonvme-cli: Update NVMe Registers
Revanth Rajashekar [Mon, 28 Oct 2019 23:20:29 +0000 (17:20 -0600)]
nvme-cli: Update NVMe Registers
1. Add Controller Memory Buffer Memory Space Control (CMBMSC)
2. Add Controller Memory Buffer Status (CMBSTS)
3. Add Persistent Memory Region Memory Space Control (PMRMSC)

Update show registers

Signed-off-by: Revanth Rajashekar <revanth.rajashekar@intel.com>
5 years agofixup attach-ns documentation
Keith Busch [Wed, 23 Oct 2019 02:40:09 +0000 (11:40 +0900)]
fixup attach-ns documentation

Signed-off-by: Keith Busch <kbusch@kernel.org>
5 years agoMerge pull request #578 from rgirasegit/patch-1
Keith Busch [Wed, 23 Oct 2019 02:04:23 +0000 (11:04 +0900)]
Merge pull request #578 from rgirasegit/patch-1

Add an example for attach-ns

5 years agoAdd files via upload
rgirasegit [Wed, 23 Oct 2019 01:40:21 +0000 (07:10 +0530)]
Add files via upload

5 years agoMerge pull request #593 from jeffreyalien/master
Keith Busch [Fri, 18 Oct 2019 19:40:28 +0000 (13:40 -0600)]
Merge pull request #593 from jeffreyalien/master

[NVMe-CLI] Updates to WDC plugin command vs-internal-log

5 years ago[NVMe-CLI] Updates and fixes to WDC plugin command vs-internal-log
Jeff Lien [Fri, 18 Oct 2019 18:09:21 +0000 (13:09 -0500)]
[NVMe-CLI] Updates and fixes to WDC plugin command vs-internal-log
for the SN340 drive.

5 years agoRegen docs, add host-nqn man page
Keith Busch [Mon, 14 Oct 2019 23:08:10 +0000 (08:08 +0900)]
Regen docs, add host-nqn man page

Signed-off-by: Keith Busch <kbusch@kernel.org>
5 years agoMerge pull request #592 from jeffreyalien/new_branch_name
Keith Busch [Fri, 11 Oct 2019 21:53:28 +0000 (15:53 -0600)]
Merge pull request #592 from jeffreyalien/new_branch_name

New branch name

5 years ago[NVMe-ClI] Add Documentation files for clear-fw-activate-history command
Jeff Lien [Fri, 11 Oct 2019 21:39:50 +0000 (16:39 -0500)]
[NVMe-ClI] Add Documentation files for clear-fw-activate-history command

5 years ago[NVMe-CLI] Add clear-fw-activate-history WDC plugin command
Jeff Lien [Thu, 10 Oct 2019 20:56:01 +0000 (15:56 -0500)]
[NVMe-CLI] Add clear-fw-activate-history WDC plugin command

5 years agoMerge https://github.com/linux-nvme/nvme-cli
Jeff Lien [Thu, 10 Oct 2019 20:20:05 +0000 (15:20 -0500)]
Merge https://github.com/linux-nvme/nvme-cli

5 years agofix namespace checks for legacy list
Keith Busch [Thu, 10 Oct 2019 19:35:56 +0000 (04:35 +0900)]
fix namespace checks for legacy list

First ensure the controller we're comparing with has been initialized, and then
compare the correct fields with each other. Previously had been comparing a
model number against the serial.

Link: http://lists.infradead.org/pipermail/linux-nvme/2019-October/027562.html
Reported-by: Jeff Lien <jeff.lien@wdc.com>
Signed-off-by: Keith Busch <kbusch@kernel.org>
5 years agoReset wdc_do_cap_dui default parameters to the proper values
Jeff Lien [Wed, 9 Oct 2019 20:51:54 +0000 (15:51 -0500)]
Reset wdc_do_cap_dui default parameters to the proper values

5 years agoMerge pull request #589 from sephalon/oe-recipe-readme
Keith Busch [Wed, 9 Oct 2019 15:05:26 +0000 (09:05 -0600)]
Merge pull request #589 from sephalon/oe-recipe-readme

README.md: Mention the OpenEmbedded/Yocto recipe

5 years agoREADME.md: Mention the OpenEmbedded/Yocto recipe
Stefan Wiehler [Wed, 9 Oct 2019 14:49:24 +0000 (16:49 +0200)]
README.md: Mention the OpenEmbedded/Yocto recipe

Signed-off-by: Stefan Wiehler <stefan.wiehler@missinglinkelectronics.com>
5 years agoMerge pull request #584 from benreese0/master
Keith Busch [Tue, 8 Oct 2019 21:19:27 +0000 (15:19 -0600)]
Merge pull request #584 from benreese0/master

Intel plugin: Adding fields to id-ctrl VU region

5 years agoIntel plugin: Adding fields to id-ctrl VU region
Ben Reese [Tue, 8 Oct 2019 19:24:34 +0000 (12:24 -0700)]
Intel plugin: Adding fields to id-ctrl VU region
Per https://github.com/linux-nvme/nvme-cli/pull/584/commits/f33510efbf5192116e5757d13a02463d446a1dc5#r332178975 removing pack pragma on vu_id_ctrl_field struct.

Signed-off-by: Ben Reese <5884008+benreese0@users.noreply.github.com>
5 years agoMerge pull request #588 from amluto/hostnqn
Keith Busch [Mon, 7 Oct 2019 18:49:36 +0000 (12:49 -0600)]
Merge pull request #588 from amluto/hostnqn

Use a systemd app-specific machine ID for hostnqn

5 years agoMerge pull request #587 from RevanthRajashekar/error_log
Keith Busch [Mon, 7 Oct 2019 18:49:09 +0000 (12:49 -0600)]
Merge pull request #587 from RevanthRajashekar/error_log

nvme-cli: Add 'transport type' error to the error log

5 years agoMerge pull request #586 from RevanthRajashekar/endu_grp_log
Keith Busch [Mon, 7 Oct 2019 18:48:34 +0000 (12:48 -0600)]
Merge pull request #586 from RevanthRajashekar/endu_grp_log

nvme-cli: Update nvme_endurance_group_log structure

5 years agoMerge pull request #583 from pszczerx/nvme_list_bugfix
Keith Busch [Mon, 7 Oct 2019 18:41:15 +0000 (12:41 -0600)]
Merge pull request #583 from pszczerx/nvme_list_bugfix

Check return value of scandir

5 years agoMerge pull request #579 from RevanthRajashekar/self_test_log
Keith Busch [Mon, 7 Oct 2019 18:39:56 +0000 (12:39 -0600)]
Merge pull request #579 from RevanthRajashekar/self_test_log

nvme-cli: Add namespace-id option to self-test-log

5 years agoudev: convert the discovery event handler to the kernel support
Sagi Grimberg [Mon, 7 Oct 2019 18:22:21 +0000 (11:22 -0700)]
udev: convert the discovery event handler to the kernel support

The kernel will not send us a specific event for discovery but
rather the AEN result code. So expect NVME_AEN=0x70f002 for
discovery log change events.

Also, we don't get the NVME_CTRL_NAME env var anymore as this is
available from the device $kernel.

Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
5 years agoUse a systemd app-specific machine ID for hostnqn
Andy Lutomirski [Thu, 3 Oct 2019 18:47:02 +0000 (11:47 -0700)]
Use a systemd app-specific machine ID for hostnqn

If /etc/nvme/hostnqn is not present, the fabric commands will ask
systemd for an app-specific machine ID as a fallback.  This should
improve functionality if /etc/nvme/hostnqn is not present and should
allow packagers to avoid creating /etc/nvme/hostnqn.

Heavily based on an earlier patch from Tomasz Torcz.

Signed-off-by: Tomasz Torcz <tomek@pipebreaker.pl>
Signed-off-by: Andy Lutomirski <luto@kernel.org>
5 years agonvme-cli: Add 'transport type' error to the error log
Revanth Rajashekar [Mon, 30 Sep 2019 23:40:18 +0000 (17:40 -0600)]
nvme-cli: Add 'transport type' error to the error log

* Update show_error_log
* Update json_error_log

Signed-off-by: Revanth Rajashekar <revanth.rajashekar@intel.com>
5 years agonvme-cli: Update nvme_endurance_group_log structure
Revanth Rajashekar [Mon, 30 Sep 2019 22:35:40 +0000 (16:35 -0600)]
nvme-cli: Update nvme_endurance_group_log structure

* Update show_endurance_log
* Update json_endurance_log

Signed-off-by: Revanth Rajashekar <revanth.rajashekar@intel.com>
5 years agoAdding fields to id-ctrl VU reigon for Intel DC drives
Ben Reese [Fri, 27 Sep 2019 17:05:32 +0000 (10:05 -0700)]
Adding fields to id-ctrl VU reigon for Intel DC drives

Signed-off-by: Ben Reese <5884008+benreese0@users.noreply.github.com>
5 years agoCheck return value of scandir
Szczerbik, Przemyslaw [Fri, 27 Sep 2019 06:39:50 +0000 (07:39 +0100)]
Check return value of scandir

On error, scandir returns -1 and does not allocate memory
for namelist array. In some places in the code return value
of scandir call is not checked. This causes nvme-cli to
attempt to free() an uninitialized pointer, which subsequently
leads to segmentation fault.

To address this issue, check return value of scandir calls
throughout the code.

Signed-off-by: Szczerbik, Przemyslaw <przemyslawx.szczerbik@intel.com>
5 years agonvme-cli: Add namespace-id option to self-test-log
Revanth Rajashekar [Thu, 26 Sep 2019 16:34:20 +0000 (10:34 -0600)]
nvme-cli: Add namespace-id option to self-test-log

Instead of scanning all the namespaces for logs, the user can specify
the namespace from which he wants to retrieve the self-test log from.

Signed-off-by: Revanth Rajashekar <revanth.rajashekar@intel.com>
5 years agoReport invalid output format for 'list' command
Keith Busch [Wed, 25 Sep 2019 17:26:12 +0000 (02:26 +0900)]
Report invalid output format for 'list' command

Don't fail silently if user provdies invalid 'list' options.

Reported-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Keith Busch <kbusch@kernel.org>
5 years agoProvide no-binary output format help text
Keith Busch [Wed, 25 Sep 2019 17:23:17 +0000 (02:23 +0900)]
Provide no-binary output format help text

The binary output is only for device returned structures. Remove this
help text for the 'list' command.

Signed-off-by: Keith Busch <kbusch@kernel.org>
5 years agoregen documentation
Keith Busch [Tue, 24 Sep 2019 15:57:41 +0000 (00:57 +0900)]
regen documentation

Signed-off-by: Keith Busch <kbusch@kernel.org>
5 years agoMerge pull request #576 from sc108-lee/for-upstream/Documentation
Keith Busch [Fri, 20 Sep 2019 18:50:54 +0000 (12:50 -0600)]
Merge pull request #576 from sc108-lee/for-upstream/Documentation

Documentation: nvme-wdc-vs-fw-activate-history(1,html) generated

5 years agoMerge pull request #574 from ekohande/self-test-log
Keith Busch [Fri, 20 Sep 2019 18:50:38 +0000 (12:50 -0600)]
Merge pull request #574 from ekohande/self-test-log

Correct self-test-log output

5 years agoDocumentation: nvme-wdc-vs-fw-activate-history(1,html) generated
Steven Seungcheol Lee [Fri, 20 Sep 2019 07:20:04 +0000 (16:20 +0900)]
Documentation: nvme-wdc-vs-fw-activate-history(1,html) generated

Signed-off-by: Steven Seungcheol Lee <sc108.lee@samsung.com>
5 years agoMerge pull request #572 from RevanthRajashekar/endu_grp
Keith Busch [Thu, 19 Sep 2019 15:56:16 +0000 (09:56 -0600)]
Merge pull request #572 from RevanthRajashekar/endu_grp

nvme: Add 'Endurance Group Critical Warning Summary' to the Smart/Hea…

5 years agoMerge pull request #575 from sc108-lee/for-upstream/rpm
Keith Busch [Thu, 19 Sep 2019 15:55:58 +0000 (09:55 -0600)]
Merge pull request #575 from sc108-lee/for-upstream/rpm

nvme.spec.in: fix rpm build error

5 years agonvme-cli/fabrics: Add tos param to connect cmd
Israel Rukshin [Thu, 19 Sep 2019 15:35:40 +0000 (18:35 +0300)]
nvme-cli/fabrics: Add tos param to connect cmd

Added 'tos' to 'connect' command so users can specify the type of service.

usage examples:
nvme connect --tos=0 --transport=rdma --traddr=10.0.1.1 --nqn=test-nvme
nvme connect -T 0 -t rdma -a 10.0.1.1 -n test_nvme

Signed-off-by: Israel Rukshin <israelr@mellanox.com>
Reviewed-by: Max Gurtovoy <maxg@mellanox.com>
5 years agonvme.spec.in: fix rpm build error
Steven Seungcheol Lee [Thu, 19 Sep 2019 10:22:45 +0000 (19:22 +0900)]
nvme.spec.in: fix rpm build error

error caused by 70-nvmf-autoconnect.rules location different with Makefile.

Signed-off-by: Steven Seungcheol Lee <sc108.lee@samsung.com>
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 branch 'master' of https://github.com/linux-nvme/nvme-cli into endu_grp
Revanth Rajashekar [Wed, 18 Sep 2019 17:01:22 +0000 (11:01 -0600)]
Merge branch 'master' of https://github.com/linux-nvme/nvme-cli into endu_grp

5 years agonvme: Add 'Endurance Group Critical Warning Summary' to the Smart/Health information Log
Revanth Rajashekar [Fri, 13 Sep 2019 18:54:33 +0000 (12:54 -0600)]
nvme: Add 'Endurance Group Critical Warning Summary' to the Smart/Health information Log

      * Update show_smart_log
      * Update json_smart_log

Signed-off-by: Revanth Rajashekar <revanth.rajashekar@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 agoAdd an example for attach-ns
rgirasegit [Fri, 23 Aug 2019 10:05:46 +0000 (15:35 +0530)]
Add an example for attach-ns

Add an example to man page of attach-ns command showing syntax and information to use hexadecimal value for Namespace identifier and controller identifier.

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>