]> www.infradead.org Git - users/sagi/nvme-cli.git/log
users/sagi/nvme-cli.git
2 years agofabrics: Do not overwrite errno with return code
Daniel Wagner [Mon, 16 Jan 2023 13:44:40 +0000 (14:44 +0100)]
fabrics: Do not overwrite errno with return code

__create_discover_ctrl() is calling nvmf_add_ctrl() which sets errno
when something doesn't work. Hence we should not overwrite the errno
with the return code in __ctrl_discover_ctrl().

This prevents to propagate the errno code to the callside and the
nvme_strerror(errno) call is just return 'unknown error -1'.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agobuild: Set projects default to debug and prefix /usr/local
Daniel Wagner [Mon, 16 Jan 2023 13:51:07 +0000 (14:51 +0100)]
build: Set projects default to debug and prefix /usr/local

Do not install to /usr per default and accidently overwrite the
distributions version of the package. And also debugging symbols per
default to make development setup as we don't install it anyway to /usr
anyway.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agoMerge pull request #1769 from igaw/create-appimage
Daniel Wagner [Fri, 20 Jan 2023 07:26:24 +0000 (08:26 +0100)]
Merge pull request #1769 from igaw/create-appimage

Create AppImage

2 years agobuild: Add AppImage build workflows
Daniel Wagner [Thu, 19 Jan 2023 12:28:00 +0000 (13:28 +0100)]
build: Add AppImage build workflows

Provide an AppImage version of the current head for testing.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agobuild: Renaming and cleanups of workflow files
Daniel Wagner [Thu, 19 Jan 2023 12:24:46 +0000 (13:24 +0100)]
build: Renaming and cleanups of workflow files

2 years agoMerge pull request #1756 from birkelund/tp4146
Daniel Wagner [Fri, 20 Jan 2023 07:00:29 +0000 (08:00 +0100)]
Merge pull request #1756 from birkelund/tp4146

Add 'fdp' plugin for managing devices supporting TP4146 ("Flexible Data Placement")

2 years agonvme: add flexible data placement management commands
Klaus Jensen [Tue, 13 Dec 2022 20:05:12 +0000 (21:05 +0100)]
nvme: add flexible data placement management commands

Add relevant TP4146 ("Flexible Data Placement") management commands.

Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
2 years agonvme: add io management send/recv commands
Klaus Jensen [Tue, 13 Dec 2022 19:31:54 +0000 (20:31 +0100)]
nvme: add io management send/recv commands

Add the I/O Management Send and Receive commands as defined by TP4146
("Flexible Data Placement").

Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
2 years agobuild: bump libnvme to f83b2c4c4738
Klaus Jensen [Wed, 14 Dec 2022 08:12:25 +0000 (09:12 +0100)]
build: bump libnvme to f83b2c4c4738

Bump libnvme to add fdp functionality.

Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
2 years agoMerge pull request #1761 from igaw/fix-recv-report-hostid
Daniel Wagner [Mon, 9 Jan 2023 11:01:47 +0000 (12:01 +0100)]
Merge pull request #1761 from igaw/fix-recv-report-hostid

nvme: Output zero padded hostid in resv-report command

2 years agonvme: Output zero padded hostid in resv-report command
Daniel Wagner [Mon, 9 Jan 2023 10:53:15 +0000 (11:53 +0100)]
nvme: Output zero padded hostid in resv-report command

The resv-report command is missing to print the zeros in hostid for the
terminal output. Update the printf format specifier accordingly.

The JSON output does this correctly.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agoMerge pull request #1755 from igaw/unit-tests
Daniel Wagner [Tue, 3 Jan 2023 18:09:22 +0000 (19:09 +0100)]
Merge pull request #1755 from igaw/unit-tests

Fix doc build and split nvme tests from unit tests

2 years agobuild: Run unit tests for native builds
Daniel Wagner [Tue, 3 Jan 2023 18:04:37 +0000 (19:04 +0100)]
build: Run unit tests for native builds

Run the unit tests when building nativily.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agounit: Move unit tests to a new directory
Daniel Wagner [Tue, 3 Jan 2023 17:46:57 +0000 (18:46 +0100)]
unit: Move unit tests to a new directory

The tests directory contains a test framework for testing
real hardware and are thus no real unit tests. As these
tests are reading and writing data to /dev/nvme0 we should
disable them per default.

To distinguish between the real unit tests and the nvme test
framework move all unit test to a new directory.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agodoc: Fix build for inspur plugin
Daniel Wagner [Tue, 3 Jan 2023 17:24:55 +0000 (18:24 +0100)]
doc: Fix build for inspur plugin

The build fails because the title is not correctly formated.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agoMerge pull request #1750 from ikegami-t/ns-create
Daniel Wagner [Tue, 3 Jan 2023 16:22:34 +0000 (17:22 +0100)]
Merge pull request #1750 from ikegami-t/ns-create

nvme: Allow standard SI units for ns-create nsze and ncap input

2 years agoMerge pull request #1753 from ikegami-t/sanact-string
Daniel Wagner [Tue, 3 Jan 2023 16:16:37 +0000 (17:16 +0100)]
Merge pull request #1753 from ikegami-t/sanact-string

nvme: sanitize: Allow sanitize action string values

2 years agonvme: create-ns: Add nsze-si and ncap-si arguments to set in standard SI units
Tokunori Ikegami [Wed, 28 Dec 2022 10:18:30 +0000 (19:18 +0900)]
nvme: create-ns: Add nsze-si and ncap-si arguments to set in standard SI units

This is proposed by the issue #1747. The value suffixed SI is divided by the
namespace LBA size to set as NSZE and NCAP. If the value not suffixed it is set
as same with the nsze and ncap options.
  Note: The existing nsze/ncap arguments follow the specification defined units.

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
2 years agodoc: Update nvme sanitize command action description
Tokunori Ikegami [Tue, 3 Jan 2023 12:30:14 +0000 (21:30 +0900)]
doc: Update nvme sanitize command action description

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
2 years agoMerge pull request #1751 from QiangWeiSel/master
Daniel Wagner [Mon, 2 Jan 2023 15:34:36 +0000 (16:34 +0100)]
Merge pull request #1751 from QiangWeiSel/master

Bash completion: move global declare into function

2 years agonvme: sanitize: Allow sanitize action string values
Tokunori Ikegami [Sun, 1 Jan 2023 15:32:35 +0000 (00:32 +0900)]
nvme: sanitize: Allow sanitize action string values

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
2 years agoBash completion: move global declare into function
Qiang Wei [Fri, 30 Dec 2022 14:52:38 +0000 (22:52 +0800)]
Bash completion: move global declare into function

* To fix completion issue by moving global vairables into
function _nvme_subcmds. It is not only suite for bash
completion system but also support manually source bash script.
* Fix pluginx_sfx_opts spell error to plugin_sfx_opts.
* Correct variable NO_OPTS used in bash assginment.

Signed-off-by: Qiang Wei <qiang.wei@suse.com>
2 years agoMerge pull request #1748 from ikegami-t/sanact-help
Daniel Wagner [Wed, 28 Dec 2022 09:23:25 +0000 (10:23 +0100)]
Merge pull request #1748 from ikegami-t/sanact-help

nvme: Improve sanitize action help

2 years agonvme: Improve sanitize action help
Tokunori Ikegami [Tue, 27 Dec 2022 15:45:39 +0000 (00:45 +0900)]
nvme: Improve sanitize action help

This fixes the issue #1746 but add sanitize action 1: exit failure mode also.

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
2 years agoMerge pull request #1738 from solidigm/OCP-Clear-FW-Update-History
Daniel Wagner [Fri, 23 Dec 2022 15:39:43 +0000 (16:39 +0100)]
Merge pull request #1738 from solidigm/OCP-Clear-FW-Update-History

solidigm, ocp: Added OCP-Clear-FW-Update-History support.

2 years agoMerge pull request #1744 from jinliangw/sec_cmd
Daniel Wagner [Fri, 23 Dec 2022 15:31:01 +0000 (16:31 +0100)]
Merge pull request #1744 from jinliangw/sec_cmd

nvme: support security-recv and security-send over nvme-mi

2 years agonvme: support security-recv and security-send over nvme-mi
Jinliang Wang [Mon, 19 Dec 2022 17:52:42 +0000 (09:52 -0800)]
nvme: support security-recv and security-send over nvme-mi

Support simple security-recv and security-send subcommands over
nvme-mi in nvme-cli.

Signed-off-by: Jinliang Wang <jinliangw@google.com>
2 years agoMerge pull request #1743 from ikegami-t/nvme-print-json
Daniel Wagner [Thu, 22 Dec 2022 08:38:48 +0000 (09:38 +0100)]
Merge pull request #1743 from ikegami-t/nvme-print-json

nvme-print: Fix to add uint and uint64 json object values to output

2 years agonvme-print: Serialize uint32_t types correctly
Tokunori Ikegami [Fri, 16 Dec 2022 17:34:15 +0000 (02:34 +0900)]
nvme-print: Serialize uint32_t types correctly

le32_to_cpu returns an unsigned type which gets extended to a signed
type when using %d format specifier or json_object_add_value_int. Use
%u in this case or json_object_add_value_uint accordingly.

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
[dwagner: added missing %u conversions]
Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agoMerge pull request #1740 from ikegami-t/help-message
Daniel Wagner [Mon, 19 Dec 2022 10:39:49 +0000 (11:39 +0100)]
Merge pull request #1740 from ikegami-t/help-message

Help message changes

2 years agosolidigm, ocp: Added OCP-Clear-FW-Update-History support, and exposed feature on...
hpanosy [Thu, 11 Aug 2022 23:34:13 +0000 (16:34 -0700)]
solidigm, ocp: Added OCP-Clear-FW-Update-History support, and exposed feature on ocp and solidigm plug-ins.

2 years agonvme: Combine duplicated help message string variables
Tokunori Ikegami [Mon, 12 Dec 2022 19:43:15 +0000 (04:43 +0900)]
nvme: Combine duplicated help message string variables

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
2 years agonvme: Correct show-topology command help spelling error
Tokunori Ikegami [Mon, 12 Dec 2022 17:52:26 +0000 (02:52 +0900)]
nvme: Correct show-topology command help spelling error

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
2 years agoMerge pull request #1737 from CodeConstruct/pr/fw-download
Daniel Wagner [Fri, 25 Nov 2022 09:46:09 +0000 (10:46 +0100)]
Merge pull request #1737 from CodeConstruct/pr/fw-download

fw-download retry, progress and error-handling improvements

2 years agobuild: Do not pass -werror to openssl when using fallbacks
Daniel Wagner [Fri, 25 Nov 2022 09:36:17 +0000 (10:36 +0100)]
build: Do not pass -werror to openssl when using fallbacks

GCC reports a couple of warning when building OpenSSL as
subproject. So let's not pass down the -werror.

We can also drop the same treatment for libuuid as we don't depend on
this library anymore.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agonvme: fw-download: handle overlapping range errors
Jeremy Kerr [Mon, 14 Nov 2022 06:04:19 +0000 (14:04 +0800)]
nvme: fw-download: handle overlapping range errors

Some NVMe implementations may return an Overlapping Range error if we
attempt to re-send a image range that has already been sent to a device.
We may hit this in a couple scenarios:

 - a prior Firmware Image Download command succeeded, but the success
   response was lost due to unrelated transport issues
 - a download has been cancelled, and is now being re-attempted

In order to handle this, this change adds a --ignore-ovr option to the
fw-download subcommand, which treats the Overlapping Range errors as
non-fatal, allowing the firmware download to proceed with the
non-overlapping portions.

We don't make this the default behaviour, because we cannot guarantee
that the currently-upoloaded portion is what has already been sent to
the device (and the user actually wants to overwrite with new image
data). In those cases, a firmware commit or device reset is required
instead.

Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
2 years agonvme: fw-download: Add retry mechanism
Jeremy Kerr [Tue, 8 Nov 2022 07:13:32 +0000 (15:13 +0800)]
nvme: fw-download: Add retry mechanism

Since we're potentially sending a lot of (chunked) data in the
fw-download process, add a facility for a single chunk failure to be
retried, if the error status does not indicate the Do Not Resend status
flag.

The retry count is reset once a chunk is sucessfully transferred, up to
a maximum of three retries.

This allows for occasional transport errors to not abort the whole
transfer.

Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
2 years agonvme: fw-download: print failed offset
Jeremy Kerr [Tue, 8 Nov 2022 06:52:16 +0000 (14:52 +0800)]
nvme: fw-download: print failed offset

It may be useful to indicate whether any transfer occurred.

Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
2 years agonvme: fw-download: Add (optional) transfer progress output
Jeremy Kerr [Mon, 14 Nov 2022 06:12:55 +0000 (14:12 +0800)]
nvme: fw-download: Add (optional) transfer progress output

This change adds a new argument to fw-download: --progress, which prints
percentage and bytes transferred.

Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
2 years agonvme: fw-download: move individual transfers to a separate function
Jeremy Kerr [Mon, 14 Nov 2022 06:12:55 +0000 (14:12 +0800)]
nvme: fw-download: move individual transfers to a separate function

The next few changes will add progress reporting and more comprehensive
error reporting to the fw-download process, which will be more readable
as a single function.

Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
2 years agoMerge pull request #1735 from jinhuahuang2021/bugfix/nvme-smart-log-add-display-wear...
Daniel Wagner [Mon, 21 Nov 2022 09:04:20 +0000 (10:04 +0100)]
Merge pull request #1735 from jinhuahuang2021/bugfix/nvme-smart-log-add-display-wear-leveling-error

plugins/memblaze: fix "smart-log-add" display "wear-leveling" issue.

2 years agoplugin/memblaze: use kernel base types instead own defined types
黄锦华 [Fri, 18 Nov 2022 08:34:06 +0000 (16:34 +0800)]
plugin/memblaze: use kernel base types instead own defined types

The plugin uses already kernel based types in the data struct
definition. So there is no need to use self defined types.

Signed-off-by: jinhua.huang <jinhua.huang@memblaze.com>
2 years agoplugin/memblaze: remove some useless code for smart-log-add
黄锦华 [Fri, 18 Nov 2022 06:58:40 +0000 (14:58 +0800)]
plugin/memblaze: remove some useless code for smart-log-add

Signed-off-by: 黄锦华 <jinhua.huang@memblaze.com>
2 years agoplugin/memblaze: update the correct value for smart-log-add
黄锦华 [Fri, 18 Nov 2022 03:20:40 +0000 (11:20 +0800)]
plugin/memblaze: update the correct value for smart-log-add

Signed-off-by: jinhua.huang <jinhua.huang@memblaze.com>
2 years agoMerge pull request #1731 from dankamongmen/dankamongmen/wd-smart-zeroes
Daniel Wagner [Wed, 16 Nov 2022 09:34:50 +0000 (10:34 +0100)]
Merge pull request #1731 from dankamongmen/dankamongmen/wd-smart-zeroes

nvme: call nvme_get_smart_log() with true

2 years agonvme: call nvme_get_smart_log() with false
nick black [Sun, 13 Nov 2022 22:34:34 +0000 (17:34 -0500)]
nvme: call nvme_get_smart_log() with false

Changing this to true resulted in my Western Digital 970 EVO Pro NVMe
SSDs returning all zeros for smartlog information. Reverts change made
in cc73f65fc016 ("nvme: Add wrappers for Get Log page helpers")

Resolves #1729.

Signed-off-by: nick black <dankamongmen@gmail.com>
2 years agoMerge pull request #1730 from dankamongmen/dankamongmen/meson-0.50.0
Daniel Wagner [Wed, 16 Nov 2022 08:53:02 +0000 (09:53 +0100)]
Merge pull request #1730 from dankamongmen/dankamongmen/meson-0.50.0

build: require meson 0.50.0+

2 years agobuild: require meson 0.50.0+
nick black [Sun, 13 Nov 2022 21:14:44 +0000 (16:14 -0500)]
build: require meson 0.50.0+

The Meson buildspec uses features introduced ('plain strings for
include_directories') in Meson 0.50.0, but only specifies
0.48.0. Eliminates a Meson warning.

Signed-off-by: nick black <dankamongmen@gmail.com>
2 years agoMerge pull request #1728 from ikegami-t/doc-sanitize
Daniel Wagner [Wed, 16 Nov 2022 08:09:18 +0000 (09:09 +0100)]
Merge pull request #1728 from ikegami-t/doc-sanitize

doc: Fix sanitize command examples as character device for issue #1559

2 years agodoc: Fix sanitize command examples as character device
Tokunori Ikegami [Thu, 10 Nov 2022 18:02:48 +0000 (03:02 +0900)]
doc: Fix sanitize command examples as character device

The documentation for nvme-sanitize provides conflicting statements

Specifically, the documentation says:

    The parameter is mandatory NVMe character device (ex: /dev/nvme0)

However, in the EXAMPLES section, the syntax shown references the Block device:

    nvme sanitize /dev/nvme0n1 --sanact=0x01

Using the characther device is the correct device, thus update the example
accordingly.

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
[dwagner: added commit message]
Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agodoc: Fix sanitize command examples as character device
Tokunori Ikegami [Thu, 10 Nov 2022 18:02:48 +0000 (03:02 +0900)]
doc: Fix sanitize command examples as character device

The documentation for nvme-sanitize provides conflicting statements

Specifically, the documentation says:

    The parameter is mandatory NVMe character device (ex: /dev/nvme0)

However, in the EXAMPLES section, the syntax shown references the Block device:

    nvme sanitize /dev/nvme0n1 --sanact=0x01

Using the characther device is the correct device, thus update the example
accordingly.

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
[dwagner: added commit message]
Signed-off-by: Daniel Wagner <dwagner@suse.de>
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