netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next 0/7] Allow controlling PHY loopback and isolate modes
@ 2024-09-11 21:27 Maxime Chevallier
  2024-09-11 21:27 ` [PATCH net-next 1/7] net: phy: allow isolating PHY devices Maxime Chevallier
                   ` (8 more replies)
  0 siblings, 9 replies; 20+ messages in thread
From: Maxime Chevallier @ 2024-09-11 21:27 UTC (permalink / raw)
  To: davem
  Cc: Maxime Chevallier, netdev, linux-kernel, thomas.petazzoni,
	Andrew Lunn, Jakub Kicinski, Eric Dumazet, Paolo Abeni,
	Russell King, linux-arm-kernel, Christophe Leroy, Herve Codina,
	Florian Fainelli, Heiner Kallweit, Vladimir Oltean,
	Marek Behún, Köry Maincent, Oleksij Rempel

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.

All in all, the userspace part is a bonus here, let me know if you think
is just doesn't make sense, although the loopback feature can be useful
and sent as a standalone series. In such case, I'll include the kernel-only
support for isolation (so, patches 1 to 5) as part of the multi-PHY
support series when it comes out.

Thanks,

Maxime

Maxime Chevallier (7):
  net: phy: allow isolating PHY devices
  net: phy: Allow flagging PHY devices that can't isolate their MII
  net: phy: lxt: Mark LXT973 PHYs as having a broken isolate mode
  net: phy: marvell10g: 88x3310 and 88x3340 don't support isolate mode
  net: phy: introduce ethtool_phy_ops to get and set phy configuration
  net: ethtool: phy: allow reporting and setting the phy isolate status
  netlink: specs: introduce phy-set command along with configurable
    attributes

 Documentation/netlink/specs/ethtool.yaml     | 20 +++++
 Documentation/networking/ethtool-netlink.rst |  2 +
 drivers/net/phy/lxt.c                        |  2 +
 drivers/net/phy/marvell10g.c                 |  2 +
 drivers/net/phy/phy.c                        | 59 +++++++++++++
 drivers/net/phy/phy_device.c                 | 89 ++++++++++++++++++--
 include/linux/ethtool.h                      |  8 ++
 include/linux/phy.h                          | 26 ++++++
 include/uapi/linux/ethtool_netlink.h         |  3 +
 net/ethtool/netlink.c                        |  8 ++
 net/ethtool/netlink.h                        |  1 +
 net/ethtool/phy.c                            | 75 +++++++++++++++++
 12 files changed, 289 insertions(+), 6 deletions(-)

-- 
2.46.0


^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2024-09-13 13:40 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-11 21:27 [PATCH net-next 0/7] Allow controlling PHY loopback and isolate modes Maxime Chevallier
2024-09-11 21:27 ` [PATCH net-next 1/7] net: phy: allow isolating PHY devices Maxime Chevallier
2024-09-12 18:30   ` Florian Fainelli
2024-09-13  7:43     ` Maxime Chevallier
2024-09-11 21:27 ` [PATCH net-next 2/7] net: phy: Allow flagging PHY devices that can't isolate their MII Maxime Chevallier
2024-09-11 21:27 ` [PATCH net-next 3/7] net: phy: lxt: Mark LXT973 PHYs as having a broken isolate mode Maxime Chevallier
2024-09-12 12:24   ` Simon Horman
2024-09-12 12:56     ` Maxime Chevallier
2024-09-13  5:29   ` kernel test robot
2024-09-11 21:27 ` [PATCH net-next 4/7] net: phy: marvell10g: 88x3310 and 88x3340 don't support " Maxime Chevallier
2024-09-11 21:27 ` [PATCH net-next 5/7] net: phy: introduce ethtool_phy_ops to get and set phy configuration Maxime Chevallier
2024-09-12  4:46   ` Oleksij Rempel
2024-09-12  8:17     ` Maxime Chevallier
2024-09-11 21:27 ` [PATCH net-next 6/7] net: ethtool: phy: allow reporting and setting the phy isolate status Maxime Chevallier
2024-09-11 21:27 ` [PATCH net-next 7/7] netlink: specs: introduce phy-set command along with configurable attributes Maxime Chevallier
2024-09-12  8:15 ` [PATCH net-next 0/7] Allow controlling PHY loopback and isolate modes Maxime Chevallier
2024-09-12 18:21 ` Andrew Lunn
2024-09-12 18:26   ` Florian Fainelli
2024-09-13  7:34     ` Maxime Chevallier
2024-09-13 13:40       ` Andrew Lunn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).