Skip to content

net: phy: Rework linkmodes handling in a dedicated file

Maxime Chevallier linux-arm-kernel lkml netdev 5 versions – Applied

Status from this message: This series was applied to netdev/net-next.git (main)

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v5 Latest13 patches 25 repliesApplied 13/13
  2. v413 patches 9 repliesSuperseded
  3. v313 patches 6 repliesSuperseded
Earlier versions · 2
VersionPostedPatchesRepliesStatus
v213 patches4 repliesSuperseded
v113 patches8 repliesSuperseded

Patches in v5 All 13 applied

#Subject and filesSizeRepliesApplied
1/13net: ethtool: Export the link_mode_params definitionsinclude/linux/ethtool.h net/ethtool/common.c net/ethtool/common.h+9 -70 repliesApplied
2/13net: phy: Use an internal, searchable storage for the linkmodesdrivers/net/phy/Makefile drivers/net/phy/phy-caps.h drivers/net/phy/phy_caps.c +1 more+139 -10 repliesApplied
3/13net: phy: phy_caps: Move phy_speeds to phy_capsdrivers/net/phy/phy-caps.h drivers/net/phy/phy-core.c drivers/net/phy/phy.c +2 more+38 -180 repliesApplied
4/13net: phy: phy_caps: Move __set_linkmode_max_speed to phy_capsdrivers/net/phy/phy-caps.h drivers/net/phy/phy-core.c drivers/net/phy/phy_caps.c+24 -150 repliesApplied
5/13net: phy: phy_caps: Introduce phy_caps_validdrivers/net/phy/phy-caps.h drivers/net/phy/phy.c drivers/net/phy/phy_caps.c+21 -10 repliesApplied
6/13net: phy: phy_caps: Implement link_capabilities lookup by linkmodedrivers/net/phy/phy-caps.h drivers/net/phy/phy-core.c drivers/net/phy/phy_caps.c+65 -210 repliesApplied
7/13net: phy: phy_caps: Allow looking-up link caps based on speed and duplexdrivers/net/phy/phy-caps.h drivers/net/phy/phy.c drivers/net/phy/phy_caps.c +1 more+67 -334 repliesApplied
8/13net: phy: phy_device: Use link_capabilities lookup for PHY aneg configdrivers/net/phy/phy_device.c+6 -50 repliesApplied
9/13net: phylink: Use phy_caps_lookup for fixed-link configurationdrivers/net/phy/phylink.c+31 -1320 repliesApplied
10/13net: phy: drop phy_settings and the associated lookup helpersdrivers/net/phy/phy-core.c include/linux/phy.h+0 -1970 repliesApplied
11/13net: phylink: Add a mapping between MAC_CAPS and LINK_CAPSdrivers/net/phy/phylink.c+25 -240 repliesApplied
12/13net: phylink: Convert capabilities to linkmodes using phy_capsdrivers/net/phy/phy-caps.h drivers/net/phy/phy_caps.c drivers/net/phy/phylink.c+36 -1340 repliesApplied
13/13net: phylink: Use phy_caps to get an interface's capabilities and modesdrivers/net/phy/phy-caps.h drivers/net/phy/phy_caps.c drivers/net/phy/phylink.c+110 -760 repliesApplied

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v5 yet.

Read the v5 thread

Cover letter [PATCH net-next v5 00/13] net: phy: Rework linkmodes handling in a dedicated file

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/[email protected]/
V2 : https://lore.kernel.org/netdev/[email protected]/
V3 : https://lore.kernel.org/netdev/[email protected]/
V4 : https://lore.kernel.org/netdev/[email protected]/

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
Signature · 1 line
2.48.1