nvme-cli: nvmf-autoconnect: Consolidate vendor-specific NVMe-oF udev rules into a single file
Subsystems (5)
PATCH 1/1 nvme-cli: nvmf-autoconnect: Consolidate vendor-specific NVMe-oF udev rules into a single file
Replace individual vendor udev rules (HPE, NetApp, and VAST Data) with a unified 80-nvmf-storage_arrays.rules file, leaving the rules untouched.
This shifts execution to the 80 range for a logical sequence after base discovery and autoconnect, while simplifying maintenance and packaging.
---
BTW, there are two new I/O policies in development:
https://lore.kernel.org/linux-nvme/[email protected]/
https://lore.kernel.org/linux-nvme/[email protected]/
--- meson.build | 4 +--- nvme.spec.in | 4 +--- .../udev-rules/71-nvmf-hpe.rules.in | 5 ---- .../udev-rules/71-nvmf-netapp.rules.in | 6 ----- .../udev-rules/71-nvmf-vastdata.rules.in | 5 ---- .../80-nvmf-storage_arrays.rules.in | 23 +++++++++++++++++++ 6 files changed, 25 insertions(+), 22 deletions(-) delete mode 100644 nvmf-autoconnect/udev-rules/71-nvmf-hpe.rules.in delete mode 100644 nvmf-autoconnect/udev-rules/71-nvmf-netapp.rules.in delete mode 100644 nvmf-autoconnect/udev-rules/71-nvmf-vastdata.rules.in create mode 100644 nvmf-autoconnect/udev-rules/80-nvmf-storage_arrays.rules.in
meson.build +1 -3
@@ -894,9 +894,7 @@ if want_nvme udev_files = { '65-persistent-net-nbft.rules': 'nvmf', '70-nvmf-keys.rules': 'nvmf-autoconnect', - '71-nvmf-hpe.rules': 'nvmf', - '71-nvmf-netapp.rules': 'nvmf', - '71-nvmf-vastdata.rules': 'nvmf', + '80-nvmf-storage_arrays.rules': 'nvmf', } if want_nvmf_autoconnect udev_files += {'70-nvmf-autoconnect.rules': 'nvmf-autoconnect'}
nvme.spec.in +1 -3
@@ -36,9 +36,7 @@ touch %{buildroot}@SYSCONFDIR@/nvme/hostid @UDEVRULESDIR@/65-persistent-net-nbft.rules @UDEVRULESDIR@/70-nvmf-autoconnect.rules @UDEVRULESDIR@/70-nvmf-keys.rules -@UDEVRULESDIR@/71-nvmf-hpe.rules -@UDEVRULESDIR@/71-nvmf-netapp.rules -@UDEVRULESDIR@/71-nvmf-vastdata.rules +@UDEVRULESDIR@/80-nvmf-storage_arrays.rules @DRACUTRULESDIR@/70-nvmf-autoconnect.conf @SYSTEMDDIR@/[email protected] @SYSTEMDDIR@/nvmefc-boot-connections.service
nvmf-autoconnect/udev-rules/71-nvmf-hpe.rules.in deleted +0 -5
@@ -1,5 +0,0 @@ -# Set appropriate iopolicy for HPE Alletra Storage MP -ACTION=="add", SUBSYSTEM=="nvme-subsystem", ATTR{subsystype}=="nvm", ATTR{model}=="HPE Alletra", ATTR{iopolicy}="round-robin" - -# Set ctrl_loss_tmo to -1 for HPE Alletra Storage MP NVMe/TCP -ACTION!="remove", SUBSYSTEM=="nvme", KERNEL=="nvme*", ATTR{transport}=="tcp", ATTR{model}=="HPE Alletra", ATTR{ctrl_loss_tmo}="-1"
nvmf-autoconnect/udev-rules/71-nvmf-netapp.rules.in deleted +0 -6
@@ -1,6 +0,0 @@ -# Set appropriate iopolicy for NetApp ONTAP and NetApp E-Series -ACTION=="add", SUBSYSTEM=="nvme-subsystem", ATTR{subsystype}=="nvm", ATTR{model}=="NetApp ONTAP Controller", ATTR{iopolicy}="queue-depth" -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"
nvmf-autoconnect/udev-rules/71-nvmf-vastdata.rules.in deleted +0 -5
@@ -1,5 +0,0 @@ -# Enable round-robin for Vast Data Block Subsystem -ACTION=="add", SUBSYSTEM=="nvme-subsystem", ATTR{subsystype}=="nvm", ATTR{model}=="VASTData", ATTR{iopolicy}="round-robin" - -# Set ctrl_loss_tmo to -1 for Vast Data Block Controller -ACTION!="remove", SUBSYSTEM=="nvme", KERNEL=="nvme*", ATTR{model}=="VASTData", ATTR{ctrl_loss_tmo}="-1"
nvmf-autoconnect/udev-rules/80-nvmf-storage_arrays.rules.in new file +23 -0
@@ -0,0 +1,23 @@ +##### Storage arrays + +#### Set iopolicy for NVMe-oF +### iopolicy: numa (default), round-robin (>=5.1), or queue-depth (>=6.11) + +## HPE +# Alletra 9000 / Alletra Storage MP / GreenLake Block Storage MP +ACTION=="add", SUBSYSTEM=="nvme-subsystem", ATTR{subsystype}=="nvm", ATTR{model}=="HPE Alletra", ATTR{iopolicy}="round-robin" +ACTION!="remove", SUBSYSTEM=="nvme", KERNEL=="nvme*", ATTR{transport}=="tcp", ATTR{model}=="HPE Alletra", ATTR{ctrl_loss_tmo}="-1" + +## NetApp +# ONTAP AFF/ASA Series +ACTION=="add", SUBSYSTEM=="nvme-subsystem", ATTR{subsystype}=="nvm", ATTR{model}=="NetApp ONTAP Controller", ATTR{iopolicy}="queue-depth" +ACTION!="remove", SUBSYSTEM=="nvme", KERNEL=="nvme*", ATTR{transport}=="tcp", ATTR{model}=="NetApp ONTAP Controller", ATTR{ctrl_loss_tmo}="-1" +# E/EF-Series +ACTION=="add", SUBSYSTEM=="nvme-subsystem", ATTR{subsystype}=="nvm", ATTR{model}=="NetApp E-Series", ATTR{iopolicy}="round-robin" + +## VAST Data +# Block Subsystem +ACTION=="add", SUBSYSTEM=="nvme-subsystem", ATTR{subsystype}=="nvm", ATTR{model}=="VASTData", ATTR{iopolicy}="round-robin" +ACTION!="remove", SUBSYSTEM=="nvme", KERNEL=="nvme*", ATTR{model}=="VASTData", ATTR{ctrl_loss_tmo}="-1" + +##### EOF
Signature · 1 line
2.56.0
Quoted 34 lines · Xose Vazquez Perez
Replace individual vendor udev rules (HPE, NetApp, and VAST Data) with
a unified 80-nvmf-storage_arrays.rules file, leaving the rules untouched.This shifts execution to the 80 range for a logical sequence after base
discovery and autoconnect, while simplifying maintenance and packaging.Cc John Garry <[email protected]>Cc Nilay Shroff <[email protected]>Cc Guixin Liu <[email protected]>Cc Wayne Berthiaume <[email protected]>Cc Vasuki Manikarnike <[email protected]>Cc Matthias Rudolph <[email protected]>Cc Martin George <[email protected]>Cc NetApp RDAC team <[email protected]>Cc Zou Ming <[email protected]>Cc Li Xiaokeng <[email protected]>Cc Randy Jennings <[email protected]>Cc Jyoti Rani <[email protected]>Cc Brian Bunker <[email protected]>Cc Uday Shankar <[email protected]>Cc Chaitanya Kulkarni <[email protected]>Cc Sagi Grimberg <[email protected]>Cc Keith Busch <[email protected]>Cc Christoph Hellwig <[email protected]>Cc Marco Patalano <[email protected]>Cc Ewan D. Milne <[email protected]>Cc John Meneghini <[email protected]>Cc Daniel Wagner <[email protected]>Cc Daniel Wagner <[email protected]>Cc Hannes Reinecke <[email protected]>
Quoted 8 lines
Cc Martin Wilck <[email protected]>Cc Benjamin Marzinski <[email protected]>Cc Christophe Varoqui <[email protected]>Cc BLOCK-ML <[email protected]>Cc NVME-ML <[email protected]>Cc SCSI-ML <[email protected]>Cc DM_DEVEL-ML <[email protected]>Signed-off-by Xose Vazquez Perez <[email protected]>
Generally a good idea, but I think nvme-cli has a GitHub based development workflow these days.
Quoted 115 lines
---
BTW, there are two new I/O policies in development:
https://lore.kernel.org/linux-nvme/[email protected]/
https://lore.kernel.org/linux-nvme/[email protected]/
---
meson.build | 4 +--- nvme.spec.in | 4 +--- .../udev-rules/71-nvmf-hpe.rules.in | 5 ---- .../udev-rules/71-nvmf-netapp.rules.in | 6 ----- .../udev-rules/71-nvmf-vastdata.rules.in | 5 ---- .../80-nvmf-storage_arrays.rules.in | 23
+++++++++++++++++++6 files changed, 25 insertions(+), 22 deletions(-)delete mode 100644 nvmf-autoconnect/udev-rules/71-nvmf-hpe.rules.in delete mode 100644 nvmf-autoconnect/udev-rules/71-nvmf- netapp.rules.in
delete mode 100644 nvmf-autoconnect/udev-rules/71-nvmf- vastdata.rules.in
create mode 100644 nvmf-autoconnect/udev-rules/80-nvmf- storage_arrays.rules.inmeson.build +1
-3@@ -894,9 +894,7 @@ if want_nvme udev_files = { '65-persistent-net-nbft.rules': 'nvmf', '70-nvmf-keys.rules': 'nvmf-autoconnect', - '71-nvmf-hpe.rules': 'nvmf', - '71-nvmf-netapp.rules': 'nvmf', - '71-nvmf-vastdata.rules': 'nvmf', + '80-nvmf-storage_arrays.rules': 'nvmf', }if
want_nvmf_autoconnect
udev_files+= {'70-nvmf-autoconnect.rules': 'nvmf- autoconnect'}nvme.spec.in +0
-0@@ -36,9 +36,7 @@ touch %{buildroot}@SYSCONFDIR@/nvme/hostid@UDEVRULESDIR@/65-persistent-net-nbft.rules
@UDEVRULESDIR@/70-nvmf-autoconnect.rules
@UDEVRULESDIR@/70-nvmf-keys.rules
-@UDEVRULESDIR@/71-nvmf-hpe.rules
-@UDEVRULESDIR@/71-nvmf-netapp.rules
-@UDEVRULESDIR@/71-nvmf-vastdata.rules
+@UDEVRULESDIR@/80-nvmf-storage_arrays.rules
@DRACUTRULESDIR@/70-nvmf-autoconnect.conf
@SYSTEMDDIR@/[email protected]
@SYSTEMDDIR@/nvmefc-boot-connections.servicenvmf- renamed from nvmf-autoconnect/udev-rules/71-nvmf-hpe.rules.in +0
-0autoconnect/udev-rules/71-nvmf-hpe.rules.in
deleted file mode 100644
index b050dd502..000000000nvmf-autoconnect/udev-rules/71-nvmf-hpe.rules.in deleted +0
-2@@ -1,5 +0,0 @@ -# Set appropriate iopolicy for HPE Alletra Storage MP -ACTION=="add", SUBSYSTEM=="nvme-subsystem", ATTR{subsystype}=="nvm",ATTR{model}=="HPE Alletra", ATTR{iopolicy}="round-robin"
nvmf-autoconnect/udev-rules/71-nvmf-hpe.rules.in deleted +0
-3- -# Set ctrl_loss_tmo to -1 for HPE Alletra Storage MP NVMe/TCP -ACTION!="remove", SUBSYSTEM=="nvme", KERNEL=="nvme*",ATTR{transport}=="tcp", ATTR{model}=="HPE Alletra", ATTR{ctrl_loss_tmo}="-1"
nvmf-autoconnect/udev-rules/71-nvmf-netapp.rules.in deleted +0
-2@@ -1,6 +0,0 @@ -# Set appropriate iopolicy for NetApp ONTAP and NetApp E-Series -ACTION=="add", SUBSYSTEM=="nvme-subsystem", ATTR{subsystype}=="nvm",ATTR{model}=="NetApp ONTAP Controller", ATTR{iopolicy}="queue-depth" -ACTION=="add", SUBSYSTEM=="nvme-subsystem", ATTR{subsystype}=="nvm", ATTR{model}=="NetApp E-Series", ATTR{iopolicy}="round-robin"
nvmf-autoconnect/udev-rules/71-nvmf-netapp.rules.in deleted +0
-3- -# 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"
nvmf-autoconnect/udev-rules/71-nvmf-vastdata.rules.in deleted +0
-2@@ -1,5 +0,0 @@ -# Enable round-robin for Vast Data Block Subsystem -ACTION=="add", SUBSYSTEM=="nvme-subsystem", ATTR{subsystype}=="nvm",ATTR{model}=="VASTData", ATTR{iopolicy}="round-robin"
nvmf-autoconnect/udev-rules/71-nvmf-vastdata.rules.in deleted +0
-3- -# Set ctrl_loss_tmo to -1 for Vast Data Block Controller -ACTION!="remove", SUBSYSTEM=="nvme", KERNEL=="nvme*",ATTR{model}=="VASTData", ATTR{ctrl_loss_tmo}="-1"
(quoted diff) +0
-0storage_arrays.rules.in b/nvmf-autoconnect/udev-rules/80-nvmf- storage_arrays.rules.in
new file mode 100644
index 000000000..1cd6c0c0bnvmf-autoconnect/udev-rules/80-nvmf-storage_arrays.rules.in new file +4
-0@@ -0,0 +1,23 @@ +##### Storage arrays + +#### Set iopolicy for NVMe-oF +### iopolicy: numa (default), round-robin (>=5.1), or queue-depth(>=6.11)
nvmf-autoconnect/udev-rules/80-nvmf-storage_arrays.rules.in new file +4
-0+ +## HPE +# Alletra 9000 / Alletra Storage MP / GreenLake Block Storage MP +ACTION=="add", SUBSYSTEM=="nvme-subsystem", ATTR{subsystype}=="nvm",
Quoted 4 lines
ATTR{model}=="HPE Alletra", ATTR{iopolicy}="round-robin" +ACTION!="remove", SUBSYSTEM=="nvme", KERNEL=="nvme*", ATTR{transport}=="tcp", ATTR{model}=="HPE Alletra", ATTR{ctrl_loss_tmo}="-1"
I'm not a fan of repeated lengthy match expressions in udev rules. Can we improve the readability by using GOTOs and LABELS?
SUBSYSTEM!="nvme*", GOTO="nvmf_end"
ATTR{model}=="HPE Alletra", GOTO="Alletra" ATTR{model}=="NetApp ONTAP Controller", GOTO="Ontap"
...
GOTO="nvmf_end"
LABEL="Alletra"
ACTION=="add", SUBSYSTEM=="nvme-subsystem", ATTR{subsystype}=="nvm", \
ATTR{iopolicy}="queue-depth"
ACTION!="remove", SUBSYSTEM=="nvme", KERNEL=="nvme*", \
ATTR{transport}=="tcp", ATTR{ctrl_loss_tmo}="-1"GOTO="nvmf_end"
LABEL="Ontap"
...
LABEL="nvmf_end"
Signature · 5 lines
Dr. Martin Wilck <[email protected]> SUSE Software Solutions Germany GmbH, Frankenstr. 146, 90461 Nürnberg, Germany Geschäftsführer: Stefan Gaiser, Jochen Jaser, Abhinav Puri (HRB 36809,AG Nürnberg)
Quoted 34 lines · Martin Wilck
Quoted 24 lines · Xose Vazquez Perez
Cc John Garry <[email protected]>Cc Nilay Shroff <[email protected]>Cc Guixin Liu <[email protected]>Cc Wayne Berthiaume <[email protected]>Cc Vasuki Manikarnike <[email protected]>Cc Matthias Rudolph <[email protected]>Cc Martin George <[email protected]>Cc NetApp RDAC team <[email protected]>Cc Zou Ming <[email protected]>Cc Li Xiaokeng <[email protected]>Cc Randy Jennings <[email protected]>Cc Jyoti Rani <[email protected]>Cc Brian Bunker <[email protected]>Cc Uday Shankar <[email protected]>Cc Chaitanya Kulkarni <[email protected]>Cc Sagi Grimberg <[email protected]>Cc Keith Busch <[email protected]>Cc Christoph Hellwig <[email protected]>Cc Marco Patalano <[email protected]>Cc Ewan D. Milne <[email protected]>Cc John Meneghini <[email protected]>Cc Daniel Wagner <[email protected]>Cc Daniel Wagner <[email protected]>Cc Hannes Reinecke <[email protected]>Quoted 8 lines
Cc Martin Wilck <[email protected]>Cc Benjamin Marzinski <[email protected]>Cc Christophe Varoqui <[email protected]>Cc BLOCK-ML <[email protected]>Cc NVME-ML <[email protected]>Cc SCSI-ML <[email protected]>Cc DM_DEVEL-ML <[email protected]>Signed-off-by Xose Vazquez Perez <[email protected]>
Quoted 2 lines
Generally a good idea, but I think nvme-cli has a GitHub based development workflow these days.
While GitHub is an option, web-based interfaces tend to limit patch visibility and broad review reach across subsystems. Mailing lists remain far more versatile for cross-project visibility and discussion.
Quoted 2 lines
I'm not a fan of repeated lengthy match expressions in udev rules. Can we improve the readability by using GOTOs and LABELS?
Using GOTOs and LABELS cleans up the duplicated model match expressions nicely. However, the scope of this patch is intentionally kept to a pure consolidation.