DPDK-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/7] pcapng: fixes, timestamps and stdio output
@ 2026-12-01 22:41 Stephen Hemminger
  2026-12-01 22:41 ` [PATCH 1/7] graph: fix double close of pcapng file Stephen Hemminger
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: Stephen Hemminger @ 2026-12-01 22:41 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger

This covers the pcapng library, plus one EAL addition that the
timestamp changes build on.

The first two patches are independent bug fixes and are marked for stable,

The next four patches deal with time. The conversion from TSC to
nanoseconds since the epoch was living in pcapng, although nothing
about it is specific to packet capture. EAL now takes the reference
point at init and exposes rte_tsc_to_ns(), and pcapng uses that
instead of its own copy. The conversion now happens when the packet
is copied, so the timestamp in the mbuf is already epoch nanoseconds
and no longer has to come from the TSC. rte_pcapng_copy_ts() lets an
application pass the time of the packet directly, for example a
hardware Rx timestamp. The user-timestamp support is based on a patch
from Marek Kasiewicz and Dawid Wesierski.

The pcapng test was comparing file timestamps against
clock_gettime(CLOCK_REALTIME), which measures NTP slew against the
calibrated TSC rate rather than anything about pcapng. It now bounds
the window with rte_tsc_to_ns() so both sides come from the same
reference point, and also checks that timestamps never go backwards.

The last patch replaces writev with stdio. Writing to a FILE * makes
it possible to capture to a pipe or a compressed stream, and lets the
application decide on buffering and when to fflush, which matters for
a live reader like Wireshark. Writing packets also becomes
multi-thread safe because stdio does the locking.
rte_pcapng_fdopen() keeps its old behavior: the stream it creates is
flushed at the end of each write call, so data still reaches the file
before the call returns.

Dawid Wesierski (1):
  pcapng: add user-supplied timestamp support

Stephen Hemminger (6):
  graph: fix double close of pcapng file
  pcapng: call writev as needed on highly segmented mbuf
  eal: add function to convert TSC to epoch time
  pcapng: use EAL TSC to epoch conversion
  test/pcapng: compare timestamps in one clock domain
  pcapng: use stdio for output

 app/test/test_cycles.c                 |  34 +++
 app/test/test_pcapng.c                 | 356 +++++++++++++++----------
 doc/api/doxy-api-index.md              |   1 +
 doc/guides/prog_guide/pcapng_lib.rst   |   4 +
 doc/guides/rel_notes/release_27_03.rst |  19 ++
 lib/eal/common/eal_common_timer.c      |  59 ++++
 lib/eal/include/rte_time.h             |  34 +++
 lib/eal/windows/include/rte_os_shim.h  |   6 +
 lib/graph/graph_pcap.c                 |   4 +-
 lib/pcapng/rte_pcapng.c                | 314 +++++++++++-----------
 lib/pcapng/rte_pcapng.h                | 100 ++++++-
 11 files changed, 628 insertions(+), 303 deletions(-)

-- 
2.53.0


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

end of thread, other threads:[~2026-12-01 22:43 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-01 22:41 [PATCH 0/7] pcapng: fixes, timestamps and stdio output Stephen Hemminger
2026-12-01 22:41 ` [PATCH 1/7] graph: fix double close of pcapng file Stephen Hemminger
2026-12-01 22:41 ` [PATCH 2/7] pcapng: call writev as needed on highly segmented mbuf Stephen Hemminger
2026-12-01 22:41 ` [PATCH 3/7] eal: add function to convert TSC to epoch time Stephen Hemminger
2026-12-01 22:41 ` [PATCH 4/7] pcapng: use EAL TSC to epoch conversion Stephen Hemminger
2026-12-01 22:41 ` [PATCH 5/7] pcapng: add user-supplied timestamp support Stephen Hemminger
2026-12-01 22:41 ` [PATCH 6/7] test/pcapng: compare timestamps in one clock domain Stephen Hemminger
2026-12-01 22:41 ` [PATCH 7/7] pcapng: use stdio for output Stephen Hemminger

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