DPDK-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Dawid Wesierski <dawid.wesierski@intel.com>
Cc: dev@dpdk.org, marek.kasiewicz@intel.com, thomas@monjalon.net,
	mb@smartsharesystems.com
Subject: Re: [PATCH v6 1/1] pcapng: add user-supplied timestamp support
Date: Mon, 29 Jun 2026 09:50:55 -0700	[thread overview]
Message-ID: <20260629095055.58620f0c@phoenix.local> (raw)
In-Reply-To: <20260629093942.983145-1-dawid.wesierski@intel.com>

On Mon, 29 Jun 2026 05:37:33 -0400
Dawid Wesierski <dawid.wesierski@intel.com> wrote:

> Add a timestamp parameter to rte_pcapng_copy() so that callers with a
> hardware PTP or pre-captured timestamp can inject an exact epoch-ns value
> directly into the packet record.
> 
> Timestamp handling:
>  - ts != 0: caller-supplied nanoseconds since the Unix epoch, stored as-is.
>  - ts == 0: TSC captured at copy time with bit 63 set as a sentinel.
>    rte_pcapng_write_packets() detects the sentinel and converts the TSC to
>    epoch ns using the file's calibrated clock.  The TSC will not reach
>    bit 63 for centuries, and epoch-ns values stay below bit 63 until 2554,
>    so the bit is safe to use as a disambiguation flag.
> 
> Adding the parameter changes the ABI, so rte_pcapng_copy() is versioned.
> 
> rte_pcapng_tsc_to_ns() is added as a new experimental helper.  It exposes the
> same calibrated, drift-compensated, divide-free TSC-to-epoch-ns conversion
> used internally by rte_pcapng_write_packets(), allows callers to convert
> a TSC captured at packet arrival time before passing it to rte_pcapng_copy().
> 
> Signed-off-by: Marek Kasiewicz <marek.kasiewicz@intel.com>
> Signed-off-by: Dawid Wesierski <dawid.wesierski@intel.com>
> ---

Looks good, I would like to make some follow on patches to replace
the tsc_to_ns routines with something in EAL since it is generally useful
to get time in nanoseconds.

      reply	other threads:[~2026-06-29 16:51 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-18 14:38 [PATCH v3 1/1] pcapng: add user-supplied timestamp support Dawid Wesierski
2026-06-18 15:22 ` Stephen Hemminger
2026-06-18 16:45   ` Morten Brørup
2026-06-18 18:51     ` Stephen Hemminger
2026-06-23 14:10 ` [PATCH v4] " Dawid Wesierski
2026-06-23 13:53   ` Stephen Hemminger
2026-06-24 21:57   ` [PATCH v5] " Dawid Wesierski
2026-06-24 22:07     ` Stephen Hemminger
2026-06-24 22:17     ` Stephen Hemminger
2026-06-26 10:22     ` [v5] " Dawid Wesierski
2026-06-26 15:04       ` Stephen Hemminger
2026-06-29  9:37     ` [PATCH v6 1/1] " Dawid Wesierski
2026-06-29 16:50       ` Stephen Hemminger [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260629095055.58620f0c@phoenix.local \
    --to=stephen@networkplumber.org \
    --cc=dawid.wesierski@intel.com \
    --cc=dev@dpdk.org \
    --cc=marek.kasiewicz@intel.com \
    --cc=mb@smartsharesystems.com \
    --cc=thomas@monjalon.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox