]> www.infradead.org Git - users/sagi/nvme-cli.git/log
users/sagi/nvme-cli.git
3 years agonvme: add select 1000b to get feature changed from default
Tokunori Ikegami [Sun, 23 May 2021 10:15:15 +0000 (19:15 +0900)]
nvme: add select 1000b to get feature changed from default

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
3 years agonvme: change get_feature to get multiple feature ids
Tokunori Ikegami [Tue, 26 Oct 2021 16:55:41 +0000 (01:55 +0900)]
nvme: change get_feature to get multiple feature ids

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
3 years agonvme: split get_feature to get multiple feature ids
Tokunori Ikegami [Thu, 20 May 2021 17:40:07 +0000 (02:40 +0900)]
nvme: split get_feature to get multiple feature ids

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
3 years agoMerge pull request #1211 from ikegami-t/nvme-print-2
Daniel Wagner [Wed, 27 Oct 2021 09:13:15 +0000 (11:13 +0200)]
Merge pull request #1211 from ikegami-t/nvme-print-2

nvme-print: Changes for id-ctrl and degree celsius prints

3 years agoMerge pull request #1214 from AkhileshRN/SN_Updates
Daniel Wagner [Tue, 26 Oct 2021 09:21:30 +0000 (11:21 +0200)]
Merge pull request #1214 from AkhileshRN/SN_Updates

Added support for SN810, SN530 and SN740 series NVMe SSDs

3 years agoAdded support for SN810, SN530 and SN740 series NVMe SSDs
Akhilesh RN [Mon, 25 Oct 2021 11:37:07 +0000 (17:07 +0530)]
Added support for SN810, SN530 and SN740 series NVMe SSDs

3 years agonvme-print: Add elpe, npss, tnvmcap and unvmcap human readable formats
Tokunori Ikegami [Fri, 7 May 2021 18:04:44 +0000 (03:04 +0900)]
nvme-print: Add elpe, npss, tnvmcap and unvmcap human readable formats

3 years agonvme-print: Add mntmt and mxtmt human readable formats
Tokunori Ikegami [Fri, 7 May 2021 17:41:42 +0000 (02:41 +0900)]
nvme-print: Add mntmt and mxtmt human readable formats

3 years agonvme-print: MAINT: Fix wctemp and cctemp description as specification
Tokunori Ikegami [Fri, 7 May 2021 17:39:28 +0000 (02:39 +0900)]
nvme-print: MAINT: Fix wctemp and cctemp description as specification

3 years agonvme-print: Print degree celsius as °C instead of C
Tokunori Ikegami [Fri, 7 May 2021 17:14:14 +0000 (02:14 +0900)]
nvme-print: Print degree celsius as  °C instead of C

3 years agonvme-print: MAINT: Fix wctemp and cctemp 16 bits width print
Tokunori Ikegami [Fri, 7 May 2021 17:02:43 +0000 (02:02 +0900)]
nvme-print: MAINT: Fix wctemp and cctemp 16 bits width print

3 years agoMerge pull request #1209 from hreinecke/anacap
Daniel Wagner [Fri, 22 Oct 2021 07:01:22 +0000 (09:01 +0200)]
Merge pull request #1209 from hreinecke/anacap

nvme-print: invert logic in ANACAP bit 6

3 years agoMerge pull request #1210 from hreinecke/dlfeat
Hannes Reinecke [Fri, 22 Oct 2021 07:01:02 +0000 (09:01 +0200)]
Merge pull request #1210 from hreinecke/dlfeat

nvme-print: add 'dlfeat' to json output

3 years agonvme-print: add 'dlfeat' to json output
Hannes Reinecke [Fri, 22 Oct 2021 06:57:04 +0000 (08:57 +0200)]
nvme-print: add 'dlfeat' to json output

Missing from json output.

Signed-off-by: Hannes Reinecke <hare@suse.de>
3 years agonvme-print: invert logic in ANACAP bit 6
Hannes Reinecke [Fri, 22 Oct 2021 06:50:46 +0000 (08:50 +0200)]
nvme-print: invert logic in ANACAP bit 6

As per spec ANACAP bit 6 indicates if the ANA group ID is static
(ie does not change).

Signed-off-by: Hannes Reinecke <hare@suse.de>
3 years agoMerge pull request #1205 from igaw/remove-endian-info
Daniel Wagner [Thu, 21 Oct 2021 11:53:04 +0000 (13:53 +0200)]
Merge pull request #1205 from igaw/remove-endian-info

build: Remove ccan/endian/info

3 years agobuild: Remove ccan/endian/info
Daniel Wagner [Thu, 21 Oct 2021 10:52:23 +0000 (12:52 +0200)]
build: Remove ccan/endian/info

7ba0a5382d06 ("meson,Makefile: fix build") added accidentially the
binary. We don't need it, let's remove it.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agoMerge pull request #1204 from birkelund/fix-build
Daniel Wagner [Thu, 21 Oct 2021 10:38:00 +0000 (12:38 +0200)]
Merge pull request #1204 from birkelund/fix-build

meson,Makefile: fix build

3 years agomeson,Makefile: fix build
Klaus Jensen [Thu, 21 Oct 2021 09:59:34 +0000 (11:59 +0200)]
meson,Makefile: fix build

Since libnvme commit 2e3616eaf0ed, the endian helpers are no longer
exported. Instead, use ccan/endian and add it to the build systems.

Meson will always checkout head of libnvme, but for the make-based
building, this requires a bump of libnvme for the submodule.

Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
3 years agoMerge pull request #1201 from ikegami-t/hex-digits-2
Daniel Wagner [Thu, 21 Oct 2021 08:29:23 +0000 (10:29 +0200)]
Merge pull request #1201 from ikegami-t/hex-digits-2

nvme: Fix to print get and set feature hex digits correct width

3 years agoMerge pull request #1202 from igaw/json-c.wrap
Daniel Wagner [Thu, 21 Oct 2021 08:19:47 +0000 (10:19 +0200)]
Merge pull request #1202 from igaw/json-c.wrap

build:  Add missing json-c.wrap

3 years agobuild: Add missing json-c.wrap
Daniel Wagner [Thu, 21 Oct 2021 07:31:36 +0000 (09:31 +0200)]
build:  Add missing json-c.wrap

Commit cad1ef9710f3 ("build: Set minimum version for json-c and add
fallback support") is missing the json-c wrap file.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agoMerge pull request #1198 from suz-yang/resv_report_fix
Daniel Wagner [Thu, 21 Oct 2021 07:27:11 +0000 (09:27 +0200)]
Merge pull request #1198 from suz-yang/resv_report_fix

nvme: fix wrong parameter passed to nvme_resv_report

3 years agonvme: Fix to print get and set feature hex digits correct width
Tokunori Ikegami [Wed, 20 Oct 2021 16:32:13 +0000 (01:32 +0900)]
nvme: Fix to print get and set feature hex digits correct width

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

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
3 years agonvme: use the 'eds' command line option replace the 'cdw11' command line option in...
suzhi.yt [Wed, 20 Oct 2021 02:34:04 +0000 (10:34 +0800)]
nvme: use the 'eds' command line option replace the 'cdw11' command line option in resv-report

Signed-off-by: suzhi.yt <suzhi.yt@antgroup.com>
3 years agoMerge pull request #1199 from leongross/fix/nvme-connect-docs
Daniel Wagner [Tue, 19 Oct 2021 11:55:27 +0000 (13:55 +0200)]
Merge pull request #1199 from leongross/fix/nvme-connect-docs

fix minor doc issues

3 years agofix minor doc issues
leongross [Tue, 19 Oct 2021 11:44:44 +0000 (13:44 +0200)]
fix minor doc issues

3 years agoMerge pull request #1196 from igaw/set-min-json-version
Daniel Wagner [Tue, 19 Oct 2021 09:34:51 +0000 (11:34 +0200)]
Merge pull request #1196 from igaw/set-min-json-version

build: Set minimum version for json-c

3 years agobuild: Set minimum version for json-c and add fallback support
Daniel Wagner [Mon, 18 Oct 2021 15:40:18 +0000 (17:40 +0200)]
build: Set minimum version for json-c and add fallback support

Set minimum version for json-c to 0.13.

nvme-cli uses json_util_get_last_err() which got introduced in 0.13,
released in December 2017.

Also, meson supports embedded library build. This is very handy for
system which ship outdated an really outdated json-c library.

The include path for json.h has to be adapted. The json-c upstream
project is not clear which include prefix should be used ('#include
<json-c/json.h>" vs '#include <json.h>'. In order to support embedded
builds, we need to use the second version of the include. The source
code is added to the build, hence we use the include directory path of
the project layout. And json-c has all include files in the root
directory. This is no problem when using a installed version of json-c
as pkg-config adds '-I/usr/inlude/json-c' to the include paths:

  $pkg-config --cflags json-c
  -I/usr/include/json-c

So the simplest thing to support both build cased (external/embedded)
just drop the include prefix.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agobuild: Update libnvme dependency
Daniel Wagner [Tue, 19 Oct 2021 09:19:01 +0000 (11:19 +0200)]
build: Update libnvme dependency

libnvme cleaned up the libnvme dependency. Update the fallback
accordinly.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agoMerge pull request #1197 from olase23/fail-on-busy-namespaceII
Hannes Reinecke [Tue, 19 Oct 2021 08:29:10 +0000 (10:29 +0200)]
Merge pull request #1197 from olase23/fail-on-busy-namespaceII

nvme: fail on busy namespace

3 years agonvme: fix wrong parameter passed to nvme_resv_report
suzhi.yt [Tue, 19 Oct 2021 07:07:27 +0000 (15:07 +0800)]
nvme: fix wrong parameter passed to nvme_resv_report

Signed-off-by: suzhi.yt <suzhi.yt@antgroup.com>
3 years agonvme: fail on busy namespace
Olaf Schmerse [Mon, 18 Oct 2021 13:42:29 +0000 (15:42 +0200)]
nvme: fail on busy namespace

To avoid formarting a busy namespace accidently a new function called
open_exclusive() is implemented. Instead of opening it always it opens
the device file in exclusive mode (O_EXCL). If this fails with the error EBUSY an error
messages hints to the --force command line option. By calling nvme format with the --force option it
will continue formating the namespace.

This patch fixes issue: #1095
Signed-off-by: Olaf Schmerse <olaf.schmerse@ionos.com>
3 years agoMerge pull request #1195 from igaw/fix-limit-h-v2
Daniel Wagner [Mon, 18 Oct 2021 13:45:26 +0000 (15:45 +0200)]
Merge pull request #1195 from igaw/fix-limit-h-v2

nvme-rpmb: Add limits.h due to missing PATH_MAX definition

3 years agoMerge pull request #1081 from ikegami-t/short-command
Daniel Wagner [Mon, 18 Oct 2021 13:09:52 +0000 (15:09 +0200)]
Merge pull request #1081 from ikegami-t/short-command

plugin: Allow to handle complementable short command

3 years agonvme-rpmb: Add limits.h due to missing PATH_MAX definition
Ariadne Conill [Mon, 26 Apr 2021 06:41:20 +0000 (00:41 -0600)]
nvme-rpmb: Add limits.h due to missing PATH_MAX definition

Commit 21f40f38b introduced new use of PATH_MAX, but did not add the
limits.h header.  This resulted in nvme-cli failing to build on
ppc64le systems using the musl C library.

Signed-off-by: Ariadne Conill <ariadne@dereferenced.org>
[dwagner: removed nvme-topology.c bits]
Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agoMerge pull request #1193 from igaw/meson
Daniel Wagner [Mon, 18 Oct 2021 09:54:41 +0000 (11:54 +0200)]
Merge pull request #1193 from igaw/meson

build: Add support for meson build system

Let's add the meson build framework. It still needs some more cleanups but we can
do this incremental in the tree.

The Makefiles are still in place so there no 'Disturbance in the Force'.

3 years agobuild: Add support for meson build system
Daniel Wagner [Mon, 11 Oct 2021 16:59:22 +0000 (18:59 +0200)]
build: Add support for meson build system

Add meson build system. I tried to mimic the existing Makefile style
but there are a couple of noteworthy differentiation.

 - meson has the concept of subprojects. It is able to download (via
   git) the dependencies (libnvme) and add them directly into the
   build system unless the library is found on the host machine
   (PKG_CONFIG_PATH needs to point to libnvme). This makes git
   submodules unnecessary. The nice thing is that we get a very simple
   setup for CI. meson knows how to download and the dependencies into
   the build.

   To make all this work the git submodule needs to be removed when we
   start using meson to build the project. 'meson dist' bundles
   libnvme into the final tar. We could obviously remove it again via
   add_dist_script but this seems not worth the time.

 - meson uses project_version() to set the version string. This is
   usually just a string (or read from a file). I added the script
   hack so that we keep the versioning consistent with the Makefile,
   e.g. that tar file has the 'git describe' version and 'nvme
   --version' says the same. For a new release, the script
   'nvme-cli-version' needs to be updated (like NVME-VERSION_GEN) and
   the release needs to be tagged before one runs 'meson dist'. I
   guess in the long run we could just set the project_version string
   in meson.build and introduce a package_version which is based on
   git. This is how systemd handles this.

 - The github workflow disables the unit tests for nvme-cli (but not
   for libnvme) by not installing nose2. Those tests fail at the
   moment.

There are still many things very rough or missing, e.g. the install
targets. But this seems like a good first version to get things going.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agoMerge pull request #1194 from jeffreyalien/master
Daniel Wagner [Wed, 13 Oct 2021 06:51:06 +0000 (08:51 +0200)]
Merge pull request #1194 from jeffreyalien/master

[nvme-cli] Prevent nvme_free call on NULL buffer

3 years ago[nvme-cli] Fix indentation
Jeff Lien [Tue, 12 Oct 2021 20:37:02 +0000 (15:37 -0500)]
[nvme-cli] Fix indentation

3 years ago[nvme-cli] Prevent nvme_free call on NULL buffer
Jeff Lien [Tue, 12 Oct 2021 19:15:10 +0000 (14:15 -0500)]
[nvme-cli] Prevent nvme_free call on NULL buffer

Signed-off-by: Jeff Lien <jeff.lien@wdc.com>
3 years agonvme: Update argconfig include
Daniel Wagner [Mon, 11 Oct 2021 16:13:04 +0000 (18:13 +0200)]
nvme: Update argconfig include

argconfig.h is lives in the util directory. Update the
include.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agonvme-status: Remove unused files
Daniel Wagner [Mon, 11 Oct 2021 16:11:56 +0000 (18:11 +0200)]
nvme-status: Remove unused files

With the libnvme refactorying these files are left overs which are not
used anymore. Remove them.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agoMerge pull request #1190 from jeffreyalien/master
Daniel Wagner [Mon, 11 Oct 2021 08:02:47 +0000 (10:02 +0200)]
Merge pull request #1190 from jeffreyalien/master

[nvme-cli] Add support for additional SN650 pci id

3 years ago[nvme-cli] Add support for additional SN650 pci id
Jeff Lien [Thu, 7 Oct 2021 20:32:30 +0000 (15:32 -0500)]
[nvme-cli] Add support for additional SN650 pci id

Signed-off-by: Jeff Lien <jeff.lien@wdc.com>
3 years agoMerge pull request #1178 from verschwindibussen/external-libnvme
Daniel Wagner [Thu, 7 Oct 2021 15:21:14 +0000 (17:21 +0200)]
Merge pull request #1178 from verschwindibussen/external-libnvme

Support to shared libnvme builds

3 years agoMerge pull request #1188 from igaw/drop-ccan-dependency
Hannes Reinecke [Thu, 7 Oct 2021 07:44:53 +0000 (09:44 +0200)]
Merge pull request #1188 from igaw/drop-ccan-dependency

nvme-print: Use array array instead of ccan/list

3 years agonvme-print: Use array array instead of ccan/list
Daniel Wagner [Thu, 7 Oct 2021 07:06:28 +0000 (09:06 +0200)]
nvme-print: Use array array instead of ccan/list

Commit 155fbebfe7b7 ("Update effects-log to handle multiple command
sets") added a dependency to libvnme/ccan which conflicts with making
the libnvme shared library.

We can simply replace the list by an fixed sized array as we know we
either have 1 or 2 elements in the list.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agoMerge pull request #1183 from hanumanthuh/master
Hannes Reinecke [Wed, 6 Oct 2021 15:39:25 +0000 (17:39 +0200)]
Merge pull request #1183 from hanumanthuh/master

Extended SMART log parsing support

3 years agoMerge pull request #1187 from hreinecke/libnvme-update
Hannes Reinecke [Wed, 6 Oct 2021 15:29:11 +0000 (17:29 +0200)]
Merge pull request #1187 from hreinecke/libnvme-update

Update libnvme to current master

3 years agoUpdate libnvme to current master
Hannes Reinecke [Wed, 6 Oct 2021 15:21:36 +0000 (17:21 +0200)]
Update libnvme to current master

Update the libnvme submodule reference for the current libnvme HEAD.

Signed-off-by: Hannes Reinecke <hare@suse.de>
3 years agoMerge pull request #1186 from hreinecke/gcc-fixes
Hannes Reinecke [Wed, 6 Oct 2021 15:22:33 +0000 (17:22 +0200)]
Merge pull request #1186 from hreinecke/gcc-fixes

Fixup compiler warnings

3 years agoFixup compiler warnings
Hannes Reinecke [Wed, 6 Oct 2021 15:12:07 +0000 (17:12 +0200)]
Fixup compiler warnings

Compiling with additional compiler options generates some warnings;
fix them.

Signed-off-by: Hannes Reinecke <hare@suse.de>
3 years agopoint libnvme remote to correct upstream
Keith Busch [Wed, 6 Oct 2021 11:15:35 +0000 (04:15 -0700)]
point libnvme remote to correct upstream

3 years agoFix a bug where CSI was not handled in nvme create-ns
Andreas Hindborg [Wed, 6 Oct 2021 11:11:21 +0000 (04:11 -0700)]
Fix a bug where CSI was not handled in nvme create-ns

Signed-off-by: Andreas Hindborg <andreas.hindborg@wdc.com>
Signed-off-by: Keith Busch <kbusch@kernel.org>
3 years agoupdate libnvme
Keith Busch [Wed, 6 Oct 2021 11:08:29 +0000 (04:08 -0700)]
update libnvme

3 years agoFix dead assignment
Andreas Hindborg [Thu, 16 Sep 2021 05:30:37 +0000 (05:30 +0000)]
Fix dead assignment

This patch fixes a bug in the error handling in `zns_mgmt_send`, where error
cause was not reported correctly.

Signed-off-by: Andreas Hindborg <andreas.hindborg@wdc.com>
3 years agoUpdate effects-log to handle multiple command sets
Andreas Hindborg [Thu, 9 Sep 2021 07:27:25 +0000 (07:27 +0000)]
Update effects-log to handle multiple command sets

This patch updates the effects-log command to correctly handle multiple
supported command sets. As each command set is allowed to support a distinct
subset of commands, the log page must to be reported for each command set.

Signed-off-by: Andreas Hindborg <andreas.hindborg@wdc.com>
3 years agoAdd header to vendor commands in effects-log
Andreas Hindborg [Mon, 13 Sep 2021 20:02:33 +0000 (20:02 +0000)]
Add header to vendor commands in effects-log

This patch adds a header preceding the opcode list when printing the
effects-log:

nvme effects-log /dev/nvmex
Admin Commands
ACS0     [Delete I/O Submission Queue     ] 00000001
ACS1     [Create I/O Submission Queue     ] 00000001
<snip>

Vendor Specific Admin Commands
ACS198   [Unknown                         ] 00000001
ACS204   [Unknown                         ] 0002001f

I/O Commands
IOCS0    [Flush                           ] 00000001
IOCS1    [Write                           ] 00000003
<snip>

Vendor Specific I/O Commands
IOCS129  [Unknown                         ] 00000003

The patch does not change binary or json output formats.

Signed-off-by: Andreas Hindborg <andreas.hindborg@wdc.com>
3 years agoAdd formatting of ZNS I/O Command opcodes
Andreas Hindborg [Mon, 13 Sep 2021 13:08:47 +0000 (13:08 +0000)]
Add formatting of ZNS I/O Command opcodes

Signed-off-by: Andreas Hindborg <andreas.hindborg@wdc.com>
3 years agoExtended SMART log parsing support
Hanumanthu H [Fri, 1 Oct 2021 04:55:12 +0000 (10:25 +0530)]
Extended SMART log parsing support

3 years agozns: Add list command
Andreas Hindborg [Mon, 13 Sep 2021 13:13:53 +0000 (13:13 +0000)]
zns: Add list command

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

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

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

Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
3 years agoMakefile: Add support to build against shared libnvme library
Daniel Wagner [Mon, 27 Sep 2021 14:07:41 +0000 (16:07 +0200)]
Makefile: Add support to build against shared libnvme library

Support building nvme-cli using a shared version of libvnme. The
Makefile checks first if libnvme has been checked out as git submodule
in under libvnme and uses this as first preference. If this fails
pkg-config is used to determine if a shared libnvme exists.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agoMakefile: Make nvme target dependend on the object file
Daniel Wagner [Mon, 27 Sep 2021 14:05:05 +0000 (16:05 +0200)]
Makefile: Make nvme target dependend on the object file

The target rules should depend on the nvme.o object file. Note, nvme.o
depends on nvme.c and nvme.h.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
3 years agoMakefile: Fix pattern rules
Daniel Wagner [Mon, 27 Sep 2021 13:58:08 +0000 (15:58 +0200)]
Makefile: Fix pattern rules

The pattern rules can't have additional dependency as input. make skips
the rule and falls back to use the build in rule, which accidentally
works.. Drop the non-functional dependency list.

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

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

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

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

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

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

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

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

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

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

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

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

It's not executable.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

CI complained about a missing format for fprintf().

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

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

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

To avoid failures during CI run.

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

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

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

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

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

Not required for most plugins.

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

Convert cli and plugins to libnvme and remove old files.

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

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

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

Obsolete.

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

Signed-off-by: Keith Busch <kbusch@kernel.org>
Signed-off-by: Hannes Reinecke <hare@suse.de>
4 years agoplugin: Allow to handle complementable short command
Tokunori Ikegami [Sun, 13 Jun 2021 16:00:21 +0000 (01:00 +0900)]
plugin: Allow to handle complementable short command

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
4 years agonvme: fix errno for non nvme device return errors
Gollu Appalanaidu [Tue, 4 May 2021 15:54:52 +0000 (21:24 +0530)]
nvme: fix errno for non nvme device return errors

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

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

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

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>