]> www.infradead.org Git - users/sagi/nvme-cli.git/log
users/sagi/nvme-cli.git
2 years agobuild: Disable Azure Pipeline
Daniel Wagner [Fri, 11 Nov 2022 14:12:33 +0000 (15:12 +0100)]
build: Disable Azure Pipeline

Unfortunatly, currently the build agent setup is not working
correctly. The issue is that when the build VM is spawned and the
agent is installed via the Extension API it will not show up as build
agent (though as deploy agent).

Until this is fixed, just disable this CI build.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agobuild: Add Azure Pipeline configuration
Daniel Wagner [Thu, 10 Nov 2022 14:16:24 +0000 (15:16 +0100)]
build: Add Azure Pipeline configuration

Verify if the change for nvme-cli is breaking blktests. We can't run
the blktests inside the containers because blktests wants write access
to sysfs and configfs which is forbidden in the provided github
containers. Thus we have to run our own fullfledge VM.

The instruction how to setup the build infrastructure is coming soon.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agonvme: Support telemetry-log over nvme-mi
Jinliang Wang [Wed, 9 Nov 2022 01:22:34 +0000 (17:22 -0800)]
nvme: Support telemetry-log over nvme-mi

Copy and re-write the nvme_get_telemetry_log() function, so that we
can use the existing wrappers below to get telemetry log both in-band
and over nvme-mi:

1) nvme_cli_get_log_telemetry_ctrl
2) nvme_cli_get_log_create_telemetry_host
3) nvme_cli_get_log_telemetry_host

Signed-off-by: Jinliang Wang <jinliangw@google.com>
[dwagner: return error codes directly]
Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agonvme: Change to use pci resource bar at first by show-regs command
Tokunori Ikegami [Thu, 3 Nov 2022 15:56:33 +0000 (00:56 +0900)]
nvme: Change to use pci resource bar at first by show-regs command

This is to prevent to submit the unnecessary or unsupported commands to device
mentioned by the issue #1593.

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
2 years agoplugins/micron: fix freed memory dereference.
Maurizio Lombardi [Tue, 8 Nov 2022 14:41:14 +0000 (15:41 +0100)]
plugins/micron: fix freed memory dereference.

dev_close() is already called after the jump to "out".
Calling it 2 times against the same pointer is unsafe because
it will dereference freed memory.

Signed-off-by: Maurizio Lombardi <mlombard@redhat.com>
2 years agonvme: fix unreacheable code in verify_cmd()
Maurizio Lombardi [Tue, 8 Nov 2022 14:28:51 +0000 (15:28 +0100)]
nvme: fix unreacheable code in verify_cmd()

the "if (err < 0)" condition should be checked before "if (err)",
otherwise it would be never caught.

Signed-off-by: Maurizio Lombardi <mlombard@redhat.com>
2 years agoplugins/sfx: fix an error message in scaleflux plugin
Maurizio Lombardi [Tue, 8 Nov 2022 14:19:35 +0000 (15:19 +0100)]
plugins/sfx: fix an error message in scaleflux plugin

"write" is a const string which cannot be null, we should check
cfg.write instead

Signed-off-by: Maurizio Lombardi <mlombard@redhat.com>
2 years agoMerge pull request #1723 from jinliangw/master
Daniel Wagner [Tue, 8 Nov 2022 08:48:08 +0000 (09:48 +0100)]
Merge pull request #1723 from jinliangw/master

Support admin_passthru over nvme-mi

2 years agonvme: Add wrapper for admin_passthru command
Jinliang Wang [Tue, 1 Nov 2022 17:55:46 +0000 (10:55 -0700)]
nvme: Add wrapper for admin_passthru command

This change adds nvme_dev wrappers for the admin_passthru command,
allowing access over a MI channel.

Need a bump to libnvme for the underlying nvme_mi_admin_admin_passthru call

Signed-off-by: Jinliang Wang <jinliangw@google.com>
2 years agolibnvme.wrap: Bump to 70aca88
Jinliang Wang [Tue, 8 Nov 2022 08:15:49 +0000 (00:15 -0800)]
libnvme.wrap: Bump to 70aca88

In an upcoming change we'll want support for the admin_passthru
command over nvme-mi, so bump the libnvme wrap version to suit.

Signed-off-by: Jinliang Wang <jinliangw@google.com>
2 years agoplugins/inspur: Add Inspur plugin extension.
wangmengmeng [Fri, 28 Oct 2022 07:30:16 +0000 (15:30 +0800)]
plugins/inspur: Add Inspur plugin extension.

Add sub-command to retrieve Inspur device Vendor log.

[dwagner: added a few newlines, changed iterator types to int]
Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agoMerge pull request #1716 from jinliangw/master
Daniel Wagner [Mon, 7 Nov 2022 09:42:08 +0000 (10:42 +0100)]
Merge pull request #1716 from jinliangw/master

nvme-mi: support ns-descs, primary-ctrl-caps, list-secondary

2 years agoMerge pull request #1722 from RPigott/zsh-spdx-fix
Daniel Wagner [Mon, 7 Nov 2022 07:12:40 +0000 (08:12 +0100)]
Merge pull request #1722 from RPigott/zsh-spdx-fix

zsh: move SPDX identifier

2 years agozsh: move SPDX identifier
Ronan Pigott [Sun, 6 Nov 2022 21:26:15 +0000 (14:26 -0700)]
zsh: move SPDX identifier

The zsh completion system requires compdef to be set in the first line
of the completion definition. The SPDX identifier introduced breaks this
requirement, so let's just move it a line down.

2 years agodoc: Regenerate all docs for v2.2.1 v2.2.1
Daniel Wagner [Wed, 2 Nov 2022 15:44:17 +0000 (16:44 +0100)]
doc: Regenerate all docs for v2.2.1

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agobuild: Update version to v2.2.1
Daniel Wagner [Wed, 2 Nov 2022 15:43:51 +0000 (16:43 +0100)]
build: Update version to v2.2.1

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agoMerge pull request #1719 from igaw/update-lib-dep
Daniel Wagner [Wed, 2 Nov 2022 15:16:15 +0000 (16:16 +0100)]
Merge pull request #1719 from igaw/update-lib-dep

build: Update libnvme version dependency to 1.2

2 years agobuild: Update libnvme version dependency to 1.2
Daniel Wagner [Wed, 2 Nov 2022 15:07:30 +0000 (16:07 +0100)]
build: Update libnvme version dependency to 1.2

With the drop of libuuid we need also the corresponding libnvme
library which provides its own uuid types.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agoplugins/ocp: Include timer.h
ajs124 [Wed, 2 Nov 2022 15:02:03 +0000 (16:02 +0100)]
plugins/ocp: Include timer.h

The plugin uses timer.h function and types. Add the missing header.

[dwagner: added commit message]
Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agoplugins/innogrit: Include timer.h
ajs124 [Wed, 2 Nov 2022 15:00:40 +0000 (16:00 +0100)]
plugins/innogrit: Include timer.h

The plugin uses timer.h function and types. Add the missing header.

[dwagner: added commit message]
Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agobuild: Remove unusned uuid.h include
ajs124 [Sun, 30 Oct 2022 00:08:36 +0000 (02:08 +0200)]
build: Remove unusned uuid.h include

4901f97b7df3 ("build: Drop dependency on libuuid") removed the
dependency on libuuid but forgot to remove the include in util/types.h.
Remove it.

[dwagner: added commit message]
Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agonvme-mi: support ns-descs, primary-ctrl-caps, list-secondary
Jinliang Wang [Sun, 30 Oct 2022 06:37:33 +0000 (23:37 -0700)]
nvme-mi: support ns-descs, primary-ctrl-caps, list-secondary

Suppport ns-descs, primary-ctrl-caps and list-secondary subcommands
though nvme-mi.

Signed-off-by: Jinliang Wang <jinliangw@google.com>
2 years agodoc: Regenerate all docs for v2.2 v2.2
Daniel Wagner [Fri, 28 Oct 2022 17:30:14 +0000 (19:30 +0200)]
doc: Regenerate all docs for v2.2

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agobuild: Update version to v2.2
Daniel Wagner [Fri, 28 Oct 2022 17:29:49 +0000 (19:29 +0200)]
build: Update version to v2.2

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agobuild: Update libnvme wrap
Daniel Wagner [Fri, 28 Oct 2022 17:26:11 +0000 (19:26 +0200)]
build: Update libnvme wrap

Update to v1.2 of libnvme.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agoMerge pull request #1714 from martin-gpy/enable_persistent
Daniel Wagner [Fri, 28 Oct 2022 17:18:03 +0000 (19:18 +0200)]
Merge pull request #1714 from martin-gpy/enable_persistent

fabrics: fix 'persistent' handling during connect-all with JSON file

2 years agofabrics: fix 'persistent' handling during connect-all with JSON file
Martin George [Fri, 28 Oct 2022 16:50:59 +0000 (22:20 +0530)]
fabrics: fix 'persistent' handling during connect-all with JSON file

Enable 'persistent' flag during nvme connect-all if set in the
config JSON file.

Signed-off-by: Martin George <marting@netapp.com>
[dwagner: added fallback implementation]
Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agoMerge pull request #1713 from martin-gpy/fix_initialization
Daniel Wagner [Fri, 28 Oct 2022 17:05:48 +0000 (19:05 +0200)]
Merge pull request #1713 from martin-gpy/fix_initialization

solidgm: fix initialization warning

2 years agosolidgm: fix initialization warning
Martin George [Fri, 28 Oct 2022 16:19:29 +0000 (21:49 +0530)]
solidgm: fix initialization warning

Seeing the below warning while compiling nvme-cli:

ninja: Entering directory `.build'
[27/51] Compiling C object nvme.p/plugins_solidigm_solidigm-telemetry.c.o
../plugins/solidigm/solidigm-telemetry.c: In function ‘solidigm_get_telemetry_log’:
../plugins/solidigm/solidigm-telemetry.c:126:22: warning: ‘length’ may be used uninitialized in this function [-Wmaybe-uninitialized]
   tl.configuration = json_tokener_parse_ex(jstok, conf_str, length);
                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[51/51] Linking target nvme

Fix this by initializing the 'length' variable to zero.

Signed-off-by: Martin George <marting@netapp.com>
2 years agoMerge pull request #1712 from igaw/build-fixes
Daniel Wagner [Fri, 28 Oct 2022 11:35:39 +0000 (13:35 +0200)]
Merge pull request #1712 from igaw/build-fixes

Build cleanups

2 years agoREAMDE: Drop reference on uuid
Daniel Wagner [Fri, 28 Oct 2022 09:20:58 +0000 (11:20 +0200)]
REAMDE: Drop reference on uuid

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agobuild: Fix endian check for cross build
Daniel Wagner [Fri, 28 Oct 2022 09:32:30 +0000 (11:32 +0200)]
build: Fix endian check for cross build

The endian check is supposed to figure it the ordering on the machine
which the binary will run on. Hence we need to check the host not the
build machine.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agobuild: Remove unused uuid.wrap file
Daniel Wagner [Fri, 28 Oct 2022 09:15:06 +0000 (11:15 +0200)]
build: Remove unused uuid.wrap file

4901f97b7df3 ("build: Drop dependency on libuuid") forgot to remove
the now unused uuid.wrap file.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agobuild: Update min version of meson to 0.48
Daniel Wagner [Fri, 28 Oct 2022 09:17:23 +0000 (11:17 +0200)]
build: Update min version of meson to 0.48

libnvme uses python3.extension_module() which is depending on
gnu_symbol_visibility. So arguably, this has been from day 0.

Version 0.47 was released on Jul 02, 2018 and 0.48 on Sep 22,
2018. Even Debian oldstable ships 0.49.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agobuild: Update libnvme wrap
Daniel Wagner [Fri, 28 Oct 2022 09:27:30 +0000 (11:27 +0200)]
build: Update libnvme wrap

To update min version depenendency on meson 0.48

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agoMerge pull request #1711 from linux-nvme/inc-header
Daniel Wagner [Fri, 28 Oct 2022 09:04:17 +0000 (11:04 +0200)]
Merge pull request #1711 from linux-nvme/inc-header

util/json.h: Add json_object_get_uint64 fallback implementation

2 years agosolidigm: Fix printf format for size_t variable
Daniel Wagner [Fri, 28 Oct 2022 08:58:56 +0000 (10:58 +0200)]
solidigm: Fix printf format for size_t variable

On 32bit platforms %lu is the wrong format for size_t variable. Use
the correct %zu format for this.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agoutil/json.h: Add json_object_get_uint64 fallback implementation
Daniel Wagner [Fri, 28 Oct 2022 08:33:54 +0000 (10:33 +0200)]
util/json.h: Add json_object_get_uint64 fallback implementation

We need the definition of json_object_get_uint64 in case json-c
doesn't provide it.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agosolidigm: Updated Telemetry parsing code to MIT license.
leonardo.da.cunha [Thu, 27 Oct 2022 22:41:57 +0000 (15:41 -0700)]
solidigm: Updated Telemetry parsing code to MIT license.

2 years agosolidigm: Added parsing for telemetry customer screenable data
leonardo.da.cunha [Thu, 15 Sep 2022 23:01:55 +0000 (16:01 -0700)]
solidigm: Added parsing for telemetry customer screenable data

[dwagner: - shorted overlong lines
          - moved decleration at the beginning of the
    block]
Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agoutils/json: Add json_object_new_uint64 for json-c < 0.14
leonardo.da.cunha [Thu, 27 Oct 2022 22:46:22 +0000 (15:46 -0700)]
utils/json: Add json_object_new_uint64 for json-c < 0.14

json-c 0.14 added json_object_new_uint64 but older version are missing
this function. Instead defining two different json_object_object_add
version we can just define the fallback function first.

[dwagner: rewrote the commit message]
Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agoMerge pull request #1706 from CodeConstruct/pr/status-types
Daniel Wagner [Fri, 28 Oct 2022 07:20:52 +0000 (09:20 +0200)]
Merge pull request #1706 from CodeConstruct/pr/status-types

Add support for libvnme status types

2 years agonvme-print: decode MI status values
Jeremy Kerr [Sun, 23 Oct 2022 08:01:27 +0000 (16:01 +0800)]
nvme-print: decode MI status values

This change adds support for the MI-specific status values, and decodes
using nvme_mi_status_to_string().

Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
2 years agonvme: use helpers for checking status types
Jeremy Kerr [Sun, 23 Oct 2022 05:54:49 +0000 (13:54 +0800)]
nvme: use helpers for checking status types

There are a few instances where we check the status return value from
libnvme calls - for each of these, use the new nvme_status_{type,value}
helpers.

Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
2 years agonvme-print: decode status types
Jeremy Kerr [Sun, 23 Oct 2022 03:13:00 +0000 (11:13 +0800)]
nvme-print: decode status types

With the new nvme_status_get_type/nvme_status_get_value() accessors in
libnvme, restructure nvme_show_status to allow type-specific deciding in
future.

Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
2 years agoMerge pull request #1709 from igaw/drop-uuid
Daniel Wagner [Thu, 27 Oct 2022 15:55:33 +0000 (17:55 +0200)]
Merge pull request #1709 from igaw/drop-uuid

Drop libuuid dependency

2 years agobuild: Drop dependency on libuuid
Daniel Wagner [Thu, 13 Oct 2022 15:52:10 +0000 (17:52 +0200)]
build: Drop dependency on libuuid

libnvme provide the uuid functions we actually need, so just use those
and drop the libuuid dependency.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agobuild: Update libnvme wrap
Daniel Wagner [Thu, 27 Oct 2022 15:08:11 +0000 (17:08 +0200)]
build: Update libnvme wrap

Fetch the nvme_util_* functions.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agoMerge pull request #1693 from igaw/nvme-topology
Daniel Wagner [Thu, 27 Oct 2022 13:55:40 +0000 (15:55 +0200)]
Merge pull request #1693 from igaw/nvme-topology

nvme: Add show-topology command

2 years agocompletions: Add show-topology tab completion
Daniel Wagner [Wed, 26 Oct 2022 13:27:11 +0000 (15:27 +0200)]
completions: Add show-topology tab completion

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agodoc: Add nvme show-topology documnetation
Daniel Wagner [Wed, 26 Oct 2022 12:41:19 +0000 (14:41 +0200)]
doc: Add nvme show-topology documnetation

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agonvme: Add show-topology command
Daniel Wagner [Mon, 26 Sep 2022 16:17:01 +0000 (18:17 +0200)]
nvme: Add show-topology command

Add nvme show-topology which displays the entire nvme topology on the
host - all the subsystems with all the underlying controllers and its
states including ANA for all nvme devices.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agoMerge pull request #1699 from ikegami-t/set-feature-0dh
Daniel Wagner [Wed, 26 Oct 2022 08:04:16 +0000 (10:04 +0200)]
Merge pull request #1699 from ikegami-t/set-feature-0dh

nvme: Fix set feature command to get feature identifier 0Dh length as…

2 years agonvme: Fix set feature command to get feature identifier 0Dh length as zero
Tokunori Ikegami [Thu, 13 Oct 2022 16:13:22 +0000 (01:13 +0900)]
nvme: Fix set feature command to get feature identifier 0Dh length as zero

The nvme_get_feature_length() function does not handle the direction
information correctly. Thus libnvme introduced a new version of this
function. Use it when available.

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
[dwagner: Add wrapper code when nvme_get_feature_length2
          is not available]
Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agolibnvme-wrap: Avoid fallback as variable name
Daniel Wagner [Mon, 24 Oct 2022 13:43:04 +0000 (15:43 +0200)]
libnvme-wrap: Avoid fallback as variable name

The libnvme util.h header file has support for the 'fallback
statement' for older compilers. This is done by precompiler tricks
which will replace all 'fallback' texts. So we should avoid fallback
as variable name.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agolibvnme-wrap: Rename file
Daniel Wagner [Mon, 24 Oct 2022 13:32:15 +0000 (15:32 +0200)]
libvnme-wrap: Rename file

The name 'wrapper' is a bit too generic. The functions in this file are
fallback implementations for older libnvme libraries. Hence prefix the
file with libnvme.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agobuild: Update libnvme wrap
Daniel Wagner [Fri, 21 Oct 2022 09:39:31 +0000 (11:39 +0200)]
build: Update libnvme wrap

Fetch newly added nvme_get_feature_length2 function.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agobuild: Update json-c.wrap
Daniel Wagner [Fri, 21 Oct 2022 09:48:17 +0000 (11:48 +0200)]
build: Update json-c.wrap

Update to the latest the json-c wrap version.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agobuild: Update zlib wrap
Daniel Wagner [Fri, 21 Oct 2022 09:49:04 +0000 (11:49 +0200)]
build: Update zlib wrap

Update to latest zlib version.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agoMerge pull request #1704 from safl/mk
Daniel Wagner [Fri, 21 Oct 2022 07:50:31 +0000 (09:50 +0200)]
Merge pull request #1704 from safl/mk

Makefile: add 'make uninstall'

2 years agoMerge pull request #1705 from igaw/use-current_build_dir
Daniel Wagner [Fri, 21 Oct 2022 06:57:17 +0000 (08:57 +0200)]
Merge pull request #1705 from igaw/use-current_build_dir

build: Use meson.current_build_dir() for tests

2 years agoMakefile: add 'make uninstall'
Simon A. F. Lund [Thu, 20 Oct 2022 10:09:44 +0000 (12:09 +0200)]
Makefile: add 'make uninstall'

An uninstall option, in addition to RPM install/uninstall, is arguably
quite convenient. Yet, Makefiles usually do not provide an 'uninstall'
target since that would require recording an installation manifest and
custom logic for removal.

However, meson has an internal feature doing precisely that.

This change invokes the meson uninstall feature via "make uninstall".

Signed-off-by: Simon A. F. Lund <simon.lund@samsung.com>
2 years agobuild: Use meson.current_build_dir() for tests
Daniel Wagner [Thu, 20 Oct 2022 10:21:43 +0000 (12:21 +0200)]
build: Use meson.current_build_dir() for tests

Meson reports future deprecation of meson.build_root().  The
recommended replacement is to use meson.current_build_dir().

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agoMerge pull request #1703 from jinliangw/master
Daniel Wagner [Wed, 19 Oct 2022 12:07:53 +0000 (14:07 +0200)]
Merge pull request #1703 from jinliangw/master

util: Fix le128_to_cpu on little-endian

2 years agotests: Update license to GPL-2.0-or-later
Daniel Wagner [Tue, 17 May 2022 06:14:56 +0000 (08:14 +0200)]
tests: Update license to GPL-2.0-or-later

When I reviewed the tests I asked wrongly for GPL-2.0-only. The
project is using the GPL-2.0-or-later license. Relax the license
requirement to GPL-2.0-or-later.

Cc: Arunpandian J <apj.arun@samsung.com>
Signed-off-by: Pankaj Raghav <p.raghav@samsung.com>
Link: https://lore.kernel.org/r/20220517061456.7623-1-dwagner@suse.de
Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agoutil: Fix le128_to_cpu on little-endian
Jinliang Wang [Tue, 18 Oct 2022 23:41:13 +0000 (16:41 -0700)]
util: Fix le128_to_cpu on little-endian

We need to swap the words order in little-endian machine too.
For example:

uint128:  0x4000000030000000200000001

 0  1  2  3 |  4  5  6  7 | 8  9  a  b  | c  d  e  f
01 00 00 00 | 02 00 00 00 | 03 00 00 00 | 04 00 00 00

  w0(MSB)   |     w1      |    w2       |  w3(LSB)
04 00 00 00 | 03 00 00 00 | 02 00 00 00 | 01 00 00 00

Fixes: https://github.com/linux-nvme/nvme-cli/issues/1702
Signed-off-by: Jinliang Wang <jinliangw@google.com>
2 years agoMerge pull request #1694 from igaw/autoconnect-json-config
Daniel Wagner [Tue, 18 Oct 2022 16:39:12 +0000 (18:39 +0200)]
Merge pull request #1694 from igaw/autoconnect-json-config

fabrics: Honor JSON config file in connect-all command

2 years agoMerge pull request #1698 from sc108-lee/debug
Daniel Wagner [Tue, 18 Oct 2022 08:25:55 +0000 (10:25 +0200)]
Merge pull request #1698 from sc108-lee/debug

Makefile: Add 'make debug' for debug build

2 years agoMerge pull request #1696 from maurizio-lombardi/null_test
Daniel Wagner [Tue, 18 Oct 2022 08:25:26 +0000 (10:25 +0200)]
Merge pull request #1696 from maurizio-lombardi/null_test

nvme: check if cfg.metadata is NULL before passing it to strlen()

2 years agoMakefile: Add 'make debug' for debug build
Steven Seungcheol Lee [Thu, 13 Oct 2022 06:16:19 +0000 (15:16 +0900)]
Makefile: Add 'make debug' for debug build

Signed-off-by: Steven Seungcheol Lee <sc108.lee@samsung.com>
2 years agonvme: check if cfg.metadata is NULL before passing it to strlen()
Maurizio Lombardi [Wed, 12 Oct 2022 15:23:47 +0000 (17:23 +0200)]
nvme: check if cfg.metadata is NULL before passing it to strlen()

2 years agofabrics: Trigger auto connect if config.json exists
Daniel Wagner [Thu, 29 Sep 2022 14:00:26 +0000 (16:00 +0200)]
fabrics: Trigger auto connect if config.json exists

When either discover.conf or config.json exists the rule should be
executed.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agofabrics: Honor JSON config file in connect-all command
Daniel Wagner [Thu, 29 Sep 2022 13:44:23 +0000 (15:44 +0200)]
fabrics: Honor JSON config file in connect-all command

When we there is a JSON config file use it when doing a
connect-all.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agofabrics: nvme config --modify depends on -n and -t argument
Daniel Wagner [Thu, 29 Sep 2022 09:28:50 +0000 (11:28 +0200)]
fabrics: nvme config --modify depends on -n and -t argument

In order to be able to modify a config we need to look it up
first. The nvme_lookup_subsystem() call will crash if we don't
provide a NQN.

The transport is needed to be able lookup a controller.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agobuild: Update json-c.wrap
Daniel Wagner [Thu, 29 Sep 2022 10:12:09 +0000 (12:12 +0200)]
build: Update json-c.wrap

Update to the latest the json-c wrap version.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agoMerge pull request #1692 from jeffreyalien/master
Daniel Wagner [Tue, 27 Sep 2022 13:02:06 +0000 (15:02 +0200)]
Merge pull request #1692 from jeffreyalien/master

plugins/wdc: Add support for SN660 drive

2 years agoplugins/wdc: Add support for SN660 drive
Jeff Lien [Mon, 26 Sep 2022 14:17:54 +0000 (09:17 -0500)]
plugins/wdc: Add support for SN660 drive

Update WDC plugin version to 2.1.2

Signed-off-by: Jeff Lien <jeff.lien@wdc.com>
2 years agofabrics: re-read the discovery log page when a discovery controller reconnected
Sagi Grimberg [Thu, 22 Sep 2022 08:15:38 +0000 (11:15 +0300)]
fabrics: re-read the discovery log page when a discovery controller reconnected

When using persistent discovery controllers, if the discovery controller
loses connectivity and manage to reconnect after a while, we need to
retrieve again the discovery log page in order to learn about possible
changes that may have occurred during this time as discovery log change
events were lost.

Upon reception of a udev EVENT=rediscover we can kickstart discovery on
the existing discovery controller device node that generated the event.

Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
Reviewed-by: James Smart <jsmart2021@gmail.com>
[dwagner: added --host_iface argument]
Signed-off-by: Daniel Wagner <dwagner@suse.de
2 years agoMerge pull request #1691 from CodeConstruct/pr/mi-firmware
Daniel Wagner [Tue, 27 Sep 2022 09:10:21 +0000 (11:10 +0200)]
Merge pull request #1691 from CodeConstruct/pr/mi-firmware

nvme: Add wrappers for firmware commands

2 years agonvme: Add wrappers for firmware commands
Jeremy Kerr [Sat, 24 Sep 2022 06:41:03 +0000 (14:41 +0800)]
nvme: Add wrappers for firmware commands

This change adds nvme_dev wrappers for the firmware download and
firmware commit commands, allowing access over a MI channel.

We need a bump to libnvme for the underlying MI firmware calls.

Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
2 years agolibnvme.wrap: Bump to 677075a1
Jeremy Kerr [Sat, 24 Sep 2022 06:41:03 +0000 (14:41 +0800)]
libnvme.wrap: Bump to 677075a1

In an upcoming change we'll want support for the firmware-handling
commands, so bump the libnvme wrap version to suit.

Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
2 years agoMerge pull request #1690 from CodeConstruct/dev/uint128
Daniel Wagner [Mon, 26 Sep 2022 12:58:21 +0000 (14:58 +0200)]
Merge pull request #1690 from CodeConstruct/dev/uint128

util: Fix le128_to_cpu on big-endian

2 years agoMerge pull request #1688 from CodeConstruct/dev/ci-cross
Daniel Wagner [Mon, 26 Sep 2022 12:56:54 +0000 (14:56 +0200)]
Merge pull request #1688 from CodeConstruct/dev/ci-cross

Add warning fixes and enable cross compilation targets in github workflows

2 years agogithub workflows: add armhf and ppc64le cross compile checks
Jeremy Kerr [Sun, 25 Sep 2022 12:48:31 +0000 (20:48 +0800)]
github workflows: add armhf and ppc64le cross compile checks

Like we have done in libnvme, this change adds a couple of cross-compile
definitons for the github workflows: one for armhf, one for powerpc64le.

Fixes: https://github.com/linux-nvme/nvme-cli/issues/1687
Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
2 years agonvme, plugins: fix __u64 -> unsigned long long assumptions
Jeremy Kerr [Mon, 26 Sep 2022 10:04:08 +0000 (18:04 +0800)]
nvme, plugins: fix __u64 -> unsigned long long assumptions

We have a couple of instances which assume __u64 is an unsigned long,
which is not always the case.

For the printf() formats, we would ideally used PRId64, but on ll64
platforms, it looks this macro is broken: it expands to "ld", where
__u64 is an unsigned long long. So, do an explicit cast to unsigned long
long instead, and just use %lld.

With this change, we can compile without warnings on amd64, armhf and
powerpc64le.

Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
2 years agoutil: Fix le128_to_cpu on big-endian
Jeremy Kerr [Mon, 26 Sep 2022 12:02:31 +0000 (20:02 +0800)]
util: Fix le128_to_cpu on big-endian

We currently have a bug when converting from le128, as we'll overwrite
words that we later need to read.

Also, use an if rather than #ifdef, so the BE case can be compiled.
Turns out we need the ccan headers for this.

Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
2 years agoMerge pull request #1685 from CodeConstruct/dev/uint128
Daniel Wagner [Mon, 26 Sep 2022 07:20:16 +0000 (09:20 +0200)]
Merge pull request #1685 from CodeConstruct/dev/uint128

utils: Fix uint128_t usage

2 years agoMerge pull request #1686 from igaw/fix-misc
Daniel Wagner [Mon, 26 Sep 2022 07:17:20 +0000 (09:17 +0200)]
Merge pull request #1686 from igaw/fix-misc

Various small build fixes

2 years agoMerge pull request #1675 from martin-belanger/udev-rule
Daniel Wagner [Mon, 26 Sep 2022 06:39:04 +0000 (08:39 +0200)]
Merge pull request #1675 from martin-belanger/udev-rule

udev: Add HOST_IFACE to udev rule

2 years agoutils: Fix uint128_t usage
Jeremy Kerr [Sun, 25 Sep 2022 12:12:34 +0000 (20:12 +0800)]
utils: Fix uint128_t usage

Currently, nvme-cli will not compile on 32-bit platforms, as uint128_t
is not available.

This change, based on suggestions from Daniel Wagner <dwagner@suse.de>,
adds our own nvme_uint128_t type, which needs a custom to_string()
function.

In order to make the latter straightforward, we use four 32-bit words
for the internal representation of the 128-bit type. We then use 64-bit
arithmetic to avoid having to handle the carry-bit explicitly.

Also, add a small test case for the printing.

Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
2 years agoudev: Add HOST_IFACE to udev rule
Martin Belanger [Tue, 13 Sep 2022 15:19:13 +0000 (11:19 -0400)]
udev: Add HOST_IFACE to udev rule

The HOST_IFACE only applies to TCP connections. When provided, it forces TCP
connections on a specific interface instead of letting the routing table
decide. Some users may prefer to force connections on specific interfaces
instead of configuring the routing table. This change makes sure that the
HOST_IFACE used to set up the persistent connection to the discovery
controller also gets applied to the I/O controller connections.

Signed-off-by: Martin Belanger <martin.belanger@dell.com>
2 years agoMerge pull request #1683 from igaw/fix-wdc-enum-conversion
Daniel Wagner [Fri, 23 Sep 2022 14:39:54 +0000 (16:39 +0200)]
Merge pull request #1683 from igaw/fix-wdc-enum-conversion

plugins/wdc: Add type case for feature id

2 years agonvme: Use correct print format specifier for sizeof arguments
Daniel Wagner [Fri, 23 Sep 2022 14:27:50 +0000 (16:27 +0200)]
nvme: Use correct print format specifier for sizeof arguments

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agoplugins/micron-nvme: Use correct print format specifier for sizeof arguments
Daniel Wagner [Fri, 23 Sep 2022 14:28:19 +0000 (16:28 +0200)]
plugins/micron-nvme: Use correct print format specifier for sizeof arguments

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agoplugins/wdc: Add type case for feature id
Daniel Wagner [Fri, 23 Sep 2022 11:43:57 +0000 (13:43 +0200)]
plugins/wdc: Add type case for feature id

clang reports

../plugins/wdc/wdc-nvme.c:9000:36: warning: implicit conversion from enumeration type 'NVME_FEATURE_IDENTIFIERS' (aka 'enum _NVME_FEATURE_IDENTIFIERS') to different enumeration type 'enum nvme_features_id' [-Wenum-conversion]
                                             deFeatureIdList[listIdx].featureId,
                                             ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~

Add type case to avoid the warning. Ideally, the plugin would not
introduce their own enum value.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agoplugins: Use PRIu64 format specifier for 64bit types
Daniel Wagner [Fri, 23 Sep 2022 10:32:53 +0000 (12:32 +0200)]
plugins: Use PRIu64 format specifier for 64bit types

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agonvme-print: Use uint128 JSON function for media_units_written
Daniel Wagner [Fri, 23 Sep 2022 10:31:33 +0000 (12:31 +0200)]
nvme-print: Use uint128 JSON function for media_units_written

media_units_written is of type __uint128_t hence we should use the
correct function for serializing to JSON.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agoMerge pull request #1662 from DebabrataSTX/stx_ocp
Daniel Wagner [Thu, 22 Sep 2022 09:51:18 +0000 (11:51 +0200)]
Merge pull request #1662 from DebabrataSTX/stx_ocp

adding OCP changes for Seagate drives

2 years agodoc: Add and update man pages for seagate plugin
Debabrata Bardhan [Thu, 15 Sep 2022 12:24:44 +0000 (17:54 +0530)]
doc: Add and update man pages for seagate plugin

Adding documentation of Seagate plug-in commands.

Signed-off-by: Debabrata Bardhan <debabrata.bardhan@seagate.com>
2 years agoplugins/seagate: Add support for OCP
Debabrata Bardhan [Thu, 15 Sep 2022 12:08:16 +0000 (17:38 +0530)]
plugins/seagate: Add support for OCP

Added new behavior as defined by Datacenter NVMe SSD Specification, version 2.0.

Signed-off-by: Debabrata Bardhan <debabrata.bardhan@seagate.com>