From 2ebe027b448ce729f696e0715456a054ec4a824f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Mon, 17 Jun 2019 09:21:57 +0200 Subject: [PATCH] man: clean up naming scheme description a bit This is in preparation for later changes. Let's change the documentation of net.naming-scheme= to also say that it applies to MAC addresses. This commit doesn't actually implement that though. --- man/systemd.net-naming-scheme.xml | 45 ++++++++++++++++--------------- src/udev/net/naming-scheme.h | 14 +++++----- 2 files changed, 30 insertions(+), 29 deletions(-) diff --git a/man/systemd.net-naming-scheme.xml b/man/systemd.net-naming-scheme.xml index eb8faad254e..69d8ee9b282 100644 --- a/man/systemd.net-naming-scheme.xml +++ b/man/systemd.net-naming-scheme.xml @@ -22,29 +22,30 @@ Description - Network interfaces may be renamed to give them predictable names when there's enough information to - generate appropriate names and the use of certain types of names is configured. This page describes the - first part, i.e. what possible names may be generated. Those names are generated by the + Network interfaces names and MAC addresses may be generated based on certain stable interface + attributes. This is possible when there is enough information about the device to generate those + attributes and the use of this information is configured. This page describes interface naming, i.e. what + possible names may be generated. Those names are generated by the systemd-udevd.service8 builtin net_id and exported as udev properties (ID_NET_NAME_ONBOARD=, ID_NET_LABEL_ONBOARD=, ID_NET_NAME_PATH=, ID_NET_NAME_SLOT=). - Names are derived from various device metadata attributes. Newer versions of udev take more of - these attributes into account, improving (and thus possibly changing) the names used for the same - devices. Differents version of the naming rules are called "naming schemes". The default naming scheme is - chosen at compilation time. Usually this will be the latest implemented version, but it is also possible - to set one of the older versions to preserve compatibility. This may be useful for example for - distributions, which may introduce new versions of systemd in stable releases without changing the naming - scheme. The naming scheme may also be overriden using the net.naming-scheme= kernel - command line switch, see + Names and MAC addresses are derived from various stable device metadata attributes. Newer versions + of udev take more of these attributes into account, improving (and thus possibly changing) the names and + addresses used for the same devices. Different versions of those generation rules are called "naming + schemes". The default naming scheme is chosen at compilation time. Usually this will be the latest + implemented version, but it is also possible to set one of the older versions to preserve + compatibility. This may be useful for example for distributions, which may introduce new versions of + systemd in stable releases without changing the naming scheme. The naming scheme may also be overriden + using the net.naming-scheme= kernel command line switch, see systemd-udevd.service8. Available naming schemes are described below. After the udev proprties have been generated, appropriate udev rules may be used to actually rename - devices based on those properties. See the description of NamePolicy= in - systemd.link5. - + devices based on those properties. See the description of NamePolicy= and + MACAddressPolicy= in + systemd.link5. @@ -288,7 +289,7 @@ v240 - The ib prefix and stable names for infiniband devices are + The ib prefix and stable names for infiniband devices are introduced. Previously those devices were not renamed. The ACPI index field (used in ID_NET_NAME_ONBOARD=) is now also used when @@ -301,22 +302,22 @@ configuration, even if they have been renamed already, if keep is not specified as the naming policy in the .link file. See systemd.link5 - for a description of NamePolicy=. + for a description of NamePolicy=. v243 - Support for netdevsim (simulated networking devices) was added. Previously those devices were - not renamed. + Support for renaming netdevsim (simulated networking) devices was added. Previously + those devices were not renamed. Previously two-letter interface type prefix was prepended to - ID_NET_LABEL_ONBOARD=. This is not done anymore. + ID_NET_LABEL_ONBOARD=. This is not done anymore. - - Note that latest may be used to denote the latest scheme known (to this - particular version of systemd. + + Note that latest may be used to denote the latest scheme known (to this + particular version of systemd. diff --git a/src/udev/net/naming-scheme.h b/src/udev/net/naming-scheme.h index 4061eec99e7..584fea876c2 100644 --- a/src/udev/net/naming-scheme.h +++ b/src/udev/net/naming-scheme.h @@ -22,13 +22,13 @@ * OS versions, but not fully stabilize them. */ typedef enum NamingSchemeFlags { /* First, the individual features */ - NAMING_SR_IOV_V = 1 << 0, /* Use "v" suffix for SR-IOV, see 609948c7043a40008b8299529c978ed8e11de8f6*/ - NAMING_NPAR_ARI = 1 << 1, /* Use NPAR "ARI", see 6bc04997b6eab35d1cb9fa73889892702c27be09 */ - NAMING_INFINIBAND = 1 << 2, /* Use "ib" prefix for infiniband, see 938d30aa98df887797c9e05074a562ddacdcdf5e */ - NAMING_ZERO_ACPI_INDEX = 1 << 3, /* Use zero acpi_index field, see d81186ef4f6a888a70f20a1e73a812d6acb9e22f */ - NAMING_ALLOW_RERENAMES = 1 << 4, /* Allow re-renaming of devices, see #9006 */ - NAMING_NETDEVSIM = 1 << 5, /* Generate names for netdevsim devices, see eaa9d507d85509c8bf727356e3884ec54b0fc646 */ - NAMING_LABEL_NOPREFIX = 1 << 6, /* Don't prepend ID_NET_LABEL_ONBOARD with interface type prefix */ + NAMING_SR_IOV_V = 1 << 0, /* Use "v" suffix for SR-IOV, see 609948c7043a */ + NAMING_NPAR_ARI = 1 << 1, /* Use NPAR "ARI", see 6bc04997b6ea */ + NAMING_INFINIBAND = 1 << 2, /* Use "ib" prefix for infiniband, see 938d30aa98df */ + NAMING_ZERO_ACPI_INDEX = 1 << 3, /* Use zero acpi_index field, see d81186ef4f6a */ + NAMING_ALLOW_RERENAMES = 1 << 4, /* Allow re-renaming of devices, see #9006 */ + NAMING_NETDEVSIM = 1 << 5, /* Generate names for netdevsim devices, see eaa9d507d855 */ + NAMING_LABEL_NOPREFIX = 1 << 6, /* Don't prepend ID_NET_LABEL_ONBOARD with interface type prefix */ /* And now the masks that combine the features above */ NAMING_V238 = 0, -- 2.39.2