diff options
author | Sean Anderson <sean.anderson@seco.com> | 2022-08-09 19:38:26 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2022-08-12 11:15:16 +0200 |
commit | 65c2ad985a8debdf6d7d11fee5b466f280260f4b (patch) | |
tree | 77a832a92d2e15361926f6cc4b7af3ec8be84545 /man/systemd.net-naming-scheme.xml | |
parent | Merge pull request #24280 from mrc0mmand/fix-semaphore (diff) | |
download | systemd-65c2ad985a8debdf6d7d11fee5b466f280260f4b.tar.xz systemd-65c2ad985a8debdf6d7d11fee5b466f280260f4b.zip |
udev: net_id: Use devicetree aliases when available
Devicetree firmware contains an "aliases" node, containing various
aliases for devices described by the firmware. For ethernet devices,
these are named "ethernet0", "ethernet1", etc. They provide a convenient
means of numbering ethernet devices, especially on systems with no other
stable number other than the address. In particular, U-Boot already uses
these aliases to name its ethernet devices.
Previously, there have been attempts (such as [1]) to add support for
these aliases to Linux. However, these patches have been rejected
because it is the maintainers' view that naming policy be left to
userspace. Well, systemd is userspace, so here we are.
In terms of implementation, apparently there can be multiple device
trees at once. I have decided to dodge this problem for now, and just
use /proc/device-tree. If it is desired to support multiple device trees
later, then the scheme can be modified to include the device tree's
index. For example, /sys/firmware/devicetree/base2/aliases/ethernet3
might be named enb2d3.
For the moment we only support "ethernetX" aliases. Future patches might
want to also handle "canX" and "wifiX".
It is common on boards with only one ethernet device to use an alias of
just "ethernet". In this case, the index is an implicit 0. In case the
author of the firmware made a mistake, we check to ensure that aliases
of "ethernet" and "ethernet0" do not both exist.
[1] https://patchwork.kernel.org/project/linux-arm-kernel/patch/1399390594-1409-1-git-send-email-boris.brezillon@free-electrons.com/
Closes: #17625
Diffstat (limited to 'man/systemd.net-naming-scheme.xml')
-rw-r--r-- | man/systemd.net-naming-scheme.xml | 37 |
1 files changed, 35 insertions, 2 deletions
diff --git a/man/systemd.net-naming-scheme.xml b/man/systemd.net-naming-scheme.xml index e5a3d7a313..3d5b3326b1 100644 --- a/man/systemd.net-naming-scheme.xml +++ b/man/systemd.net-naming-scheme.xml @@ -98,10 +98,36 @@ <variablelist> <varlistentry> <term><varname>ID_NET_NAME_ONBOARD=<replaceable>prefix</replaceable><constant>o</constant><replaceable>number</replaceable></varname></term> + <term><varname>ID_NET_NAME_ONBOARD=<replaceable>prefix</replaceable><constant>d</constant><replaceable>number</replaceable></varname></term> <listitem><para>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 <constant>o</constant>, and a number - specified by the firmware. This is only available for PCI devices.</para> + for on-board devices. Different schemes are used depending on the fiemware type, as described in the table below.</para> + + <table> + <title>Onboard naming schemes</title> + + <tgroup cols='2'> + <thead> + <row> + <entry>Format</entry> + <entry>Description</entry> + </row> + </thead> + + <tbody> + <row> + <entry><replaceable>prefix</replaceable><constant>o</constant><replaceable>number</replaceable></entry> + <entry>PCI onboard index</entry> + </row> + + <row> + <entry><replaceable>prefix</replaceable><constant>d</constant><replaceable>number</replaceable></entry> + <entry>Devicetree alias index</entry> + </row> + + </tbody> + </tgroup> + </table> </listitem> </varlistentry> @@ -415,6 +441,13 @@ </listitem> </varlistentry> + <varlistentry> + <term><constant>v252</constant></term> + + <listitem><para>Added naming scheme for platform devices with devicetree aliases.</para> + </listitem> + </varlistentry> + </variablelist> <para>Note that <constant>latest</constant> may be used to denote the latest scheme known (to this |