]> www.infradead.org Git - users/sagi/nvme-cli.git/log
users/sagi/nvme-cli.git
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 #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 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>
4 years agonvme: add the LBA format upper in Format NVM Command
Gollu Appalanaidu [Sun, 6 Jun 2021 19:23:59 +0000 (00:53 +0530)]
nvme: add the LBA format upper in Format NVM Command

Add the LBAFU in FormatNVM command as per the NVMe 2.0
Base Specification.

Signed-off-by: Gollu Appalanaidu <anaidu.gollu@samsung.com>
4 years agonvme-print: sanitize log style fix
Gollu Appalanaidu [Sat, 29 May 2021 18:01:41 +0000 (23:31 +0530)]
nvme-print: sanitize log style fix

Signed-off-by: Gollu Appalanaidu <anaidu.gollu@samsung.com>
4 years agofabrics: skip connect if transport type doesn't match
Martin George [Sat, 5 Jun 2021 09:46:26 +0000 (15:16 +0530)]
fabrics: skip connect if transport type doesn't match

Discovery log page data may include records belonging to different
transport types. If during a nvme connect-all, a connect is attempted
on a record that doesn't match the transport type passed here, it
would end up in a connect failure for that record. For e.g. one would
see the below error if a connect is attempted on a tcp record but the
transport type passed here is 'fc' and its associated parameters:

nvme_tcp: malformed src address passed: nn-0xXXXX:pn-0xYYYY

Fix this by proceeding with the connect only if the appropriate
transport type matches a given record during the connect-all.

Signed-off-by: Martin George <marting@netapp.com>
4 years agonvme: update passthru commands man page with latency parameter details
Gollu Appalanaidu [Fri, 4 Jun 2021 05:31:54 +0000 (11:01 +0530)]
nvme: update passthru commands man page with latency parameter details

Signed-off-by: Gollu Appalanaidu <anaidu.gollu@samsung.com>
4 years agovs-drive-info command opcode change for M5407 drives
Hanumanthu H [Fri, 4 Jun 2021 10:18:58 +0000 (15:48 +0530)]
vs-drive-info command opcode change for M5407 drives

4 years agoSupport micron vs-smart-add-log option for M54XX drives
Hanumanthu H [Tue, 1 Jun 2021 14:40:51 +0000 (20:10 +0530)]
Support micron vs-smart-add-log option for M54XX drives

4 years agonvme: add json, binary and human readable output format for id iocs
Gollu Appalanaidu [Fri, 28 May 2021 18:11:33 +0000 (23:41 +0530)]
nvme: add json, binary and human readable output format for id iocs

Signed-off-by: Gollu Appalanaidu <anaidu.gollu@samsung.com>
4 years agonvme: add persistent event log action field invalid check
Gollu Appalanaidu [Thu, 27 May 2021 06:32:28 +0000 (12:02 +0530)]
nvme: add persistent event log action field invalid check

Signed-off-by: Gollu Appalanaidu <anaidu.gollu@samsung.com>
4 years agonvme: add zone desc changed notice async event
Gollu Appalanaidu [Fri, 28 May 2021 13:52:45 +0000 (19:22 +0530)]
nvme: add zone desc changed notice async event

Add the Zone Descriptor Changed Notices in get feature
human readble output for the Async Event config feature
(FID = 0x0B) as per the TP4053 Zoned Namespaces

Signed-off-by: Gollu Appalanaidu <anaidu.gollu@samsung.com>
4 years agonvme: add optional copy format support id ctrl field
Gollu Appalanaidu [Fri, 28 May 2021 05:10:40 +0000 (10:40 +0530)]
nvme: add optional copy format support id ctrl field

Add the OCFS field in Identify Controller Structure, as per the
Ratified TP 4065b (Simple Copy Command).

Signed-off-by: Gollu Appalanaidu <anaidu.gollu@samsung.com>
4 years agonvme: add lsp and uuid index invalid value checks in get log
Gollu Appalanaidu [Thu, 27 May 2021 06:23:40 +0000 (11:53 +0530)]
nvme: add lsp and uuid index invalid value checks in get log

Add the invalid LSP and UUID Index value checks as per the field
lengths. Refactor the get_log function.

Signed-off-by: Gollu Appalanaidu <anaidu.gollu@samsung.com>
4 years agonvme: add latency parameter for passthru commands
Gollu Appalanaidu [Thu, 3 Jun 2021 16:45:41 +0000 (22:15 +0530)]
nvme: add latency parameter for passthru commands

Signed-off-by: Gollu Appalanaidu <anaidu.gollu@samsung.com>
4 years agowdc-nvme: fix the build failure
Gollu Appalanaidu [Thu, 3 Jun 2021 16:51:10 +0000 (22:21 +0530)]
wdc-nvme: fix the build failure

Signed-off-by: Gollu Appalanaidu <anaidu.gollu@samsung.com>
4 years agoAddressed review comments
Akhilesh RN [Thu, 27 May 2021 11:57:17 +0000 (17:27 +0530)]
Addressed review comments

4 years agoZN-350 - vs-fw-activate-history bug fix
Akhilesh RN [Wed, 26 May 2021 13:41:26 +0000 (19:11 +0530)]
ZN-350 - vs-fw-activate-history bug fix

4 years agoAdd --host-iface option
Martin Belanger [Thu, 20 May 2021 17:49:44 +0000 (13:49 -0400)]
Add --host-iface option

4 years agonvme-topology: no error message when openeing of controller fails
Daniel Wagner [Wed, 2 Jun 2021 13:42:42 +0000 (15:42 +0200)]
nvme-topology: no error message when openeing of controller fails

scan_ctrl() tries to open the controller device but this operation is
expected to fail for fabric setups when a path is down. This can lead
to the situation where the subsystem is in a healthy state, e.g. at
least one path is in live state. In this scenario a failure is printed
although everything is fine.

This is especially a problem for NVMe/TCP configs where the controller
remains in 'connecting' state for 10 minutes following a path
down. All that time 'nvme list' ends up in errors and that's a major
irritant for end users. This also makes CI automation more complex
than needed.

Just drop the error message as we have other error paths in this
function where we just bail out if they fail without printing an
error message.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
4 years agodefault flush to use block device nsid
Keith Busch [Tue, 1 Jun 2021 14:01:44 +0000 (07:01 -0700)]
default flush to use block device nsid

Kernel 5.13 added checks to ensure the ioctl path can't be abused to
access a different namespace than the one user space has permission to
open. This unfortunately breaks the all-nsid flush usage, so user
tooling needs to default to the device's namespace id.

Link: https://lore.kernel.org/linux-nvme/20210518144249.GE2709569@dhcp-10-100-145-180.wdc.com/T/#t
Link: https://github.com/linux-nvme/nvme-cli/issues/1066
Signed-off-by: Keith Busch <kbusch@kernel.org>
4 years agoZN-350 - wdc purge command bug fix
Akhilesh RN [Fri, 28 May 2021 10:09:59 +0000 (15:39 +0530)]
ZN-350 - wdc purge command bug fix

4 years agojson format support for micron vs-drive-info command
Hanumanthu H [Thu, 27 May 2021 08:46:23 +0000 (14:16 +0530)]
json format support for micron vs-drive-info command

4 years agozns: fix get_zdes_bytes return value in failed cases
Gollu Appalanaidu [Tue, 18 May 2021 04:25:55 +0000 (09:55 +0530)]
zns: fix get_zdes_bytes return value in failed cases

get_zdes_bytes shall return constant value in failed cases in
order to catch in called function

Check if the get_zdes_bytes returned proper data length or not.

Signed-off-by: Gollu Appalanaidu <anaidu.gollu@samsung.com>
4 years agocorrected-returns-in-sanitize-log
James Kahn [Wed, 26 May 2021 18:22:34 +0000 (14:22 -0400)]
corrected-returns-in-sanitize-log

4 years agonvme: fix parameter sizes
Gollu Appalanaidu [Wed, 26 May 2021 06:29:19 +0000 (11:59 +0530)]
nvme: fix parameter sizes

Fix the parameter sizes as per the data type in complete
nvme.c file.

Signed-off-by: Gollu Appalanaidu <anaidu.gollu@samsung.com>
4 years agofabrics: add fast_io_fail_tmo option
Sagi Grimberg [Mon, 17 May 2021 18:26:16 +0000 (11:26 -0700)]
fabrics: add fast_io_fail_tmo option

Option to fail fast I/O when connecting to a controller. It is useful
to set a fast-fail timeout for nvme in case upper layer SW wants to
detect unresponsive controllers early (e.g. mdraid).

Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Keith Busch <kbusch@kernel.org>
4 years agosystemd/nvmf-autoconnect.service: load nvme-fabrics before autoconnect
Sagi Grimberg [Wed, 26 May 2021 07:25:15 +0000 (00:25 -0700)]
systemd/nvmf-autoconnect.service: load nvme-fabrics before autoconnect

Upon boot nvme-fabrics needs to be loaded, so make sure to load
it before executing ExecStart. The driver will know to request
the transport module according to the transport parameter.

Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
4 years agonvme: add json output format for list_ns
Gollu Appalanaidu [Sun, 16 May 2021 04:19:02 +0000 (09:49 +0530)]
nvme: add json output format for list_ns

Signed-off-by: Gollu Appalanaidu <anaidu.gollu@samsung.com>
4 years agonvme-cli: Add lsi option for get-log command
Tokunori Ikegami [Tue, 27 Oct 2020 14:56:43 +0000 (23:56 +0900)]
nvme-cli: Add lsi option for get-log command

Previously lsi is set as 0 as hard coded value by the get-log command.
To set this parameter by the command add lsi option for the command.

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
4 years agozns: style fixes in zns plugin
Gollu Appalanaidu [Tue, 18 May 2021 04:19:20 +0000 (09:49 +0530)]
zns: style fixes in zns plugin

Signed-off-by: Gollu Appalanaidu <anaidu.gollu@samsung.com>
4 years agonvme-ioctl: remove unused function nvme_identify_ns_list
Gollu Appalanaidu [Sat, 15 May 2021 17:58:58 +0000 (23:28 +0530)]
nvme-ioctl: remove unused function nvme_identify_ns_list

Signed-off-by: Gollu Appalanaidu <anaidu.gollu@samsung.com>
4 years agonvme: add json output format for list_crl
Gollu Appalanaidu [Sun, 16 May 2021 07:20:15 +0000 (12:50 +0530)]
nvme: add json output format for list_crl

Signed-off-by: Gollu Appalanaidu <anaidu.gollu@samsung.com>
4 years agonvme: fix csi data type in list_ns
Gollu Appalanaidu [Sun, 16 May 2021 03:51:46 +0000 (09:21 +0530)]
nvme: fix csi data type in list_ns

Command Set Identifier (CSI) data type is 8 bits, fix that.

Signed-off-by: Gollu Appalanaidu <anaidu.gollu@samsung.com>
4 years agonvme: add uuid index in get and set features command
Gollu Appalanaidu [Sat, 15 May 2021 18:59:37 +0000 (00:29 +0530)]
nvme: add uuid index in get and set features command

Signed-off-by: Gollu Appalanaidu <anaidu.gollu@samsung.com>
4 years agonvme: adding get lba status command man page
Gollu Appalanaidu [Tue, 11 May 2021 05:34:49 +0000 (11:04 +0530)]
nvme: adding get lba status command man page

Signed-off-by: Gollu Appalanaidu <anaidu.gollu@samsung.com>