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>
Caleb Sander [Sun, 5 Nov 2023 16:02:02 +0000 (09:02 -0700)]
libnvme-wrap: exit on VOID_FN lookup failure
libnvme-wrap provides fallbacks for missing libnvme functions.
For functions that return a value, the FN() macro can be used
to define a default return value if the function isn't found.
This isn't possible for functions returning void,
so VOID_FN() currently is a no-op if the function can't be found.
For nvme_init_copy_range_f1(), the only current VOID_FN() user,
this will result in silently sending a Copy command
with a zeroed range, which is not what the user requested.
Instead, exit the process immediately if the function can't be found.
Joy Gu [Wed, 25 Oct 2023 20:38:25 +0000 (13:38 -0700)]
nvme-copy: support cross-namespace copy
Add support for NVMe TP4130 ("Cross-Namespace Copy")
- Add Copy Descriptor Formats 2h and 3h
- Add "--snsids" option to specify source namespaces to copy from
- Add "--sopts" option to specify source options (Fast Copy Only)
- Print new Host Behavior Support bits, new ONCS bits, and new Optional
Copy Formats Supported bits
- Extend unit test case to test cross-namespace copy formats
Steven Seungcheol Lee [Fri, 3 Nov 2023 00:53:50 +0000 (09:53 +0900)]
nvme: fix overflow possiblity
The implicit type conversion will expand both operands to the type
int and not unsigned long long as the result expects. Promote
the first operand to the target type. Obviously the multiplication
can still overflow, but this is a different problem.
Signed-off-by: Steven Seungcheol Lee <sc108.lee@samsung.com>
[dwagner: added commit message] Signed-off-by: Daniel Wagner <dwagner@suse.de>
Caleb Sander [Wed, 25 Oct 2023 20:52:19 +0000 (14:52 -0600)]
print-stdout: print Host Behavior Support correctly
In nvme-cli 1.16, printing the Host Behavior Support feature
logged the values of the 3 fields ACRE, ETDAS, and LBAFEE.
This appears to have regressed in nvme-cli 2.0,
and now only the value of ACRE is printed, without any description.
Log all 3 fields with proper descriptions.
Drop "Host Behavior Support" from their names,
as it's redundant with the feature name.