[PATCH 6/7] pcapng: add user-supplied timestamp support
Stephen Hemminger
stephen at networkplumber.org
Thu Apr 30 16:05:33 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.
>
> The existing rte_pcapng_copy() function is preserved as a static inline
> wrapper that passes zero for backward compatibility.
>
> The TSC-to-epoch conversion in the write path is removed since callers
> providing hardware timestamps have already performed the conversion.
>
>
> Signed-off-by: Marek Kasiewicz <marek.kasiewicz at intel.com>
> Signed-off-by: Dawid Wesierski <dawid.wesierski at intel.com>
Rather than having two functions, it would simpler to just use function
versioning and add timestamp parameter. There is only one caller in the tree
right now.
More information about the dev
mailing list