ethtool: netlink: add ETHTOOL_MSG_MSE_GET and wire up PHY MSE access

Introduce the userspace entry point for PHY MSE diagnostics via
ethtool netlink. This exposes the core API added previously and
returns both capability information and one or more snapshots.

Userspace sends ETHTOOL_MSG_MSE_GET. The reply carries:
- ETHTOOL_A_MSE_CAPABILITIES: scale limits and timing information
- ETHTOOL_A_MSE_CHANNEL_* nests: one or more snapshots (per-channel
  if available, otherwise WORST, otherwise LINK)

Link down returns -ENETDOWN.

Changes:
  - YAML: add attribute sets (mse, mse-capabilities, mse-snapshot)
    and the mse-get operation
  - UAPI (generated): add ETHTOOL_A_MSE_* enums and message IDs,
    ETHTOOL_MSG_MSE_GET/REPLY
  - ethtool core: add net/ethtool/mse.c implementing the request,
    register genl op, and hook into ethnl dispatch
  - docs: document MSE_GET in ethtool-netlink.rst

The include/uapi/linux/ethtool_netlink_generated.h is generated
from Documentation/netlink/specs/ethtool.yaml.

Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
Link: https://patch.msgid.link/20251027122801.982364-3-o.rempel@pengutronix.de
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
Oleksij Rempel
2025-10-27 13:27:59 +01:00
committed by Jakub Kicinski
parent abcf6eef90
commit e6e93fb013
7 changed files with 527 additions and 1 deletions

View File

@@ -1823,6 +1823,73 @@ attribute-sets:
type: uint
enum: pse-event
doc: List of events reported by the PSE controller
-
name: mse-capabilities
doc: MSE capabilities attribute set
attr-cnt-name: --ethtool-a-mse-capabilities-cnt
attributes:
-
name: max-average-mse
type: uint
-
name: max-peak-mse
type: uint
-
name: refresh-rate-ps
type: uint
-
name: num-symbols
type: uint
-
name: mse-snapshot
doc: MSE snapshot attribute set
attr-cnt-name: --ethtool-a-mse-snapshot-cnt
attributes:
-
name: average-mse
type: uint
-
name: peak-mse
type: uint
-
name: worst-peak-mse
type: uint
-
name: mse
attr-cnt-name: --ethtool-a-mse-cnt
attributes:
-
name: header
type: nest
nested-attributes: header
-
name: capabilities
type: nest
nested-attributes: mse-capabilities
-
name: channel-a
type: nest
nested-attributes: mse-snapshot
-
name: channel-b
type: nest
nested-attributes: mse-snapshot
-
name: channel-c
type: nest
nested-attributes: mse-snapshot
-
name: channel-d
type: nest
nested-attributes: mse-snapshot
-
name: worst-channel
type: nest
nested-attributes: mse-snapshot
-
name: link
type: nest
nested-attributes: mse-snapshot
operations:
enum-model: directional
@@ -2756,6 +2823,25 @@ operations:
attributes:
- header
- context
-
name: mse-get
doc: Get PHY MSE measurement data and capabilities.
attribute-set: mse
do: &mse-get-op
request:
attributes:
- header
reply:
attributes:
- header
- capabilities
- channel-a
- channel-b
- channel-c
- channel-d
- worst-channel
- link
dump: *mse-get-op
mcast-groups:
list: