[PATCH 6/7] pcapng: add user-supplied timestamp support
Stephen Hemminger
stephen at networkplumber.org
Thu Apr 30 16:09:32 CEST 2026
On Wed, 29 Apr 2026 03:31:10 -0400
Dawid Wesierski <dawid.wesierski at intel.com> wrote:
> From: Marek Kasiewicz <marek.kasiewicz at intel.com>
>
> Add rte_pcapng_copy_ts() which accepts an optional timestamp parameter
> in nanoseconds. When the timestamp is non-zero, it is used directly
> instead of reading the TSC. This allows applications to provide
> hardware PTP timestamps from the NIC, enabling accurate packet capture
> with PTP-domain timing rather than host-local TSC values.
Also, the HW timestamp would have to be in ns since Unix Epoch
not what HW clock is. That is a hard thing to do...
I would rather have the pcapng infrastructure know how to use
hardware timestamp dynamic field if present. But the problem is
getting the conversion right; it would have to compute offset and
resolution per NIC, and NIC's roll over too fast. The problem is
hard.
Bottom line: needs lots more work
More information about the dev
mailing list