[PATCH 1/3] net: give a different name to rtl8169 interfaces
Etienne Dublé
etienne.duble at imag.fr
Fri Jun 28 08:51:01 CEST 2024
Hi Quentin,
Le 27/06/2024 à 14:27, Quentin Schulz a écrit :
> Hi Etienne,
>
> On 6/25/24 1:42 PM, Etienne Dublé wrote:
>>
>> Hello,
>>
>> 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...
Cheers,
Etienne Dublé
--
Etienne Dublé
CNRS / LIG - Bâtiment IMAG
700 avenue Centrale - 38401 St Martin d'Hères
Bureau 426 - Tel 0457421431
More information about the U-Boot
mailing list