The ethdev timesync API currently exposes Tx timestamps through a shared
hardware register. This requires applications to serialize timestamped
packets and does not allow correlation when multiple packets are in
flight.

This RFC proposes an ethdev interface for hardware with independent Tx
timestamp slots. The interface reports the supported timestamping
mechanism, provides a port-global slot lifecycle, and lets applications
poll each slot asynchronously after transmission.

The proposal includes the following components:

* Capability reporting for shared-register and per-packet timestamping.
* Slot allocation, asynchronous timestamp retrieval, and slot release.
* A dual-domain timestamp structure for adjusted PHC and raw hardware
  time.
* Mbuf dynamic field and dynflag support for passing slot handles to Tx,
  with a helper that stamps a slot handle onto an mbuf.
* Registration and process-local reset of the cached dynfield state.
* An ice PMD implementation using the 64 per-port PHY timestamp slots.
* A testpmd command to report the slot capabilities of a port.
* Programmer-guide and NIC feature documentation.

The legacy rte_eth_timesync_read_tx_timestamp() API remains available on
devices using a shared timestamp register.

Changes since v3:

* Added an ice PMD implementation of the new slot ops. The ice PHY
  exposes 64 Tx timestamp slots per port, which are now tracked in an
  atomic per-adapter bitmap instead of the single static slot the driver
  used before. On E822 the 64 quad slots are split evenly between the
  PFs sharing the quad so allocations never overlap.
* The ice Tx context descriptor now takes the timestamp index from the
  mbuf dynamic field when the packet carries the slot dynflag, and falls
  back to the legacy static index otherwise.
* The ice legacy single-slot read path now uses ptp_tx_index instead of
  a hardcoded slot 0, and clears the PHY timestamp on E810 after a read
  or a timeout so a stale entry cannot block later requests.
* Added a testpmd command, "show port <port_id> tx_timestamp_caps", that
  reports the slot capabilities of a port and performs an allocate and
  release round-trip to exercise the API.

Comments and suggestions on the interface and the ice implementation are
welcome.

Rajesh Kumar (3):
  ethdev: add Tx timestamp slot management APIs
  net/ice: support per-packet Tx timestamp slots
  app/testpmd: add Tx timestamp capabilities command

 app/test-pmd/cmdline.c                    |  79 ++++++
 doc/guides/nics/features.rst              |  16 +-
 doc/guides/prog_guide/ethdev/index.rst    |   1 +
 doc/guides/prog_guide/ethdev/timesync.rst | 223 +++++++++++++++++
 doc/guides/rel_notes/release_26_11.rst    |   7 +
 drivers/net/intel/ice/ice_ethdev.c        | 210 +++++++++++++++-
 drivers/net/intel/ice/ice_ethdev.h        |   2 +
 drivers/net/intel/ice/ice_rxtx.c          |  11 +-
 lib/ethdev/ethdev_driver.h                |  25 ++
 lib/ethdev/rte_ethdev.c                   | 202 ++++++++++++++++
 lib/ethdev/rte_ethdev.h                   | 278 ++++++++++++++++++++++
 11 files changed, 1047 insertions(+), 7 deletions(-)
 create mode 100644 doc/guides/prog_guide/ethdev/timesync.rst

-- 
2.55.0

Reply via email to