mbox series

[net-next,v6,0/8] net: phy: Add support for rate matching

Message ID 20220920221235.1487501-1-sean.anderson@seco.com (mailing list archive)
Headers show
Series net: phy: Add support for rate matching | expand

Message

Sean Anderson Sept. 20, 2022, 10:12 p.m. UTC
This adds support for phy rate matching: when a phy adapts between
differing phy interface and link speeds. It was originally submitted as
part of [1], which is considered "v1" of this series.

Several past discussions [2-4] around adding rate adaptation provide
some context.

Although in earlier versions of this series, userspace could disable
rate matching, now it is only possible to determine the current rate
adaptation type. Disabling or otherwise configuring rate adaptation has
been left for future work. However, because currently only
RATE_MATCH_PAUSE is implemented, it is possible to disable rate
adaptation by modifying the advertisement appropriately.

[1] https://lore.kernel.org/netdev/20220715215954.1449214-1-sean.anderson@seco.com/T/#t
[2] https://lore.kernel.org/netdev/1579701573-6609-1-git-send-email-madalin.bucur@oss.nxp.com/
[3] https://lore.kernel.org/netdev/1580137671-22081-1-git-send-email-madalin.bucur@oss.nxp.com/
[4] https://lore.kernel.org/netdev/20200116181933.32765-1-olteanv@gmail.com/

Changes in v6:
- Don't announce that we've enabled pause frames for rate adaptation
- Merry Christmas
- Rename rate adaptation to rate matching
- Reword documentation, (hopefully) taking into account feedback

Changes in v5:
- Break off patch "net: phy: Add 1000BASE-KX interface mode" for
  separate submission.
- Document phy_rate_adaptation_to_str
- Drop patch "Add some helpers for working with mac caps"; it has been
  incorperated into the autonegotiation patch.
- Move phylink_cap_from_speed_duplex to this commit
- Rebase onto net-next/master
- Remove unnecessary comma

Changes in v4:
- Export phy_rate_adaptation_to_str
- Remove phylink_interface_max_speed, which was accidentally added
- Split off the LS1046ARDB 1G fix

Changes in v3:
- Add phylink_cap_from_speed_duplex to look up the mac capability
  corresponding to the interface's speed.
- Document MAC_(A)SYM_PAUSE
- Include RATE_ADAPT_CRS; it's a few lines and it doesn't hurt.
- Modify link settings directly in phylink_link_up, instead of doing
  things more indirectly via link_*.
- Move unused defines to next commit (where they will be used)
- Remove "Support differing link/interface speed/duplex". It has been
  rendered unnecessary due to simplification of the rate adaptation
  patches. Thanks Russell!
- Rewrite cover letter to better reflect the opinions of the developers
  involved

Changes in v2:
- Add (read-only) ethtool support for rate adaptation
- Add comments clarifying the register defines
- Add locking to phy_get_rate_adaptation
- Always use the rate adaptation setting to determine the interface
  speed/duplex (instead of sometimes using the interface mode).
- Determine the interface speed and max mac speed directly instead of
  guessing based on the caps.
- Move part of commit message to cover letter, as it gives a good
  overview of the whole series, and allows this patch to focus more on
  the specifics.
- Reorder variables in aqr107_read_rate
- Use int/defines instead of enum to allow for use in ioctls/netlink
- Use the phy's rate adaptation setting to determine whether to use its
  link speed/duplex or the MAC's speed/duplex with MLO_AN_INBAND.

Sean Anderson (8):
  net: phylink: Document MAC_(A)SYM_PAUSE
  net: phylink: Export phylink_caps_to_linkmodes
  net: phylink: Generate caps and convert to linkmodes separately
  net: phy: Add support for rate matching
  net: phylink: Adjust link settings based on rate matching
  net: phylink: Adjust advertisement based on rate matching
  net: phy: aquantia: Add some additional phy interfaces
  net: phy: aquantia: Add support for rate matching

 Documentation/networking/ethtool-netlink.rst |   2 +
 drivers/net/phy/aquantia_main.c              |  68 ++++-
 drivers/net/phy/phy-core.c                   |  21 ++
 drivers/net/phy/phy.c                        |  28 ++
 drivers/net/phy/phylink.c                    | 268 +++++++++++++++++--
 include/linux/phy.h                          |  22 +-
 include/linux/phylink.h                      |  40 ++-
 include/uapi/linux/ethtool.h                 |  18 +-
 include/uapi/linux/ethtool_netlink.h         |   1 +
 net/ethtool/ioctl.c                          |   1 +
 net/ethtool/linkmodes.c                      |   5 +
 11 files changed, 440 insertions(+), 34 deletions(-)

Comments

patchwork-bot+netdevbpf@kernel.org Sept. 23, 2022, 11:10 a.m. UTC | #1
Hello:

This series was applied to netdev/net-next.git (master)
by David S. Miller <davem@davemloft.net>:

On Tue, 20 Sep 2022 18:12:27 -0400 you wrote:
> This adds support for phy rate matching: when a phy adapts between
> differing phy interface and link speeds. It was originally submitted as
> part of [1], which is considered "v1" of this series.
> 
> Several past discussions [2-4] around adding rate adaptation provide
> some context.
> 
> [...]

Here is the summary with links:
  - [net-next,v6,1/8] net: phylink: Document MAC_(A)SYM_PAUSE
    https://git.kernel.org/netdev/net-next/c/72bc36956f73
  - [net-next,v6,2/8] net: phylink: Export phylink_caps_to_linkmodes
    https://git.kernel.org/netdev/net-next/c/606116529ab2
  - [net-next,v6,3/8] net: phylink: Generate caps and convert to linkmodes separately
    https://git.kernel.org/netdev/net-next/c/3e6eab8f3ef9
  - [net-next,v6,4/8] net: phy: Add support for rate matching
    https://git.kernel.org/netdev/net-next/c/0c3e10cb4423
  - [net-next,v6,5/8] net: phylink: Adjust link settings based on rate matching
    https://git.kernel.org/netdev/net-next/c/ae0e4bb2a0e0
  - [net-next,v6,6/8] net: phylink: Adjust advertisement based on rate matching
    https://git.kernel.org/netdev/net-next/c/b7e9294885b6
  - [net-next,v6,7/8] net: phy: aquantia: Add some additional phy interfaces
    https://git.kernel.org/netdev/net-next/c/7de26bf144f6
  - [net-next,v6,8/8] net: phy: aquantia: Add support for rate matching
    (no matching commit)

You are awesome, thank you!