DPDK-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH 6/7] pcapng: add user-supplied timestamp support
       [not found] ` <20260429073111.3712950-7-dawid.wesierski@intel.com>
@ 2026-04-30 14:05   ` Stephen Hemminger
  2026-04-30 14:06   ` Stephen Hemminger
  2026-04-30 14:09   ` Stephen Hemminger
  2 siblings, 0 replies; 3+ messages in thread
From: Stephen Hemminger @ 2026-04-30 14:05 UTC (permalink / raw)
  To: Dawid Wesierski
  Cc: dev, bruce.richardson, anatoly.burakov, vladimir.medvedkin,
	reshma.pattan, thomas, andrew.rybchenko, marek.kasiewicz

On Wed, 29 Apr 2026 03:31:10 -0400
Dawid Wesierski <dawid.wesierski@intel.com> wrote:

> From: Marek Kasiewicz <marek.kasiewicz@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@intel.com>
> Signed-off-by: Dawid Wesierski <dawid.wesierski@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.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 6/7] pcapng: add user-supplied timestamp support
       [not found] ` <20260429073111.3712950-7-dawid.wesierski@intel.com>
  2026-04-30 14:05   ` [PATCH 6/7] pcapng: add user-supplied timestamp support Stephen Hemminger
@ 2026-04-30 14:06   ` Stephen Hemminger
  2026-04-30 14:09   ` Stephen Hemminger
  2 siblings, 0 replies; 3+ messages in thread
From: Stephen Hemminger @ 2026-04-30 14:06 UTC (permalink / raw)
  To: Dawid Wesierski
  Cc: dev, bruce.richardson, anatoly.burakov, vladimir.medvedkin,
	reshma.pattan, thomas, andrew.rybchenko, marek.kasiewicz

On Wed, 29 Apr 2026 03:31:10 -0400
Dawid Wesierski <dawid.wesierski@intel.com> wrote:

> +static inline struct rte_mbuf *
>  rte_pcapng_copy(uint16_t port_id, uint32_t queue,
>  		const struct rte_mbuf *m, struct rte_mempool *mp,
>  		uint32_t length,
> -		enum rte_pcapng_direction direction, const char *comment);
> +		enum rte_pcapng_direction direction, const char *comment)
> +{
> +	return rte_pcapng_copy_ts(port_id, queue, m, mp, length, direction,
> +				  comment, 0);
> +}
>  

Turning a function that existed in previous release into a inline
breaks ABI compatibility. 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 6/7] pcapng: add user-supplied timestamp support
       [not found] ` <20260429073111.3712950-7-dawid.wesierski@intel.com>
  2026-04-30 14:05   ` [PATCH 6/7] pcapng: add user-supplied timestamp support Stephen Hemminger
  2026-04-30 14:06   ` Stephen Hemminger
@ 2026-04-30 14:09   ` Stephen Hemminger
  2 siblings, 0 replies; 3+ messages in thread
From: Stephen Hemminger @ 2026-04-30 14:09 UTC (permalink / raw)
  To: Dawid Wesierski
  Cc: dev, bruce.richardson, anatoly.burakov, vladimir.medvedkin,
	reshma.pattan, thomas, andrew.rybchenko, marek.kasiewicz

On Wed, 29 Apr 2026 03:31:10 -0400
Dawid Wesierski <dawid.wesierski@intel.com> wrote:

> From: Marek Kasiewicz <marek.kasiewicz@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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-04-30 14:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20260429073111.3712950-1-dawid.wesierski@intel.com>
     [not found] ` <20260429073111.3712950-7-dawid.wesierski@intel.com>
2026-04-30 14:05   ` [PATCH 6/7] pcapng: add user-supplied timestamp support Stephen Hemminger
2026-04-30 14:06   ` Stephen Hemminger
2026-04-30 14:09   ` Stephen Hemminger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox