Re: [PATCH net-next v5 07/13] net: ethtool: Introduce a command to list PHYs on an interface

From: Andrew Lunn
Date: Thu Jan 25 2024 - 12:15:56 EST


> I do face a problem with fixed_phy though now that I've played around
> with it. As fixed_phys share the same global MDIO bus, what can happen
> is that netdevsim-registered PHYs can starve the dummy MDIO bus by
> exhausting all 32 mdio addresses, preventing real interfaces from
> getting their own fixed-phy instance.
>
> I'll probably register a dedicated mdio bus per netdevsim (or even
> per-phy, so that we can imagine controling the returned register
> values), let's see how it goes.

I can see it being a problem, but how theoretical is it?

Anything using phylink does not need a fixed-link device, its just MAC
drivers making use of phylib. Its also only typically used with MACs
connected to switches, and you tend not to have too many of them on a
machine. And lastly, netdevsim is only really used for testing, and i
guess most tests run either on a desktop or server like machine which
does not have switches, probably does not even make use phylib, or the
tests are run in a VM which does not even have any PHYs, fixed or not.

So i'm wondering how much effort should be put into this, or should
the time be spent on other things?

Andrew