Re: [RFC net-next] net: dsa: generate port ifname if exists or invalid

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Jun 15, 2024 at 03:33:30PM +0100, Daniel Golle wrote:
> Sounds fine generally. Where would you store the device-specific renaming
> rules while making sure you don't need to carry the rules for all devices
> onto every single device? Would you generate a device-specific rootfs for
> each and every device? For obvious reasons this is something we'd very
> much like to avoid, as building individual filesystems for ~ 1000 devices
> would be insane compared to having a bunch (< 100) of generic filesystems
> which some of them fitting a large group (ie. same SoC) of boards.
> Most OpenWrt devices out there are based on the same SoCs, so currently
> the devices in the popular targets like MT7621 or IPQ40xx all share the
> same target-wide kernel **and rootfs**.
> 
> tl;dr: The good thing about the 'label' property is certainly that such
> board- specific details are kept in DT, and hence a generic rootfs can
> deal with it.
> 
> As having the 'label' property applied also for non-DSA netdevs by the
> kernel has been rejected we did come up with a simple userland
> implementation:
> 
> https://git.openwrt.org/?p=openwrt/openwrt.git;a=commit;h=2a25c6ace8d833cf491a66846a0b9e7c5387b8f0
> 
> For interfaces added at a later stage at boot, ie. by loading kernel modules
> or actual hotplug, we could do the same in a hotplug script.
> 
> So yes, dropping support for dealing with the 'label' property in kernel
> entirely would also fix it for us, because then we would just always deal
> with it in userland (still using the same property in DT, just not applied
> by the kernel).

2 thoughts come to my mind.

First there is the focus on the user, which in the case of OpenWrt is
the home user. What does he want? We are debating where to put a fixed
Ethernet interface name, but does the user want it to be fixed?
Like, if I were looking in my system log, I would certainly prefer if I
saw 'Network device 'printer'/'nas'/'pc' link is up' rather than 'eth1',
even if it says 'eth1' on the chassis.

With that in mind, I would say it would be preferable to ship
architecture-wide udev naming rules, which essentially give each
netdev a predictable name according to its SoC position. Then give
the user the possibility to use that udev rule file as a _framework_
and name the interfaces as he wishes. The OpenWrt wiki for a board can
list a diagram with the correlations between SoC interface names and
chassis labels, in case the user desires to preserve that (the board
will be used on a bench and the labels will always be visible, rather
than being more easily recognizable by their role).

Then there is the fact that we are dealing with low-cost boards with
low-cost/low-effort design. Ilya Lipnitskiy brought forward a case where
the chassis had labeled the ports 'eth0', 'eth1', 'eth2', ..., which is
clearly a design problem since it conflicts with the way in which the
kernel naturally wants to name the devices ('eth0' is the initial name
for the DSA master, but also the chassis label for a DSA user port...
yay...).

I don't honestly think you can/should fix low-effort design.

But, if you insist that putting fixed netdev names in the device tree is
the best option, I suppose that could be considered a low-effort
solution which belongs to the same general theme.

But I don't see why not go low-cost all the way. Since 'label creates
(avoidable) conflicts with DSA, why don't you just name all of them
'openwrt,netdev-name' or something, and proudly own that low-cost
solution as a downstream scheme which needs no kernel support
whatsoever (you parse it from the init scripts as you already do)?
U-Boot also is another example of a project which uses additional device
tree properties for its own purpose.




[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux