From dcc59dffa5116bf96618065cd60742cb660224b8 Mon Sep 17 00:00:00 2001 From: Lukas Nykryn Date: Fri, 22 Sep 2023 13:28:02 +0200 Subject: [PATCH] netif-naming-scheme: let's also include rhel8 schemes With this patch user in rhel9 can also pick a scheme from rhel8. This could be useful on in-place upgrades. rhel-only Resolves: RHEL-7026 --- man/systemd.net-naming-scheme.xml | 88 +++++++++++++++++++++++++++++++ src/shared/netif-naming-scheme.c | 10 ++++ src/shared/netif-naming-scheme.h | 12 +++++ 3 files changed, 110 insertions(+) diff --git a/man/systemd.net-naming-scheme.xml b/man/systemd.net-naming-scheme.xml index ade4e27e31..c6ab86906a 100644 --- a/man/systemd.net-naming-scheme.xml +++ b/man/systemd.net-naming-scheme.xml @@ -459,6 +459,94 @@ + + rhel-8.0 + + Naming was changed for virtual network interfaces created with SR-IOV and NPAR and + for devices where the PCI network controller device does not have a slot number associated. + + SR-IOV virtual devices are named based on the name of the parent interface, with a suffix of + vport, where port is the + virtual device number. Previously those virtual devices were named as if completely independent. + + + The ninth and later NPAR virtual devices are named following the scheme used for the first + eight NPAR partitions. Previously those devices were not renamed and the kernel default + ("ethN") was used. + + Names are also generated for PCI devices where the PCI network controller device does not + have an associated slot number itself, but one of its parents does. Previously those devices were + not renamed and the kernel default was used. + + + + + rhel-8.1 + + Same as naming scheme rhel-8.0. + + + + rhel-8.2 + + Same as naming scheme rhel-8.0. + + + + rhel-8.3 + + Same as naming scheme rhel-8.0. + + + + rhel-8.4 + + If the PCI slot is assocated with PCI bridge and that has multiple child network + controllers then all of them might derive the same value of ID_NET_NAME_SLOT + property. That could cause naming conflict if the property is selected as a device name. Now, we detect the + situation, slot - bridge relation, and we don't produce the ID_NET_NAME_SLOT property to + avoid possible naming conflict. + + + + rhel-8.5 + + Same as naming scheme rhel-8.4. + + + + rhel-8.6 + + Same as naming scheme rhel-8.4. + + + + rhel-8.7 + + PCI hotplug slot names for the s390 PCI driver are a hexadecimal representation + of the function_id device attribute. This attribute is now used to build the + ID_NET_NAME_SLOT. Before that, all slot names were parsed as decimal + numbers, which could either result in an incorrect value of the ID_NET_NAME_SLOT + property or none at all. + + Some firmware and hypervisor implementations report unreasonable high numbers for the onboard + index. To prevent the generation of bogus onbard interface names, index numbers greater than 16381 + (2^14-1) were ignored. For s390 PCI devices index values up to 65535 (2^16-1) are valid. To account + for that, the limit is increased to now 65535. + + + + rhel-8.8 + + Same as naming scheme rhel-8.7. + + + + rhel-8.9 + + Same as naming scheme rhel-8.7. + + rhel-9.0 diff --git a/src/shared/netif-naming-scheme.c b/src/shared/netif-naming-scheme.c index 0f50533279..9cfa5ca8e6 100644 --- a/src/shared/netif-naming-scheme.c +++ b/src/shared/netif-naming-scheme.c @@ -25,6 +25,16 @@ static const NamingScheme naming_schemes[] = { { "v250", NAMING_V250 }, { "v251", NAMING_V251 }, { "v252", NAMING_V252 }, + { "rhel-8.0", NAMING_RHEL_8_0 }, + { "rhel-8.1", NAMING_RHEL_8_1 }, + { "rhel-8.2", NAMING_RHEL_8_2 }, + { "rhel-8.3", NAMING_RHEL_8_3 }, + { "rhel-8.4", NAMING_RHEL_8_4 }, + { "rhel-8.5", NAMING_RHEL_8_5 }, + { "rhel-8.6", NAMING_RHEL_8_6 }, + { "rhel-8.7", NAMING_RHEL_8_7 }, + { "rhel-8.8", NAMING_RHEL_8_8 }, + { "rhel-8.9", NAMING_RHEL_8_9 }, { "rhel-9.0", NAMING_RHEL_9_0 }, { "rhel-9.1", NAMING_RHEL_9_1 }, { "rhel-9.2", NAMING_RHEL_9_2 }, diff --git a/src/shared/netif-naming-scheme.h b/src/shared/netif-naming-scheme.h index fb3c8eb9b3..ed45536f65 100644 --- a/src/shared/netif-naming-scheme.h +++ b/src/shared/netif-naming-scheme.h @@ -52,6 +52,18 @@ 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_8_0 = NAMING_V239, + NAMING_RHEL_8_1 = NAMING_V239, + NAMING_RHEL_8_2 = NAMING_V239, + NAMING_RHEL_8_3 = NAMING_V239, + NAMING_RHEL_8_4 = NAMING_V239 | NAMING_BRIDGE_NO_SLOT, + NAMING_RHEL_8_5 = NAMING_RHEL_8_4, + NAMING_RHEL_8_6 = NAMING_RHEL_8_4, + NAMING_RHEL_8_7 = NAMING_RHEL_8_4 | NAMING_SLOT_FUNCTION_ID | NAMING_16BIT_INDEX, + NAMING_RHEL_8_8 = NAMING_RHEL_8_7, + NAMING_RHEL_8_9 = NAMING_RHEL_8_7, + NAMING_RHEL_9_0 = NAMING_V250 | NAMING_BRIDGE_MULTIFUNCTION_SLOT, NAMING_RHEL_9_1 = NAMING_RHEL_9_0, NAMING_RHEL_9_2 = NAMING_RHEL_9_0,