dcavalca / rpms / systemd

Forked from rpms/systemd 4 months ago
Clone
ac3a84
From 6a3afa1a7e302ae414fbfa64b3da281aa56d64ed Mon Sep 17 00:00:00 2001
ac3a84
From: Michal Sekletar <msekleta@redhat.com>
ac3a84
Date: Wed, 23 Mar 2022 17:34:12 +0100
ac3a84
Subject: [PATCH] udev/net_id: avoid slot based names only for single function
ac3a84
 devices
ac3a84
ac3a84
If we have two or more devices that share the same slot but they are
ac3a84
also multifunction then it is OK to use the slot information even if it
ac3a84
is the same for all of them. Name conflict will be avoided because we
ac3a84
will append function number and form names like, ens1f1, ens1f2...
ac3a84
ac3a84
(cherry picked from commit 66425daf2c68793adf24a48a26d58add8662e83f)
ac3a84
ac3a84
Related: #2138081
ac3a84
---
ac3a84
 man/systemd.net-naming-scheme.xml | 7 ++++++-
ac3a84
 src/shared/netif-naming-scheme.h  | 2 +-
ac3a84
 2 files changed, 7 insertions(+), 2 deletions(-)
ac3a84
ac3a84
diff --git a/man/systemd.net-naming-scheme.xml b/man/systemd.net-naming-scheme.xml
ac3a84
index 8c2017a0ce..e5268be38e 100644
ac3a84
--- a/man/systemd.net-naming-scheme.xml
ac3a84
+++ b/man/systemd.net-naming-scheme.xml
ac3a84
@@ -451,7 +451,12 @@
ac3a84
         <varlistentry>
ac3a84
           <term><constant>rhel-9.0</constant></term>
ac3a84
 
ac3a84
-          <listitem><para>Same as naming scheme <constant>v250</constant>.</para>
ac3a84
+          <listitem><para>Since version <constant>v247</constant> we no longer set
ac3a84
+          <varname>ID_NET_NAME_SLOT</varname> if we detect that a PCI device associated with a slot is a PCI
ac3a84
+          bridge as that would create naming conflict when there are more child devices on that bridge. Now,
ac3a84
+          this is relaxed and we will use slot information to generate the name based on it but only if
ac3a84
+          the PCI device has multiple functions. This is safe because distinct function number is a part of
ac3a84
+          the device name for multifunction devices.</para>
ac3a84
           </listitem>
ac3a84
         </varlistentry>
ac3a84
 
ac3a84
diff --git a/src/shared/netif-naming-scheme.h b/src/shared/netif-naming-scheme.h
ac3a84
index b5fa1f0ef0..fd3ae1b7f5 100644
ac3a84
--- a/src/shared/netif-naming-scheme.h
ac3a84
+++ b/src/shared/netif-naming-scheme.h
ac3a84
@@ -51,7 +51,7 @@ typedef enum NamingSchemeFlags {
ac3a84
         NAMING_V250 = NAMING_V249 | NAMING_XEN_VIF,
ac3a84
         NAMING_V251 = NAMING_V250 | NAMING_BRIDGE_MULTIFUNCTION_SLOT,
ac3a84
         NAMING_V252 = NAMING_V251 | NAMING_DEVICETREE_ALIASES,
ac3a84
-        NAMING_RHEL_9_0 = NAMING_V250,
ac3a84
+        NAMING_RHEL_9_0 = NAMING_V250 | NAMING_BRIDGE_MULTIFUNCTION_SLOT,
ac3a84
 
ac3a84
         EXTRA_NET_NAMING_SCHEMES
ac3a84