From e232c307c052c85825e5017be868e1bd6bf4f97a Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Tue, 7 Jan 2020 18:01:56 +0100 Subject: [PATCH 1/3] man: slightly extend documentation on difference between ID_NET_NAME_ONBOARD and ID_NET_LABEL_ONBOARD --- man/systemd.net-naming-scheme.xml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/man/systemd.net-naming-scheme.xml b/man/systemd.net-naming-scheme.xml index 126be320f6..dc2ec92157 100644 --- a/man/systemd.net-naming-scheme.xml +++ b/man/systemd.net-naming-scheme.xml @@ -99,8 +99,8 @@ ID_NET_NAME_ONBOARD=prefixonumber - This name is set based on the ordering information given by the firmware for - on-board devices. The name consists of the prefix, letter o, and a number + This name is set based on the numeric ordering information given by the firmware + for on-board devices. The name consists of the prefix, letter o, and a number specified by the firmware. This is only available for PCI devices. @@ -108,8 +108,9 @@ ID_NET_LABEL_ONBOARD=prefix label - This property is set based on label given by the firmware for on-board devices. The - name consists of the prefix concatenated with the label. This is only available for PCI devices. + This property is set based on textual label given by the firmware for on-board + devices. The name consists of the prefix concatenated with the label. This is only available for + PCI devices. From a1686563ded4cb6967034a59a61a50534c952dad Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Tue, 7 Jan 2020 18:02:15 +0100 Subject: [PATCH 2/3] man: fix documentation of IBM VIO device naming We generate "v" in two different ways, and they got mixed up. --- man/systemd.net-naming-scheme.xml | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/man/systemd.net-naming-scheme.xml b/man/systemd.net-naming-scheme.xml index dc2ec92157..70b4b27d7b 100644 --- a/man/systemd.net-naming-scheme.xml +++ b/man/systemd.net-naming-scheme.xml @@ -127,15 +127,15 @@ ID_NET_NAME_SLOT=prefix[Pdomain]sslot[ffunction][nport_name|ddev_port] + ID_NET_NAME_SLOT=prefixvslot ID_NET_NAME_SLOT=prefix[Pdomain]sslot[ffunction][nport_name|ddev_port]bnumber ID_NET_NAME_SLOT=prefix[Pdomain]sslot[ffunction][nport_name|ddev_port]uport…[cconfig][iinterface] ID_NET_NAME_SLOT=prefix[Pdomain]sslot[ffunction][nport_name|ddev_port]vslot This property describes the slot position. Different schemes are used depending on - the bus type, as described in the table below. In all cases, PCI slot information must be known. In - case of USB, BCMA, and SR-VIO devices, the full name consists of the prefix, PCI slot identifier, - and USB or BCMA or SR-VIO slot identifier. The first two parts are denoted as "…" in the table - below. + the bus type, as described in the table below. In case of USB, BCMA, and SR-VIO devices, the full + name consists of the prefix, PCI slot identifier, and USB or BCMA or SR-VIO slot identifier. The + first two parts are denoted as "…" in the table below. Slot naming schemes @@ -154,6 +154,11 @@ PCI slot number + + prefix vslot + VIO slot number (IBM PowerVM) + + … bnumber Broadcom bus (BCMA) core number @@ -183,11 +188,11 @@ For USB devices the full chain of port numbers of hubs is composed. If the name gets longer than the maximum number of 15 characters, the name is not exported. The usual USB configuration number 1 and interface number 0 values are suppressed. - SR-IOV virtual devices are named based on the name of the parent interface, with a suffix of v and the virtual device number, with any leading zeros removed. The bus - number is ignored. This device type is found in IBM PowerVMs. + number is ignored. + From 3ce252d0e0ccc4b21ea34baa83febb856d96f30c Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Tue, 7 Jan 2020 18:02:53 +0100 Subject: [PATCH 3/3] udev: use dot_or_dot_dot() where appropriate --- src/udev/udev-builtin-net_id.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/udev/udev-builtin-net_id.c b/src/udev/udev-builtin-net_id.c index e94fff2520..169d6ce8f7 100644 --- a/src/udev/udev-builtin-net_id.c +++ b/src/udev/udev-builtin-net_id.c @@ -330,8 +330,9 @@ static int dev_pci_slot(sd_device *dev, struct netnames *names) { char str[PATH_MAX]; _cleanup_free_ char *address = NULL; - if (dent->d_name[0] == '.') + if (dot_or_dot_dot(dent->d_name)) continue; + r = safe_atou_full(dent->d_name, 10, &i); if (r < 0 || i <= 0) continue;