Skip to content

Commit

Permalink
netif-naming-scheme: let's also include rhel8 schemes
Browse files Browse the repository at this point in the history
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
  • Loading branch information
lnykryn committed Oct 12, 2023
1 parent 55d337d commit 75c343f
Show file tree
Hide file tree
Showing 3 changed files with 110 additions and 0 deletions.
88 changes: 88 additions & 0 deletions man/systemd.net-naming-scheme.xml
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,94 @@
</listitem>
</varlistentry>

<varlistentry>
<term><constant>rhel-8.0</constant></term>

<listitem><para>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.</para>

<para>SR-IOV virtual devices are named based on the name of the parent interface, with a suffix of
<literal>v<replaceable>port</replaceable></literal>, where <replaceable>port</replaceable> is the
virtual device number. Previously those virtual devices were named as if completely independent.
</para>

<para>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
("eth<replaceable>N</replaceable>") was used.</para>

<para>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.</para>
</listitem>
</varlistentry>

<varlistentry>
<term><constant>rhel-8.1</constant></term>

<para>Same as naming scheme <constant>rhel-8.0</constant>.</para>
</varlistentry>

<varlistentry>
<term><constant>rhel-8.2</constant></term>

<para>Same as naming scheme <constant>rhel-8.0</constant>.</para>
</varlistentry>

<varlistentry>
<term><constant>rhel-8.3</constant></term>

<para>Same as naming scheme <constant>rhel-8.0</constant>.</para>
</varlistentry>

<varlistentry>
<term><constant>rhel-8.4</constant></term>

<listitem><para>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 <varname>ID_NET_NAME_SLOT</varname>
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 <varname>ID_NET_NAME_SLOT</varname> property to
avoid possible naming conflict.</para></listitem>
</varlistentry>

<varlistentry>
<term><constant>rhel-8.5</constant></term>

<para>Same as naming scheme <constant>rhel-8.4</constant>.</para>
</varlistentry>

<varlistentry>
<term><constant>rhel-8.6</constant></term>

<para>Same as naming scheme <constant>rhel-8.4</constant>.</para>
</varlistentry>

<varlistentry>
<term><constant>rhel-8.7</constant></term>

<listitem><para>PCI hotplug slot names for the s390 PCI driver are a hexadecimal representation
of the <filename>function_id</filename> device attribute. This attribute is now used to build the
<varname>ID_NET_NAME_SLOT</varname>. Before that, all slot names were parsed as decimal
numbers, which could either result in an incorrect value of the <varname>ID_NET_NAME_SLOT</varname>
property or none at all.</para>

<para>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.</para></listitem>
</varlistentry>

<varlistentry>
<term><constant>rhel-8.8</constant></term>

<para>Same as naming scheme <constant>rhel-8.7</constant>.</para>
</varlistentry>

<varlistentry>
<term><constant>rhel-8.9</constant></term>

<para>Same as naming scheme <constant>rhel-8.7</constant>.</para>
</varlistentry>

<varlistentry>
<term><constant>rhel-9.0</constant></term>

Expand Down
10 changes: 10 additions & 0 deletions src/shared/netif-naming-scheme.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 },
Expand Down
12 changes: 12 additions & 0 deletions src/shared/netif-naming-scheme.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 75c343f

Please sign in to comment.