diff options
| author | Vladimir Oltean <vladimir.oltean@nxp.com> | 2025-01-16 13:46:25 +0300 |
|---|---|---|
| committer | Jakub Kicinski <kuba@kernel.org> | 2025-01-18 07:01:09 +0300 |
| commit | 6a128cdf1926b20a94d6af7d7d03b76ba19a4f8b (patch) | |
| tree | fe6a0f9a31851da46ff95822fd2431fd82c46509 /include/linux | |
| parent | 19e1e17f50c411f77140dd86d8255c8daa9e2edb (diff) | |
| download | linux-6a128cdf1926b20a94d6af7d7d03b76ba19a4f8b.tar.xz | |
net: ethtool: ts: add separate counter for unconfirmed one-step TX timestamps
For packets with two-step timestamp requests, the hardware timestamp
comes back to the driver through a confirmation mechanism of sorts,
which allows the driver to confidently bump the successful "pkts"
counter.
For one-step PTP, the NIC is supposed to autonomously insert its
hardware TX timestamp in the packet headers while simultaneously
transmitting it. There may be a confirmation that this was done
successfully, or there may not.
None of the current drivers which implement ethtool_ops :: get_ts_stats()
also support HWTSTAMP_TX_ONESTEP_SYNC or HWTSTAMP_TX_ONESTEP_SYNC, so it
is a bit unclear which model to follow. But there are NICs, such as DSA,
where there is no transmit confirmation at all. Here, it would be wrong /
misleading to increment the successful "pkts" counter, because one-step
PTP packets can be dropped on TX just like any other packets.
So introduce a special counter which signifies "yes, an attempt was made,
but we don't know whether it also exited the port or not". I expect that
for one-step PTP packets where a confirmation is available, the "pkts"
counter would be bumped.
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Jakub Kicinski <kuba@kernel.org>
Link: https://patch.msgid.link/20250116104628.123555-2-vladimir.oltean@nxp.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/ethtool.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h index e4136b0df892..64301ddf2f59 100644 --- a/include/linux/ethtool.h +++ b/include/linux/ethtool.h @@ -559,6 +559,12 @@ struct ethtool_rmon_stats { /** * struct ethtool_ts_stats - HW timestamping statistics * @pkts: Number of packets successfully timestamped by the hardware. + * @onestep_pkts_unconfirmed: Number of PTP packets with one-step TX + * timestamping that were sent, but for which the + * device offers no confirmation whether they made + * it onto the wire and the timestamp was inserted + * in the originTimestamp or correctionField, or + * not. * @lost: Number of hardware timestamping requests where the timestamping * information from the hardware never arrived for submission with * the skb. @@ -571,6 +577,7 @@ struct ethtool_rmon_stats { struct ethtool_ts_stats { struct_group(tx_stats, u64 pkts; + u64 onestep_pkts_unconfirmed; u64 lost; u64 err; ); |
