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.
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>
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>
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>
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>
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>
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).
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.
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:
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.
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.
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.
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>
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>
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.
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>
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.
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.
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>
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.