linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next v5 00/13] net: phy: Rework linkmodes handling in a dedicated file
@ 2025-03-07 17:35 Maxime Chevallier
  2025-03-07 17:35 ` [PATCH net-next v5 01/13] net: ethtool: Export the link_mode_params definitions Maxime Chevallier
                   ` (14 more replies)
  0 siblings, 15 replies; 40+ messages in thread
From: Maxime Chevallier @ 2025-03-07 17:35 UTC (permalink / raw)
  To: davem, Andrew Lunn, Jakub Kicinski, Eric Dumazet, Paolo Abeni,
	Russell King, Heiner Kallweit
  Cc: Maxime Chevallier, netdev, linux-kernel, thomas.petazzoni,
	linux-arm-kernel, Christophe Leroy, Herve Codina,
	Florian Fainelli, Vladimir Oltean, Köry Maincent,
	Oleksij Rempel, Simon Horman, Romain Gantois

Hello everyone,

This is V5 of the phy_caps series. In a nutshell, this series reworks the way
we maintain the list of speed/duplex capablities for each linkmode so that we
no longer have multiple definition of these associations.

That will help making sure that when people add new linkmodes in
include/uapi/linux/ethtool.h, they don't have to update phylib and phylink as
well, making the process more straightforward and less error-prone.

It also generalises the phy_caps interface to be able to lookup linkmodes
from phy_interface_t, which is needed for the multi-port work I've been working
on for a while.

This V5 addresse Russell's and Paolo's reviews, namely :

 - Error out when encountering an unknown SPEED_XXX setting

   It prints an error and fails to initialize phylib. I've tested by
   introducing a dummy 1.6T speed, I guess it's only a matter of time
   before that actually happens :)

 - Deal more gracefully with the fixed-link settings, keeping some level of
   compatibility with what we had before by making sure we report a
   single BaseT mode like before.

V1 : https://lore.kernel.org/netdev/20250222142727.894124-1-maxime.chevallier@bootlin.com/
V2 : https://lore.kernel.org/netdev/20250226100929.1646454-1-maxime.chevallier@bootlin.com/
V3 : https://lore.kernel.org/netdev/20250228145540.2209551-1-maxime.chevallier@bootlin.com/
V4 : https://lore.kernel.org/netdev/20250303090321.805785-1-maxime.chevallier@bootlin.com/

Maxime Chevallier (13):
  net: ethtool: Export the link_mode_params definitions
  net: phy: Use an internal, searchable storage for the linkmodes
  net: phy: phy_caps: Move phy_speeds to phy_caps
  net: phy: phy_caps: Move __set_linkmode_max_speed to phy_caps
  net: phy: phy_caps: Introduce phy_caps_valid
  net: phy: phy_caps: Implement link_capabilities lookup by linkmode
  net: phy: phy_caps: Allow looking-up link caps based on speed and
    duplex
  net: phy: phy_device: Use link_capabilities lookup for PHY aneg config
  net: phylink: Use phy_caps_lookup for fixed-link configuration
  net: phy: drop phy_settings and the associated lookup helpers
  net: phylink: Add a mapping between MAC_CAPS and LINK_CAPS
  net: phylink: Convert capabilities to linkmodes using phy_caps
  net: phylink: Use phy_caps to get an interface's capabilities and
    modes

 drivers/net/phy/Makefile     |   2 +-
 drivers/net/phy/phy-caps.h   |  63 ++++++
 drivers/net/phy/phy-core.c   | 253 ++----------------------
 drivers/net/phy/phy.c        |  37 +---
 drivers/net/phy/phy_caps.c   | 359 +++++++++++++++++++++++++++++++++++
 drivers/net/phy/phy_device.c |  16 +-
 drivers/net/phy/phylink.c    | 355 ++++++++++------------------------
 include/linux/ethtool.h      |   8 +
 include/linux/phy.h          |  15 --
 net/ethtool/common.c         |   1 +
 net/ethtool/common.h         |   7 -
 11 files changed, 571 insertions(+), 545 deletions(-)
 create mode 100644 drivers/net/phy/phy-caps.h
 create mode 100644 drivers/net/phy/phy_caps.c

-- 
2.48.1


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

end of thread, other threads:[~2025-06-03  8:25 UTC | newest]

Thread overview: 40+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-07 17:35 [PATCH net-next v5 00/13] net: phy: Rework linkmodes handling in a dedicated file Maxime Chevallier
2025-03-07 17:35 ` [PATCH net-next v5 01/13] net: ethtool: Export the link_mode_params definitions Maxime Chevallier
2025-03-07 17:35 ` [PATCH net-next v5 02/13] net: phy: Use an internal, searchable storage for the linkmodes Maxime Chevallier
2025-03-07 17:36 ` [PATCH net-next v5 03/13] net: phy: phy_caps: Move phy_speeds to phy_caps Maxime Chevallier
2025-03-07 17:36 ` [PATCH net-next v5 04/13] net: phy: phy_caps: Move __set_linkmode_max_speed " Maxime Chevallier
2025-03-07 17:36 ` [PATCH net-next v5 05/13] net: phy: phy_caps: Introduce phy_caps_valid Maxime Chevallier
2025-03-07 17:36 ` [PATCH net-next v5 06/13] net: phy: phy_caps: Implement link_capabilities lookup by linkmode Maxime Chevallier
2025-03-07 17:36 ` [PATCH net-next v5 07/13] net: phy: phy_caps: Allow looking-up link caps based on speed and duplex Maxime Chevallier
2025-05-29  9:36   ` Jijie Shao
2025-05-29  9:40     ` Russell King (Oracle)
2025-05-30  7:56     ` Maxime Chevallier
2025-06-03  8:25     ` Maxime Chevallier
2025-03-07 17:36 ` [PATCH net-next v5 08/13] net: phy: phy_device: Use link_capabilities lookup for PHY aneg config Maxime Chevallier
2025-03-07 17:36 ` [PATCH net-next v5 09/13] net: phylink: Use phy_caps_lookup for fixed-link configuration Maxime Chevallier
2025-03-28  1:16   ` Alexander H Duyck
2025-03-28  8:06     ` Maxime Chevallier
2025-03-28 21:03       ` Alexander Duyck
2025-03-28 21:45         ` Andrew Lunn
2025-03-28 23:26           ` Alexander Duyck
2025-03-31  7:35             ` Maxime Chevallier
2025-03-31 14:17             ` Andrew Lunn
2025-03-31 14:54               ` Russell King (Oracle)
2025-03-31 16:20                 ` Maxime Chevallier
2025-03-31 16:38                   ` Alexander Duyck
2025-04-01  7:41                     ` Maxime Chevallier
2025-03-31 22:31                   ` Alexander H Duyck
2025-04-01  8:33                     ` Maxime Chevallier
2025-03-31  7:14         ` Maxime Chevallier
2025-04-01 15:28           ` Alexander H Duyck
2025-04-01 15:40             ` Maxime Chevallier
2025-04-01 16:14             ` Russell King (Oracle)
2025-04-02  6:47               ` Maxime Chevallier
2025-03-31 12:50     ` Russell King (Oracle)
2025-03-31 22:19       ` Alexander Duyck
2025-03-07 17:36 ` [PATCH net-next v5 10/13] net: phy: drop phy_settings and the associated lookup helpers Maxime Chevallier
2025-03-07 17:36 ` [PATCH net-next v5 11/13] net: phylink: Add a mapping between MAC_CAPS and LINK_CAPS Maxime Chevallier
2025-03-07 17:36 ` [PATCH net-next v5 12/13] net: phylink: Convert capabilities to linkmodes using phy_caps Maxime Chevallier
2025-03-07 17:36 ` [PATCH net-next v5 13/13] net: phylink: Use phy_caps to get an interface's capabilities and modes Maxime Chevallier
2025-03-13  9:13 ` [PATCH net-next v5 00/13] net: phy: Rework linkmodes handling in a dedicated file Paolo Abeni
2025-03-18  8:10 ` patchwork-bot+netdevbpf

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).