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, mb@smartsharesystems.com,
	Marek Kasiewicz <marek.kasiewicz@intel.com>
Subject: Re: [PATCH v4] pcapng: add user-supplied timestamp support
Date: Tue, 23 Jun 2026 06:53:40 -0700	[thread overview]
Message-ID: <20260623065340.15e4f1a5@phoenix.local> (raw)
In-Reply-To: <20260623141302.486601-1-dawid.wesierski@intel.com>

On Tue, 23 Jun 2026 10:10:11 -0400
Dawid Wesierski <dawid.wesierski@intel.com> wrote:

> +/*
> + * Compatibility wrapper: captures current TSC (converted at write time).
> + * Equivalent to rte_pcapng_copy_ts(..., 0).
> + */
> +RTE_EXPORT_SYMBOL(rte_pcapng_copy)
> +struct rte_mbuf *
> +rte_pcapng_copy(uint16_t port_id, uint32_t queue,
> +		const struct rte_mbuf *md,
> +		struct rte_mempool *mp,
> +		uint32_t length,
> +		enum rte_pcapng_direction direction,
> +		const char *comment)
> +{
> +	return rte_pcapng_copy_ts(port_id, queue, md, mp, length, direction,
> +				  comment, 0);
> +}
> +
> +/*
> + * Convert a TSC value to nanoseconds since the Unix epoch using the
> + * calibrated clock of the capture file. Uses the same pre-computed
> + * reciprocal multiplier as the internal write path (no integer division).
> + */
> +RTE_EXPORT_EXPERIMENTAL_SYMBOL(rte_pcapng_tsc_to_ns, 26.07)
> +uint64_t
> +rte_pcapng_tsc_to_ns(const rte_pcapng_t *self, uint64_t tsc)
> +{
> +	return tsc_to_ns_epoch(&self->clock, tsc);
> +}

Why not just use function versioning on rte_pcapng_copy() to add new parameter?

Also should add a coverage test app/test/test_pcapng.c

      reply	other threads:[~2026-06-23 13:53 UTC|newest]

Thread overview: 6+ 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 [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=20260623065340.15e4f1a5@phoenix.local \
    --to=stephen@networkplumber.org \
    --cc=dawid.wesierski@intel.com \
    --cc=dev@dpdk.org \
    --cc=marek.kasiewicz@intel.com \
    --cc=mb@smartsharesystems.com \
    /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