mbox series

[net-next,0/9] net: pcs: xpcs: cleanups for clause 73 support

Message ID ZGyR/jDyYTYzRklg@shell.armlinux.org.uk (mailing list archive)
Headers show
Series net: pcs: xpcs: cleanups for clause 73 support | expand

Message

Russell King (Oracle) May 23, 2023, 10:14 a.m. UTC
Hi,

This series cleans up xpcs code, moving much of the clause 73 code
out of the driver into places where others can make use of it.

Specifically, we add a helper to convert a clause 73 advertisement
to ethtool link modes to mdio.h, and a helper to resolve the clause
73 negotiation state to phylink, which includes the pause modes.

In doing this cleanup, several issues were identified with the
original xpcs implementation:

1) it masks the link partner advertisement with its own advertisement
   so userspace can't see what the full link partner advertisement
   was.
2) it was always setting pause modes irrespective of the advertisements
   on either end of the link.
3) it was reading the STAT1 registers multiple times. Reading STAT1
   has the side effect of unlatching the link-down status, so
   multiple reads should be avoided.

This patch series addresses the first two first by addressing the
issues, and then by moving over to the new helpers. The third issue
is solved by restructuring the xpcs code.

Changes since RFC v2: None
v2: add attributations, fix spelling mistake in patch 8, fix build
error in patch 9.
Testing status: build tested only. Request for testing in RFC series
 yet again fell on deaf ears.

 drivers/net/pcs/pcs-xpcs.c | 159 ++++++++++++++++++---------------------------
 drivers/net/pcs/pcs-xpcs.h |   3 -
 drivers/net/phy/phylink.c  |  54 +++++++++++----
 include/linux/mdio.h       |  39 +++++++++++
 include/linux/phylink.h    |   2 +
 include/uapi/linux/mdio.h  |  24 +++++++
 6 files changed, 170 insertions(+), 111 deletions(-)

Comments

patchwork-bot+netdevbpf@kernel.org May 24, 2023, 4:30 p.m. UTC | #1
Hello:

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

On Tue, 23 May 2023 11:14:22 +0100 you wrote:
> Hi,
> 
> This series cleans up xpcs code, moving much of the clause 73 code
> out of the driver into places where others can make use of it.
> 
> Specifically, we add a helper to convert a clause 73 advertisement
> to ethtool link modes to mdio.h, and a helper to resolve the clause
> 73 negotiation state to phylink, which includes the pause modes.
> 
> [...]

Here is the summary with links:
  - [net-next,1/9] net: mdio: add clause 73 to ethtool conversion helper
    https://git.kernel.org/netdev/net-next/c/e9261467ae86
  - [net-next,2/9] net: phylink: remove duplicated linkmode pause resolution
    https://git.kernel.org/netdev/net-next/c/dc7a51411ec5
  - [net-next,3/9] net: phylink: add function to resolve clause 73 negotiation
    https://git.kernel.org/netdev/net-next/c/dad987484eaa
  - [net-next,4/9] net: pcs: xpcs: clean up reading clause 73 link partner advertisement
    https://git.kernel.org/netdev/net-next/c/6f7b89b45f1e
  - [net-next,5/9] net: pcs: xpcs: use mii_c73_to_linkmode() helper
    https://git.kernel.org/netdev/net-next/c/3f0360e09c8d
  - [net-next,6/9] net: pcs: xpcs: correct lp_advertising contents
    https://git.kernel.org/netdev/net-next/c/1f94ba198bda
  - [net-next,7/9] net: pcs: xpcs: correct pause resolution
    https://git.kernel.org/netdev/net-next/c/428d603fcaeb
  - [net-next,8/9] net: pcs: xpcs: use phylink_resolve_c73() helper
    https://git.kernel.org/netdev/net-next/c/21234ef16665
  - [net-next,9/9] net: pcs: xpcs: avoid reading STAT1 more than once
    https://git.kernel.org/netdev/net-next/c/883a98ede4b6

You are awesome, thank you!