hris Patterson [Mon, 11 Dec 2023 08:39:23 +0000 (09:39 +0100)]
nvme-print-json: include vs for identify namespace
While the spec may allow for arbitrary use of vendor-specific
data, some implementations are simply strings. JSON will
encode the string, allowing for safe use of control characters.
The only requirement is that the there be a null-byte in the
vendor-specific field terminating the string. Data beyond the
null-byte will be ignored.
Signed-off-by: Chris Patterson <cpatterson@microsoft.com>
[dwagner: use d_json instead obj_add_str] Signed-off-by: Daniel Wagner <dwagner@suse.de>
Martin George [Sat, 16 Dec 2023 19:31:50 +0000 (01:01 +0530)]
fabrics: fix connect error if hostid file does not exist
Currently one sees a connect error during a nvme discover/connect
if the hostnqn file exists, but not the hostid file. Fix this
by ensuring the hostid is taken from the corresponding hostnqn for
such scenarios.
Martin George [Sat, 16 Dec 2023 19:15:56 +0000 (00:45 +0530)]
fabrics: fix invalid output format error during nvme connect
Nvme connect currently fails with an "Invalid output format"
error if no output-format is specified to the nvme connect
command. Fix this by initializing the format string.
jeff-lien-wdc [Wed, 13 Dec 2023 21:51:35 +0000 (15:51 -0600)]
wdc: Fix vs-smart-add-log Command for SN650 and SN655
The incorrect log page was being displayed because
the wrong uuid index was being used. This patch
determines the correct uuid index needed for
SN650 and SN655.
Martin George [Thu, 14 Dec 2023 07:32:54 +0000 (13:02 +0530)]
nvme: restric hmac options for gen-tls-key
During nvme gen-tls-key generation, the permitted hmac options is 1
for SHA-256 & 2 for SHA-384 respectively for the retained key. But
nvme-cli mistakenly permits an additional option 3 too which defaults
to SHA-256 itself. Rectify this.
jeff-lien-wdc [Wed, 6 Dec 2023 16:21:06 +0000 (10:21 -0600)]
wdc: Fix UUID index fallback mechanism
For certain devices that don't support UUID lists, there may be multiple
definitions of the C2 logpage. This code will check for UUID list
support and search the UUID list for the correct UUID, if supported. If
UUID lists are not supported, the code will try uuid index 0 and 1 and
use an identification algorithm to determine which is returning the
correct log page data.
Arthur Shau [Tue, 5 Dec 2023 03:45:40 +0000 (19:45 -0800)]
plugins/ocp: Fix printing order of various Latency Monitor Log buckets
Several buckets were being printed out in an incorrect order (so bucket
3 was being labelled as bucket 0, bucket 2 was labelled as bucket 1, 1
was labelled as 2, etc.).
The tables with these affected buckets were the : Active Latency
Timestamp table, Active Measured Latency table, Static Latency Timestamp
table, and Static Measure Latency table.
Also changed active latency configuration to just print out the hex
value, rather than creating another table.
Caleb Sander [Tue, 28 Nov 2023 20:17:45 +0000 (13:17 -0700)]
cleanup: remove unused cleanup_charp()
cleanup_charp() appears to have been copied from libnvme,
but it has no users. _cleanup_free_ is more general, anyways.
So remove cleanup_charp() along with cleanup.c.
Daniel Wagner [Wed, 29 Nov 2023 11:14:17 +0000 (12:14 +0100)]
nvme: auto cleanup filedescriptors
Let's make the cleanup logic simpler by using the cleanup hooks for file
descriptors.
Also to simplify the logic don't close STDIN, STDOUT or STDERR. With
this we don't have to dup these file descriptor when we still want to
write to stdout with printf.
Hannes Reinecke [Thu, 16 Nov 2023 08:14:00 +0000 (09:14 +0100)]
nvme: print out the resulting TLS identity for 'nvme check-tls-key'
Add an option '--version' to specify which key identity version to use,
and add an option '--insert' to clarify whether the retained key should
be inserted in the keyring or not.
Hannes Reinecke [Wed, 15 Nov 2023 15:51:10 +0000 (16:51 +0100)]
nvme: Add version '1' identifier for nvme-gen-tls-key
With NVMe TP8018 the NVMe TLS PSK identity changed, and a PSK
digest got attached to the identity.
Update the 'nvme-gen-tls-key' program to accept an 'identity' option
to allow to switch between the two methods.
Tokunori Ikegami [Thu, 16 Nov 2023 16:42:00 +0000 (17:42 +0100)]
build: remove the wrap feature dependency for muon
The libnvme.wrap is using a git URL for libnvme thus it doesn't depend
on libcurl, libarchive or libpkgconf. The wrap implementation is calling
git directly to download the library. Thus we can drop these dependency
which makes it possible to build it on older distributions such as
CentOS 7 and 8.
Daniel Wagner [Thu, 16 Nov 2023 14:28:25 +0000 (15:28 +0100)]
build: do not rebuild muon/samu every time
There is not need to build the build tools everytime. Thus stage the
samurai and muon build into a new top level directory .build-tools and
only build them on demand.
Daniel Wagner [Thu, 16 Nov 2023 10:58:42 +0000 (11:58 +0100)]
doc: remove invalid hostkey info for --dhchap-secret
There is no code which reads in the secret from the mentioned file. This
was done in the early stages of the implementation. But it is not
considered good practice to store secrets as plain text in /etc, thus
this feature was removed later. Instead the connect command is able to
use the kernel keystore for this.
Daniel Wagner [Thu, 16 Nov 2023 10:22:33 +0000 (11:22 +0100)]
plugins/ocp: update nvme_show_select_result call
The recent nvme-print-json refactoring/exstension changed the
nvme_show_select_result function signature but missed to update the ocp
plugin. Pass in the fid to the show function.
Fixes: 28a3a0975a33 ("nvme-print-json: Change to report feature select in array") Signed-off-by: Daniel Wagner <dwagner@suse.de>
Martin Wilck [Tue, 23 May 2023 12:19:14 +0000 (14:19 +0200)]
fabrics: add udev rule to avoid renaming nbft interfaces
In the initramfs, the interface naming is taken care of by dracut.
But there are various network-interface-naming policies in place which
may attempt to rename the interface, causing confusion and possibly
wrong interface parameters.
Add an udev rule that avoids renaming any network interface that
has been assigned a name nbft$N, which is by convention the naming
scheme that is used for NBFT device in the initramfs.
Note: The simpler 'NAME:="%k"' directive doesn't work because udev rejects
it ('Ignoring NAME="%k", as it will take no effect.'). The ":=" syntax makes
sure the interface isn't renamed any more by later rules. "INTERFACE" is set
by the kernel in the "add" uevent for a network interface.
Martin Wilck [Tue, 23 May 2023 10:48:55 +0000 (12:48 +0200)]
fabrics: autoconnect: add service unit for connecting NBFT subsystems
Create a separate unit file for connecting to NBFT-defined subsystems.
This unit is intended to be called in "post-up" scripts from network
management software if an interface defined in the HFI section of the
NBFT is brought up (L3-configured).
In simple scenarios with just one HFI, this won't be necessary because the
interface must be brought up in the initramfs already. But in multipath
scenarios, the initramfs may choose not to wait for every HFI to come up, and
thus it may be necessary to bring up the secondary connection(s) later on.
Signed-off-by: Martin Wilck <mwilck@suse.com>
[dwagner: use unit options instead of ExecStartPre
update nvme command line] Signed-off-by: Daniel Wagner <dwagner@suse.de>