mbox series

[net-next,00/13] net: add negotiation of in-band capabilities

Message ID Z08kCwxdkU4n2V6x@shell.armlinux.org.uk (mailing list archive)
Headers show
Series net: add negotiation of in-band capabilities | expand

Message

Russell King (Oracle) Dec. 3, 2024, 3:30 p.m. UTC
Hi,

This is a repost without RFC for this series, shrunk down to 13 patches
by removing the non-Marvell PCS.

Phylink's handling of in-band has been deficient for a long time, and
people keep hitting problems with it. Notably, situations with the way-
to-late standardized 2500Base-X and whether that should or should not
have in-band enabled. We have also been carrying a hack in the form of
phylink_phy_no_inband() for a PHY that has been used on a SFP module,
but has no in-band capabilities, not even for SGMII.

When phylink is trying to operate in in-band mode, this series will look
at the capabilities of the MAC-side PCS and PHY, and work out whether
in-band can or should be used, programming the PHY as appropriate. This
includes in-band bypass mode at the PHY.

We don't... yet... support bypass on the MAC side PCS, because that
requires yet more complexity.

Patch 1 passes struct phylink and struct phylink_pcs into
phylink_pcs_neg_mode() so we can look at more state in this function in
a future patch.

Patch 2 splits "cur_link_an_mode" (the MLO_AN_* mode) into two separate
purposes - a requested and an active mode. The active mode is the one
we will be using for the MAC, which becomes dependent on the result of
in-band negotiation.

Patch 3 adds debug to phylink_major_config() so we can see what is going
on with the requested and active AN modes.

Patch 4 adds to phylib a method to get the in-band capabilities of the
PHY from phylib. Patches 5 and 6 add implementations for BCM84881 and
some Marvell PHYs found on SFPs.

Patch 7 adds to phylib a method to configure the PHY in-band signalling,
and patch 8 implements it for those Marvell PHYs that support the method
in patch 4.

Patch 9 does the same as patch 4 but for the MAC-side PCS, with patches
10 and 11 adding support to Marvell NETA and PP2.

Patch 12 adds the code to phylink_pcs_neg_mode() which looks at the
capabilities, and works out whether to use in-band or out-band mode for
driving the link between the MAC PCS and PHY.

Patch 13 removes the phylink_phy_no_inband() hack now that we are
publishing the in-band capabilities from the BCM84881 PHY driver.

Three more PCS, omitted from this series due to the limit of 15 patches,
will be sent once this has been merged.

 drivers/net/ethernet/marvell/mvneta.c           |  27 +-
 drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c |  25 +-
 drivers/net/phy/bcm84881.c                      |  10 +
 drivers/net/phy/marvell.c                       |  48 ++++
 drivers/net/phy/phy.c                           |  53 ++++
 drivers/net/phy/phylink.c                       | 352 +++++++++++++++++++-----
 include/linux/phy.h                             |  34 +++
 include/linux/phylink.h                         |  17 ++
 8 files changed, 474 insertions(+), 92 deletions(-)

Comments

patchwork-bot+netdevbpf@kernel.org Dec. 5, 2024, 3:30 a.m. UTC | #1
Hello:

This series was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Tue, 3 Dec 2024 15:30:19 +0000 you wrote:
> Hi,
> 
> This is a repost without RFC for this series, shrunk down to 13 patches
> by removing the non-Marvell PCS.
> 
> Phylink's handling of in-band has been deficient for a long time, and
> people keep hitting problems with it. Notably, situations with the way-
> to-late standardized 2500Base-X and whether that should or should not
> have in-band enabled. We have also been carrying a hack in the form of
> phylink_phy_no_inband() for a PHY that has been used on a SFP module,
> but has no in-band capabilities, not even for SGMII.
> 
> [...]

Here is the summary with links:
  - [net-next,01/13] net: phylink: pass phylink and pcs into phylink_pcs_neg_mode()
    https://git.kernel.org/netdev/net-next/c/17ed1911f9c8
  - [net-next,02/13] net: phylink: split cur_link_an_mode into requested and active
    https://git.kernel.org/netdev/net-next/c/1f92ead7e150
  - [net-next,03/13] net: phylink: add debug for phylink_major_config()
    https://git.kernel.org/netdev/net-next/c/4e7d000286fe
  - [net-next,04/13] net: phy: add phy_inband_caps()
    https://git.kernel.org/netdev/net-next/c/b4c7698dd95f
  - [net-next,05/13] net: phy: bcm84881: implement phy_inband_caps() method
    https://git.kernel.org/netdev/net-next/c/c64c7fa0a774
  - [net-next,06/13] net: phy: marvell: implement phy_inband_caps() method
    https://git.kernel.org/netdev/net-next/c/1c86828dff88
  - [net-next,07/13] net: phy: add phy_config_inband()
    https://git.kernel.org/netdev/net-next/c/5d58a890c027
  - [net-next,08/13] net: phy: marvell: implement config_inband() method
    https://git.kernel.org/netdev/net-next/c/a219912e0fec
  - [net-next,09/13] net: phylink: add pcs_inband_caps() method
    https://git.kernel.org/netdev/net-next/c/df874f9e52c3
  - [net-next,10/13] net: mvneta: implement pcs_inband_caps() method
    https://git.kernel.org/netdev/net-next/c/513e8fb8fa32
  - [net-next,11/13] net: mvpp2: implement pcs_inband_caps() method
    https://git.kernel.org/netdev/net-next/c/d4169f0c7665
  - [net-next,12/13] net: phylink: add negotiation of in-band capabilities
    https://git.kernel.org/netdev/net-next/c/5fd0f1a02e75
  - [net-next,13/13] net: phylink: remove phylink_phy_no_inband()
    https://git.kernel.org/netdev/net-next/c/77ac9a8b2536

You are awesome, thank you!