]> www.infradead.org Git - users/sagi/nvme-cli.git/log
users/sagi/nvme-cli.git
2 years agofabrics: Fix already connected test
Daniel Wagner [Thu, 26 Jan 2023 13:40:08 +0000 (14:40 +0100)]
fabrics: Fix already connected test

The lookup will also return controllers created from discovery.conf
and config.json. These might not yet connected. When the controller has
a device name we assume that we are connected.

Fixes: 07d6b911e081 ("fabrics: Do not attempt to reconnect to already connected ctrls")
Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agofabrics: Fix discovery controller filter function
Daniel Wagner [Thu, 26 Jan 2023 13:36:56 +0000 (14:36 +0100)]
fabrics: Fix discovery controller filter function

disc_ctrl_config_match() should also test if the controller is actually
a discovery controller. Because of that ctrl_config_match() can't call
disc_ctrl_config_match() anymore.

Fixes: 07d6b911e081 ("fabrics: Do not attempt to reconnect to already connected ctrls")
Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agoMerge pull request #1775 from igaw/make-pdc-optional
Daniel Wagner [Wed, 25 Jan 2023 11:34:51 +0000 (12:34 +0100)]
Merge pull request #1775 from igaw/make-pdc-optional

fabrics: Make PDC behavior configurable

2 years agofabrics: Make PDC behavior configurable
Daniel Wagner [Wed, 25 Jan 2023 08:16:53 +0000 (09:16 +0100)]
fabrics: Make PDC behavior configurable

The persistent discovery controller is a behavior change which might
break existing installation. Instead enabling it per default, introduce
a compile time and a global configuration option to define the default
settings.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agobuild: Update libnvme wrap
Daniel Wagner [Wed, 25 Jan 2023 11:24:40 +0000 (12:24 +0100)]
build: Update libnvme wrap

Update libnvme wrap to include the persistent discovery controller
config flag feature.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agoMerge pull request #1773 from linux-nvme/dependabot/github_actions/actions/upload...
Daniel Wagner [Wed, 25 Jan 2023 11:13:10 +0000 (12:13 +0100)]
Merge pull request #1773 from linux-nvme/dependabot/github_actions/actions/upload-artifact-3

build(deps): bump actions/upload-artifact from 2 to 3

2 years agoMerge pull request #1774 from ikegami-t/util-maint
Daniel Wagner [Tue, 24 Jan 2023 13:49:58 +0000 (14:49 +0100)]
Merge pull request #1774 from ikegami-t/util-maint

MAINT: util: Delete duplicated OPT_LONG definition

2 years agoMAINT: util: Delete duplicated OPT_LONG definition
Tokunori Ikegami [Tue, 24 Jan 2023 13:19:02 +0000 (22:19 +0900)]
MAINT: util: Delete duplicated OPT_LONG definition

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
2 years agoMerge pull request #1765 from igaw/make-pdc-default
Daniel Wagner [Tue, 24 Jan 2023 10:07:23 +0000 (11:07 +0100)]
Merge pull request #1765 from igaw/make-pdc-default

Make unique discovery controllers persistent as default

2 years agoMerge pull request #1772 from ikegami-t/util-print
Daniel Wagner [Tue, 24 Jan 2023 08:57:01 +0000 (09:57 +0100)]
Merge pull request #1772 from ikegami-t/util-print

util: Add file stream parameter to print word wrapped

2 years agobuild(deps): bump actions/upload-artifact from 2 to 3
dependabot[bot] [Mon, 23 Jan 2023 18:06:03 +0000 (18:06 +0000)]
build(deps): bump actions/upload-artifact from 2 to 3

Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 2 to 3.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v2...v3)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2 years agoutil: Add file stream parameter to print word wrapped
Tokunori Ikegami [Mon, 23 Jan 2023 17:33:38 +0000 (02:33 +0900)]
util: Add file stream parameter to print word wrapped

This is to allow to select stdout or stderr streams for print.

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
2 years agobuild: The release workflow can't tag
Daniel Wagner [Mon, 23 Jan 2023 16:01:53 +0000 (17:01 +0100)]
build: The release workflow can't tag

The releaser action is not able to auto tag the tree (permission).
Anyway, we don't want to have a 'tip' or 'latest' tag just because the
build process expects this. So we have to find a different way to have
latest AppImage.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agoMerge pull request #1771 from igaw/appimage-release
Daniel Wagner [Mon, 23 Jan 2023 15:53:54 +0000 (16:53 +0100)]
Merge pull request #1771 from igaw/appimage-release

build: Upload latest AppImage

2 years agobuild: Upload latest AppImage
Daniel Wagner [Mon, 23 Jan 2023 15:21:54 +0000 (16:21 +0100)]
build: Upload latest AppImage

We have to upload the AppImage as release to be able set a link.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agoMerge pull request #1770 from igaw/dst-wait
Daniel Wagner [Mon, 23 Jan 2023 10:26:29 +0000 (11:26 +0100)]
Merge pull request #1770 from igaw/dst-wait

nvme: Add wait for device self test

2 years agonvme: Add wait for device self test
Keith Busch [Tue, 10 Jan 2023 20:43:17 +0000 (12:43 -0800)]
nvme: Add wait for device self test

Add a wait command line option to device-self-test which makes nvme-cli
staying in forground and reports progress. This make it possible to wait
for the end of the test.

Signed-off-by: Keith Busch <kbusch@kernel.org>
[dwagner: make termination condition handling the end of self test]
Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agoMerge pull request #1749 from ikegami-t/smart-log
Daniel Wagner [Fri, 20 Jan 2023 14:36:31 +0000 (15:36 +0100)]
Merge pull request #1749 from ikegami-t/smart-log

nvme-print: Display smart log data units read and written SI value

2 years agogitignore: Ignore clang build artifacts
Daniel Wagner [Fri, 20 Jan 2023 09:39:19 +0000 (10:39 +0100)]
gitignore: Ignore clang build artifacts

When using language server support from clang, the .cache directory is
added. Also for getting lsp working properly the compile_commands.json
file has to present (which is just a link to Meson generared json file).

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agofabrics: Do not disconnect unique disc ctrl on default
Daniel Wagner [Tue, 17 Jan 2023 08:36:40 +0000 (09:36 +0100)]
fabrics: Do not disconnect unique disc ctrl on default

Do not disconnect unique discovery controller on default.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agofabrics: Handle DUPRETINFO and EPCSD when doing discovery
Daniel Wagner [Thu, 19 Jan 2023 08:21:45 +0000 (09:21 +0100)]
fabrics: Handle DUPRETINFO and EPCSD when doing discovery

The TP8014 adds two new flags for providing information to the host
which discovery controller is returning the same information we already
know or if the discovery controller doesn't support explicit
persistency.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agofabrics: Prefer unique disc ctrl over well known
Daniel Wagner [Tue, 17 Jan 2023 08:32:19 +0000 (09:32 +0100)]
fabrics: Prefer unique disc ctrl over well known

Currently, the well known discovery controller is used per default even
though the target might support unique discovery controller as defined
in TP8013.

Change the default behavior to use the unique discovery controller
whenever the target supports it.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agobuild: Update libnvme wrap
Daniel Wagner [Fri, 20 Jan 2023 07:53:56 +0000 (08:53 +0100)]
build: Update libnvme wrap

Update libnvme wrap to include the unique discovery controller API
changes.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agoMerge pull request #1768 from igaw/misc-fabric-fixes
Daniel Wagner [Fri, 20 Jan 2023 07:50:55 +0000 (08:50 +0100)]
Merge pull request #1768 from igaw/misc-fabric-fixes

Miscellaneous fabric fixes/improvements

2 years agofabrics: Do not attempt to reconnect to already connected ctrls
Daniel Wagner [Wed, 18 Jan 2023 17:20:09 +0000 (18:20 +0100)]
fabrics: Do not attempt to reconnect to already connected ctrls

Currently, connect-all and connect will blindly try to reconnect to
already connected controllers. Try to lookup the controller in the local
hierarchy. If found just ignore the attempt and fail.

Note, we have to distinguish between normal controllers and discovery
controller when comparing them. The main difference is that we have
ignore the discovery nqn and assume if we find a discovery controller
it's the correct one (persistent). This basically means the well known
discovery nqn matches any found controller.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agofabrics: Set discovery KATO also for current disc crtl
Daniel Wagner [Thu, 19 Jan 2023 07:58:15 +0000 (08:58 +0100)]
fabrics: Set discovery KATO also for current disc crtl

The default KATO should also be set for the current discovery
controller (subtype 3) and not just for the discovery
controller (subtype 1).

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agofabrics: Update error message when connect attemp fails
Daniel Wagner [Wed, 18 Jan 2023 17:26:08 +0000 (18:26 +0100)]
fabrics: Update error message when connect attemp fails

The error code will print the reason why it fails, so we don't have to
assume we didn't find it. Just state what we tried to achieve.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agonvme: Ingore LOG_NOTICE level
Daniel Wagner [Wed, 18 Jan 2023 17:16:36 +0000 (18:16 +0100)]
nvme: Ingore LOG_NOTICE level

We don't use the LOG_NOTICE level at all. That means a single '-v' has
no impact. So just ingore it and we get some useful information starting
with LOG_INFO.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agofabrics: Add support for binary output
Daniel Wagner [Wed, 18 Jan 2023 09:39:51 +0000 (10:39 +0100)]
fabrics: Add support for binary output

The command line help says we support binary output, thus add this
feature.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
2 years agofabrics: Use endian helper when reading discovery log entries
Daniel Wagner [Wed, 18 Jan 2023 09:36:45 +0000 (10:36 +0100)]
fabrics: Use endian helper when reading discovery log entries

We should use the correct CPU endian helper when reading the discovery
log. While at it, also sync the JSON output with the console output and
stringify the EFLAGS.

Signed-off-by: Daniel Wagner <dwagner@suse.de>
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 agonvme-print: Display smart log data units read and written SI value
Tokunori Ikegami [Wed, 28 Dec 2022 06:18:25 +0000 (15:18 +0900)]
nvme-print: Display smart log data units read and written SI value

This resolves for the issue #1745. Also change smart log uint128_t values as
group the output with thousands' grouping characters and add test-iunt128-si
unit tests.

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
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>