Skip to content

Introduce PHY listing and targeting

Maxime Chevallier lkml netdev 4 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest3 patches 0 repliesNew
  2. v33 patches 1 replySuperseded
  3. v23 patches 4 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v13 patches1 replySuperseded

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3update UAPI header copiesuapi/linux/ethtool.h uapi/linux/ethtool_netlink.h+41 -00 replies
2/3ethtool: Allow passing a PHY index for phy-targetting commandsethtool.8.in ethtool.c internal.h +6 more+100 -200 replies
3/3ethtool: Introduce a command to list PHYsMakefile.am ethtool.8.in ethtool.c +4 more+199 -00 replies

Reviews trailers per patch

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

Read the v4 thread

Cover letter [PATCH ethtool-next v4 0/3] Introduce PHY listing and targeting

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

The V4 addresses all of Michal's reviews this time, introducing better error messages, documenting in the manpage the possible values for the 0 phy index, and making sure ethtool can still build without libmnl.

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/[email protected]/

Link to V3: https://lore.kernel.org/netdev/[email protected]/
Link to V2: https://lore.kernel.org/netdev/[email protected]/
Link to V1: https://lore.kernel.org/netdev/[email protected]/

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                 |  57 +++++++++++++++++
 ethtool.c                    |  33 +++++++++-
 internal.h                   |   1 +
 netlink/cable_test.c         |   4 +-
 netlink/extapi.h             |   2 +
 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, 339 insertions(+), 19 deletions(-)
 create mode 100644 netlink/phy.c
Signature · 1 line
2.46.0