summaryrefslogtreecommitdiff
path: root/udev-56-net-sriov-names.rules
diff options
context:
space:
mode:
authorCoprDistGit <infra@openeuler.org>2024-12-12 02:54:13 +0000
committerCoprDistGit <infra@openeuler.org>2024-12-12 02:54:13 +0000
commita35fcc8b3fc340a6b874440b2a87e155c807ece5 (patch)
tree02ca631dd69c05a4dfcbd98a0ed12e2b0d2cd035 /udev-56-net-sriov-names.rules
parentb7abaf7e217d7948f8101d25013189a9322dd6ef (diff)
automatic import of systemdopeneuler24.03_LTS
Diffstat (limited to 'udev-56-net-sriov-names.rules')
-rw-r--r--udev-56-net-sriov-names.rules17
1 files changed, 17 insertions, 0 deletions
diff --git a/udev-56-net-sriov-names.rules b/udev-56-net-sriov-names.rules
new file mode 100644
index 0000000..e562b2c
--- /dev/null
+++ b/udev-56-net-sriov-names.rules
@@ -0,0 +1,17 @@
+# do not edit this file, it will be overwritten on update
+#
+# rename SRIOV virtual function interfaces
+
+ACTION=="remove", GOTO="net-sriov-names_end"
+
+# when net.ifnames=0 is not set in command line ,do not generate net-name rules
+IMPORT{cmdline}="net.ifnames"
+ENV{net.ifnames}!="0",SUBSYSTEMS=="pci", GOTO="net-sriov-names_end"
+
+SUBSYSTEM=="net", SUBSYSTEMS=="pci", ACTION=="add", NAME=="?*", ENV{INTERFACE_NEW}="$name"
+SUBSYSTEM=="net", SUBSYSTEMS=="pci", ACTION=="add", IMPORT{program}="net-set-sriov-names"
+
+# rename interface if needed
+ENV{INTERFACE_NEW}=="?*", NAME="$env{INTERFACE_NEW}"
+
+LABEL="net-sriov-names_end"