netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next 0/3] Support exposing raw cycle counters in PTP and mlx5
@ 2025-07-15  5:15 Tariq Toukan
  2025-07-15  5:15 ` [PATCH net-next 1/3] ptp: Add ioctl commands to expose raw cycle counter values Tariq Toukan
                   ` (4 more replies)
  0 siblings, 5 replies; 16+ messages in thread
From: Tariq Toukan @ 2025-07-15  5:15 UTC (permalink / raw)
  To: Eric Dumazet, Jakub Kicinski, Paolo Abeni, Andrew Lunn,
	David S. Miller
  Cc: Saeed Mahameed, Leon Romanovsky, Tariq Toukan, Mark Bloch,
	Richard Cochran, netdev, linux-rdma, linux-kernel,
	Carolina Jubran

Hi,

This series by Carolina adds support in ptp and usage in mlx5 for
exposing the raw free-running cycle counter of PTP hardware clocks.

Find detailed description by Carolina below [1].

Regards,
Tariq


[1]
This patch series introduces support for exposing the raw free-running
cycle counter of PTP hardware clocks. Some telemetry and low-level
logging use cycle counter timestamps rather than nanoseconds.
Currently, there is no generic interface to correlate these raw values
with system time.

To address this, the series introduces two new ioctl commands that
allow userspace to query the device's raw cycle counter together with
host time:

 - PTP_SYS_OFFSET_PRECISE_CYCLES

 - PTP_SYS_OFFSET_EXTENDED_CYCLES

These commands work like their existing counterparts but return the
device timestamp in cycle units instead of real-time nanoseconds.

This can also be useful in the XDP fast path: if a driver inserts the
raw cycle value into metadata instead of a real-time timestamp, it can
avoid the overhead of converting cycles to time in the kernel. Then
userspace can resolve the cycle-to-time mapping using this ioctl when
needed.

Adds the new PTP ioctls and integrates support in ptp_ioctl():
- ptp: Add ioctl commands to expose raw cycle counter values

Support for exposing raw cycles in mlx5:
- net/mlx5: Extract MTCTR register read logic into helper function
- net/mlx5: Support getcyclesx and getcrosscycles


Carolina Jubran (3):
  ptp: Add ioctl commands to expose raw cycle counter values
  net/mlx5: Extract MTCTR register read logic into helper function
  net/mlx5: Support getcyclesx and getcrosscycles

 .../ethernet/mellanox/mlx5/core/lib/clock.c   | 113 ++++++++++++++++--
 drivers/ptp/ptp_chardev.c                     |  34 ++++--
 include/uapi/linux/ptp_clock.h                |   4 +
 3 files changed, 130 insertions(+), 21 deletions(-)


base-commit: 06baf9bfa6ca8db7d5f32e12e27d1dc1b7cb3a8a
-- 
2.31.1


^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2025-08-01 20:23 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-15  5:15 [PATCH net-next 0/3] Support exposing raw cycle counters in PTP and mlx5 Tariq Toukan
2025-07-15  5:15 ` [PATCH net-next 1/3] ptp: Add ioctl commands to expose raw cycle counter values Tariq Toukan
2025-07-15  5:15 ` [PATCH net-next 2/3] net/mlx5: Extract MTCTR register read logic into helper function Tariq Toukan
2025-07-15  5:15 ` [PATCH net-next 3/3] net/mlx5: Support getcyclesx and getcrosscycles Tariq Toukan
2025-07-17 10:55   ` Paolo Abeni
2025-07-17 15:56     ` Carolina Jubran
2025-07-18  9:09       ` Paolo Abeni
2025-07-18 23:29 ` [PATCH net-next 0/3] Support exposing raw cycle counters in PTP and mlx5 Jakub Kicinski
2025-07-21 17:14   ` Thomas Gleixner
2025-07-29 23:33   ` Jacob Keller
2025-07-31 19:05     ` Carolina Jubran
2025-07-22  0:09 ` Jakub Kicinski
2025-07-29  6:57   ` Carolina Jubran
2025-07-29 22:40     ` Jakub Kicinski
2025-07-31 19:03       ` Carolina Jubran
2025-08-01 20:23         ` Jakub Kicinski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).