[PATCH v2 net-next 0/4] ethtool get_ts_stats() for DSA and ocelot driver
From: Vladimir Oltean <vladimir.oltean@nxp.com>
Date: 2025-01-16 10:46:43
Picking up this set again after the end-of-year break. Changes in v2: trivial rebase after the concurrent merge of the "net: Make timestamping selectable" set. Link to v1: https://lore.kernel.org/netdev/20241213140852.1254063-1-vladimir.oltean@nxp.com/ (local) Original cover letter: After a recent patch set with fixes and general restructuring, Jakub asked for the Felix DSA driver to start reporting standardized statistics for hardware timestamping: https://lore.kernel.org/netdev/20241207180640.12da60ed@kernel.org/ (local) Testing follows the same procedure as in the aforementioned series, with PTP packet loss induced through taprio: $ ethtool -I --show-time-stamping swp3 Time stamping parameters for swp3: Capabilities: hardware-transmit software-transmit hardware-receive software-receive software-system-clock hardware-raw-clock PTP Hardware Clock: 1 Hardware Transmit Timestamp Modes: off on onestep-sync Hardware Receive Filter Modes: none ptpv2-l4-event ptpv2-l2-event ptpv2-event Statistics: tx_pkts: 14591 tx_lost: 85 tx_err: 0 Note that the kernel netlink attributes contain a newly added statistics counter for unconfirmed one-step TX timestamps, which is not printed by the ethtool user space program yet. I will post a patch once this set is accepted. Vladimir Oltean (4): net: ethtool: ts: add separate counter for unconfirmed one-step TX timestamps net: dsa: implement get_ts_stats ethtool operation for user ports net: mscc: ocelot: add TX timestamping statistics net: dsa: felix: report timestamping stats from the ocelot library Documentation/netlink/specs/ethtool.yaml | 3 ++ Documentation/networking/ethtool-netlink.rst | 16 ++++-- drivers/net/dsa/ocelot/felix.c | 9 ++++ drivers/net/ethernet/mscc/ocelot_net.c | 11 ++++ drivers/net/ethernet/mscc/ocelot_ptp.c | 53 +++++++++++++++---- drivers/net/ethernet/mscc/ocelot_stats.c | 37 +++++++++++++ include/linux/ethtool.h | 7 +++ include/net/dsa.h | 2 + include/soc/mscc/ocelot.h | 11 ++++ .../uapi/linux/ethtool_netlink_generated.h | 1 + net/dsa/user.c | 11 ++++ net/ethtool/tsinfo.c | 2 + 12 files changed, 147 insertions(+), 16 deletions(-) -- 2.43.0