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.
Tokunori Ikegami [Fri, 13 Oct 2023 16:25:51 +0000 (01:25 +0900)]
completions: Change short option -o and -v duplicated to upper case
The nvme-mi-recv and nvme-mi-send commands completions are not added.
All nvme commands doc/completions not added output-format/verbose options.
So for those will be added and updated doc/completions later separately.
Tokunori Ikegami [Fri, 13 Oct 2023 07:55:43 +0000 (16:55 +0900)]
nvme: Change short option -o and -v duplicated to upper case
The output-format and verbose options are added by NVMF_ARGS() macro.
So some commands short option duplicated with the option added.
Change the command short options duplicated to upper case -O and -v.
But only the get-log command lpo option changed to -L not upper case.
Sicne already upper case -O option also is used for the ot option.
Note: Documentation and completions will be updated separately.
Daniel Wagner [Wed, 11 Oct 2023 12:29:52 +0000 (14:29 +0200)]
nvme: use block-count arg if provided
When the user provides the --block-count argument use this value and
don't be clever and try to calculate the value. This is not what
the user asked us to do.
Steven Seungcheol Lee [Fri, 8 Sep 2023 05:10:22 +0000 (14:10 +0900)]
Makefile: add standalone build
To handover build binary for different environment users
Build result checked with ldd below
[root@localhost .build]# ldd nvme
not a dynamic executable
Do not run libnvme tests(set subproject revision successful build)
Disable keyutils on libnvme(pkgconfig always find shared first when -llib is given)
Signed-off-by: Steven Seungcheol Lee <sc108.lee@samsung.com>
Martin George [Thu, 5 Oct 2023 06:42:46 +0000 (12:12 +0530)]
udev-rules: rename netapp udev rule
Rename 71-nvmf-iopolicy-netapp.rules.in to 71-nvmf-netapp.rules.in
so as to make the name generic, since this not only sets the
iopolicy here but also modifies the ctrl_loss_tmo.
Martin George [Tue, 3 Oct 2023 10:35:23 +0000 (16:05 +0530)]
udev-rules: set ctrl_loss_tmo to -1 for ONTAP NVMe/TCP
Setting ctrl_loss_tmo to -1 for ONTAP NVMe/TCP controllers would enable
indefinite reconnect attempts during a path loss and help avoid purging
the path on the host, which otherwise may lead to mounted fs read-only
behavior. So add a rule towards enabling the same.
Jeremy Kerr [Sat, 23 Sep 2023 18:06:40 +0000 (11:06 -0700)]
nvme: fw-download offset only describes FW offset, not file offset
In e7ca3bcbdba, we (unintentionally) changed the semantics of the
fw-download's --offset argument to also apply an offset to the source
file.
According to https://github.com/linux-nvme/nvme-cli/issues/2013, the old
behaviour is useful when the source firmware image was provided in
separate chunks.
This change restored to the old hehaviour, where --offset only applies
to the destination firmware buffer on the device. This means that the
start of the source file will end up at the destination offset.
Fixes: https://github.com/linux-nvme/nvme-cli/issues/2013 Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
Daniel Wagner [Mon, 25 Sep 2023 12:32:23 +0000 (14:32 +0200)]
util: handle utf-8 thousend separators correctly
The separator char can be an utf-8 encoded symbol thus the length
of the string is necessarly one.
The check if we have to issue an separator needs to a fixed modulo of 3
or 4 (without or with l10n enabled) to place the symbol at the right
position in the string.
The copy loop needs to copy the all bytes from the back of the separator
byte sequence to the front, the same order we print the number.