summaryrefslogtreecommitdiffstats
path: root/nvmf-autoconnect
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2023-12-24 07:57:54 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2023-12-24 07:57:54 +0000
commit66e4b69042cd3b44acd42f1fad2109180c1bc48b (patch)
tree8bd8e664ae856167566375357963062e8112f181 /nvmf-autoconnect
parentReleasing debian version 2.5-1. (diff)
downloadnvme-cli-66e4b69042cd3b44acd42f1fad2109180c1bc48b.tar.xz
nvme-cli-66e4b69042cd3b44acd42f1fad2109180c1bc48b.zip
Merging upstream version 2.7.1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'nvmf-autoconnect')
-rw-r--r--nvmf-autoconnect/systemd/nvmf-autoconnect.service.in3
-rw-r--r--nvmf-autoconnect/systemd/nvmf-connect-nbft.service.in14
-rw-r--r--nvmf-autoconnect/udev-rules/65-persistent-net-nbft.rules.in2
-rw-r--r--nvmf-autoconnect/udev-rules/71-nvmf-iopolicy-netapp.rules.in3
-rw-r--r--nvmf-autoconnect/udev-rules/71-nvmf-netapp.rules.in6
5 files changed, 24 insertions, 4 deletions
diff --git a/nvmf-autoconnect/systemd/nvmf-autoconnect.service.in b/nvmf-autoconnect/systemd/nvmf-autoconnect.service.in
index 621879a..92960cd 100644
--- a/nvmf-autoconnect/systemd/nvmf-autoconnect.service.in
+++ b/nvmf-autoconnect/systemd/nvmf-autoconnect.service.in
@@ -2,12 +2,13 @@
Description=Connect NVMe-oF subsystems automatically during boot
ConditionPathExists=|@SYSCONFDIR@/nvme/config.json
ConditionPathExists=|@SYSCONFDIR@/nvme/discovery.conf
+Wants=modprobe@nvme_fabrics.service
+After=modprobe@nvme_fabrics.service
After=network-online.target
Before=remote-fs-pre.target
[Service]
Type=oneshot
-ExecStartPre=/sbin/modprobe nvme-fabrics
ExecStart=@SBINDIR@/nvme connect-all --context=autoconnect
[Install]
diff --git a/nvmf-autoconnect/systemd/nvmf-connect-nbft.service.in b/nvmf-autoconnect/systemd/nvmf-connect-nbft.service.in
new file mode 100644
index 0000000..820e6ce
--- /dev/null
+++ b/nvmf-autoconnect/systemd/nvmf-connect-nbft.service.in
@@ -0,0 +1,14 @@
+# This unit is meant to be started by network management software
+# after a network interface defined in the NBFT gets set up
+[Unit]
+Description=Connect NBFT-defined NVMe-oF subsystems automatically
+ConditionPathExists=|/sys/firmware/acpi/tables/NBFT
+ConditionPathExists=|/sys/firmware/acpi/tables/NBFT1
+Wants=modprobe@nvme_fabrics.service
+After=modprobe@nvme_fabrics.service
+After=network-online.target
+Before=remote-fs-pre.target
+
+[Service]
+Type=oneshot
+ExecStart=@SBINDIR@/nvme connect-all --nbft
diff --git a/nvmf-autoconnect/udev-rules/65-persistent-net-nbft.rules.in b/nvmf-autoconnect/udev-rules/65-persistent-net-nbft.rules.in
new file mode 100644
index 0000000..344942b
--- /dev/null
+++ b/nvmf-autoconnect/udev-rules/65-persistent-net-nbft.rules.in
@@ -0,0 +1,2 @@
+# Avoid renaming nbft$X interfaces
+SUBSYSTEM=="net", ACTION!="remove", ENV{INTERFACE}=="nbft*", NAME:="%E{INTERFACE}"
diff --git a/nvmf-autoconnect/udev-rules/71-nvmf-iopolicy-netapp.rules.in b/nvmf-autoconnect/udev-rules/71-nvmf-iopolicy-netapp.rules.in
deleted file mode 100644
index aefd9d4..0000000
--- a/nvmf-autoconnect/udev-rules/71-nvmf-iopolicy-netapp.rules.in
+++ /dev/null
@@ -1,3 +0,0 @@
-# Enable round-robin for NetApp ONTAP and NetApp E-Series
-ACTION=="add", SUBSYSTEM=="nvme-subsystem", ATTR{model}=="NetApp ONTAP Controller", ATTR{iopolicy}="round-robin"
-ACTION=="add", SUBSYSTEM=="nvme-subsystem", ATTR{model}=="NetApp E-Series", ATTR{iopolicy}="round-robin"
diff --git a/nvmf-autoconnect/udev-rules/71-nvmf-netapp.rules.in b/nvmf-autoconnect/udev-rules/71-nvmf-netapp.rules.in
new file mode 100644
index 0000000..99b6a8b
--- /dev/null
+++ b/nvmf-autoconnect/udev-rules/71-nvmf-netapp.rules.in
@@ -0,0 +1,6 @@
+# Enable round-robin for NetApp ONTAP and NetApp E-Series
+ACTION=="add", SUBSYSTEM=="nvme-subsystem", ATTR{subsystype}=="nvm", ATTR{model}=="NetApp ONTAP Controller", ATTR{iopolicy}="round-robin"
+ACTION=="add", SUBSYSTEM=="nvme-subsystem", ATTR{subsystype}=="nvm", ATTR{model}=="NetApp E-Series", ATTR{iopolicy}="round-robin"
+
+# Set ctrl_loss_tmo to -1 for NetApp ONTAP NVMe/TCP
+ACTION!="remove", SUBSYSTEM=="nvme", KERNEL=="nvme*", ATTR{transport}=="tcp", ATTR{model}=="NetApp ONTAP Controller", ATTR{ctrl_loss_tmo}="-1"