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.
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
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>
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>
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>
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.
Daniel Wagner [Wed, 14 Sep 2022 09:12:19 +0000 (11:12 +0200)]
doc: Update examples in nvme-list-subsys.txt
The examples show the output from nvme-cli 1.x. The address field
shows the attributes separated by spaces. The corresponding code in
libnvme doesn't do this. Instead the exact output from sysfs, e.g.
Daniel Wagner [Wed, 31 Aug 2022 07:41:54 +0000 (09:41 +0200)]
doc: Add 'how to contribute' section
Document how to contribute to the project. Highlight the fact, that
it expected that the PRs are also following the Linux community
contributions guidelines (clean series).
Jeremy Kerr [Wed, 24 Aug 2022 01:20:53 +0000 (09:20 +0800)]
tree: fail on non-negative return values from parse_and_open
Currently, we see a warning with specific compilers:
../nvme/nvme.c: In function 'ns_rescan':
../nvme/nvme.c:4389:19: warning: 'dev' may be used uninitialized in this function [-Wmaybe-uninitialized]
This is due to a theoretical failure path in parse_and_open(), where
argconfig_parse() returns a positive value - this would require the
global errno to be negative.
Even though the unintialised use of dev is only possible with negative
error (which shouldn't happen), we should still consider any non-zero
return value of parse_and_open a failure. This change fixes the
instances of:
err = parse_and_open(...);
if (err < 0)
changing to:
err = parse_and_open(...);
if (err)
... and also applies this to the single use of open_exclusive().
The positive return values from parse_and_open() were removed in 11542bbd; beforehand, parse_and_open() would return a fd.
Fixes: 11542bbd ("tree: Combine NVMe file descriptor into struct nvme_dev") Fixes: https://github.com/linux-nvme/nvme-cli/issues/1647 Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
Jeff Lien [Wed, 3 Aug 2022 13:34:04 +0000 (08:34 -0500)]
wdc: OCP Log page updates and fixes
Add support for Version 1 Error Recovery log page
Fix fw-activate-history timestamp json data
Update OCP log page capabiliites for SN550, SN650,
and SN655