Re: [PATCH net-next 0/7] Allow controlling PHY loopback and isolate modes

From: Maxime Chevallier
Date: Thu Sep 12 2024 - 04:15:31 EST


On Wed, 11 Sep 2024 23:27:04 +0200
Maxime Chevallier <maxime.chevallier@xxxxxxxxxxx> wrote:

> Hello everyone,
>
> This series brings support for controlling the isolation and loopback
> modes for PHY devices, through a netlink interface.
>
> The isolation support work is made in preparation for the support of
> interfaces that posesses multiple PHYs attached to the same MAC, on the
> same MII bus. In this configuration, the isolation mode for the PHY is
> used to avoid interferences on the MII bus, which doesn't support
> multidrop topologies.
>
> This mode is part of the 802.3 spec, however rarely used. It was
> discovered that some PHYs don't implement that mode correctly, and will
> continue being active on the MII interface when isolated. This series
> supports that case, and flags the LXT973 as having such a broken
> isolation mode. The Marvell 88x3310/3340 PHYs also don't support this
> mdoe, and are also flagged accordingly.
>
> The main part needed for the upcomping multi-PHY support really is the
> internal kernel API to support this.
>
> The second part of the series (patches 5, 6 and 7) focus on allowing
> userspace to control that mode. The only real benefit of controlling this
> from userspace is to make it easier to find out if this mode really
> works or not on the PHY being used.
>
> This relies on a new set of ethtool_phy_ops, set_config and get_config,
> to toggle these modes.
>
> The loopback control from that API is added as it fits the API
> well, and having the ability to easily set the PHY in MII-loopback
> mode is a helpful tool to have when bringing-up a new device and
> troubleshooting the link setup.
>
> The netlink API is an extension of the existing PHY_GET, reporting 2 new
> attributes (one for isolate, one for loopback). A PHY_SET command is
> introduced as well, allowing to configure the loopback and isolation.

One thing I forgot to mention is that the phy-tunable API could also
possibly be a place to set these parameters instead of this new command.

Maybe this would be the preferred way ?

Thanks,

Maxime