ryantimwilson / rpms / systemd

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