[PATCH 1/3] net: give a different name to rtl8169 interfaces

Dragan Simic dsimic at manjaro.org
Fri Jun 28 17:55:51 CEST 2024


Hello,

On 2024-06-28 08:51, Etienne Dublé wrote:
> Le 27/06/2024 à 14:27, Quentin Schulz a écrit :
>> On 6/25/24 1:42 PM, Etienne Dublé wrote:
>> Le 25/06/2024 à 12:25, Dragan Simic a écrit :
>> Another option may be to name them "rtl8169@<hexa>", with "<hexa>"
>> reflecting the PCI region address (so it is unique and stable). What
>> do you think?
>> 
>> I guess that's one way, I'm also wondering how systemd renames those
>> 
>> to be unique but stable on the same machine, maybe we could take
>> some
>> inspiration from them for that?
> 
> Systemd also allows renaming of network interfaces using some rules
> predefined by the user, so there's also the possibility to rename the
> interfaces in U-Boot to ethernet0 and ethernet1, using fixed rules
> that would be based on the PCI region address.
> 
> OK but the renaming occurs in the rtl8169 driver, that is used by
> several boards, whereas the PCI region addresses come from the
> device-tree, so they differ from board to board.
> 
> I'm of the opinion that we only care about stability for the same
> product, not for different products with the same Ethernet PHY on
> different SoCs/products.
> 
> I agree, but my comment was more about how u-boot code is structured
> (network interface naming is done in the driver, and the driver code
> should probably not include board-specific code, so we are quite
> limited).
> In theory we could just name the interfaces ethernet0, ethernet1,
> etc., by using the PCI region address as the sort key, and maybe this
> is what Dragan was suggesting. But in practice when driver->bind() is
> called we don't know if more interfaces will be discovered next; and
> renaming the 1st interface when the 2nd one is discovered with a lower
> address is probably not the kind of code u-boot code experts would
> like...

Good point, we don't know how many Ethernet interfaces will be there
in total.  I'll see to go through the source code, to see what options
are available for stable interface naming.


More information about the U-Boot mailing list