mbox series

[ethtool-next,v2,0/3] Introduce PHY listing and targeting

Message ID 20240828152511.194453-1-maxime.chevallier@bootlin.com (mailing list archive)
Headers show
Series Introduce PHY listing and targeting | expand

Message

Maxime Chevallier Aug. 28, 2024, 3:25 p.m. UTC
Hello,

This series adds the ethtool-side support to list PHYs associated to a
netdevice, as well as allowing to target PHYs for some commands :
 - PSE-PD commands
 - Cable testing commands
 - PLCA commands

This V2 uses the uAPI that got applied on the associated kernel-side
series [1], cleans a few lose-ends from the first version, and adds the
manpage modifications that was missing from V1.

The PHY-targetting commands look like this:

ethtool --phy 1 --cable-test eth0

Note that the --phy parameter gets passed at the beginning of the
command-line. This allows getting a generic command-line parsing code,
easy to write, but at the expense of maybe being a bit counter intuitive.

Another option could be to add a "phy" parameter to all the supported
commands, let me know if you think this looks too bad.

Patch 1 deals with the ability to pass a PHY index to the relevant
commands.

Patch 2 implements the --show-phys command. This command uses a netlink
DUMP request to list the PHYs, and introduces the ability to perform
filtered DUMP request, where the netdev index gets passed in the DUMP
request header.

Thanks,

Maxime

[1]: https://lore.kernel.org/netdev/20240821151009.1681151-1-maxime.chevallier@bootlin.com/

Link to V1: https://lore.kernel.org/netdev/20240103142950.235888-1-maxime.chevallier@bootlin.com/

Maxime Chevallier (3):
  update UAPI header copies
  ethtool: Allow passing a PHY index for phy-targetting commands
  ethtool: Introduce a command to list PHYs

 Makefile.am                  |   1 +
 ethtool.8.in                 |  56 +++++++++++++++++
 ethtool.c                    |  30 ++++++++-
 internal.h                   |   1 +
 netlink/cable_test.c         |   4 +-
 netlink/extapi.h             |   1 +
 netlink/msgbuff.c            |  52 ++++++++++++----
 netlink/msgbuff.h            |   3 +
 netlink/nlsock.c             |  38 ++++++++++++
 netlink/nlsock.h             |   2 +
 netlink/phy.c                | 116 +++++++++++++++++++++++++++++++++++
 netlink/plca.c               |   4 +-
 netlink/pse-pd.c             |   4 +-
 uapi/linux/ethtool.h         |  16 +++++
 uapi/linux/ethtool_netlink.h |  25 ++++++++
 15 files changed, 334 insertions(+), 19 deletions(-)
 create mode 100644 netlink/phy.c