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