lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 8 Aug 2022 14:18:59 -0700
From:   Florian Fainelli <f.fainelli@...il.com>
To:     Sean Anderson <sean.anderson@...o.com>,
        Tim Harvey <tharvey@...eworks.com>,
        netdev <netdev@...r.kernel.org>, u-boot <u-boot@...ts.denx.de>,
        Device Tree Mailing List <devicetree@...r.kernel.org>
Subject: Re: ethernet<n> dt aliases implications in U-Boot and Linux

On 8/8/22 12:57, Sean Anderson wrote:
> Hi Tim,
> 
> On 8/8/22 3:18 PM, Tim Harvey wrote:
>> Greetings,
>>
>> I'm trying to understand if there is any implication of 'ethernet<n>'
>> aliases in Linux such as:
>>          aliases {
>>                  ethernet0 = &eqos;
>>                  ethernet1 = &fec;
>>                  ethernet2 = &lan1;
>>                  ethernet3 = &lan2;
>>                  ethernet4 = &lan3;
>>                  ethernet5 = &lan4;
>>                  ethernet6 = &lan5;
>>          };
>>
>> I know U-Boot boards that use device-tree will use these aliases to
>> name the devices in U-Boot such that the device with alias 'ethernet0'
>> becomes eth0 and alias 'ethernet1' becomes eth1 but for Linux it
>> appears that the naming of network devices that are embedded (ie SoC)
>> vs enumerated (ie pci/usb) are always based on device registration
>> order which for static drivers depends on Makefile linking order and
>> has nothing to do with device-tree.
>>
>> Is there currently any way to control network device naming in Linux
>> other than udev?
> 
> You can also use systemd-networkd et al. (but that is the same kind of mechanism)
> 
>> Does Linux use the ethernet<n> aliases for anything at all?
> 
> No :l

It is actually used, but by individual drivers, not by the networking 
stack AFAICT:

git grep -E "of_alias_get_id\((.*), \"(eth|ethernet)\"\)" *
drivers/net/ethernet/broadcom/genet/bcmmii.c:           id = 
of_alias_get_id(dn, "eth");
drivers/net/ethernet/samsung/sxgbe/sxgbe_platform.c:    plat->bus_id = 
of_alias_get_id(np, "ethernet");
drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c:   plat->bus_id = 
of_alias_get_id(np, "ethernet");
drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c:  plat->bus_id = 
of_alias_get_id(np, "ethernet");

There were discussions about using that alias to name ethernet network 
devices in the past (cannot quite point to the thread), the current 
consensus appears to be that if you use the "label" property (which was 
primed by DSA) then your network device will follow that name, still not 
something the networking stack does for you within the guts of 
register_netdev().
-- 
Florian

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ