From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5909E606A31A for ; Tue, 1 Dec 2026 22:43:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=networkplumber-org.20260707.gappssmtp.com header.i=@networkplumber-org.20260707.gappssmtp.com header.a=rsa-sha256 header.s=20260707 header.b=C6iPytB8 Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 78FC5402BD; Tue, 1 Dec 2026 23:43:04 +0100 (CET) Received: from mail-pg1-f173.google.com (mail-pg1-f173.google.com [209.85.215.173]) by mails.dpdk.org (Postfix) with ESMTPS id B7063402B8 for ; Tue, 1 Dec 2026 23:43:02 +0100 (CET) Received: by mail-pg1-f173.google.com with SMTP id 41be03b00d2f7-cdb2dfcca94so5321840a12.1 for ; Tue, 01 Dec 2026 14:43:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20260707.gappssmtp.com; s=20260707; t=1796164981; x=1796769781; darn=dpdk.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=pwHmnQ+HIoJGwF0ywgz2oMHWchyE75b/8YoQdO9JJEY=; b=C6iPytB8Anb+CQEURF4G/W79vQKY1k5ZhhxoZIuf7n/YRzc7E11fLbgoM2kucv+oa2 hy1MY298YknQUOVNfwgRjgRnSyHTrBeoM/zSLyrl4GXR6Rz/MyHeKavuXFuFoRWfjdII pNH0JBLQsz+tn4+ZI4RzkG49za0vIfSwqi1qm3YFVnhoM3meyKZ4uqeYu4Gea19cSfa4 wLjEkiAFis8pWwE/sTllPPeGA1b34Bq/XDsTA0DFTmmdSrQu8aTsBbmvNG2R0MB3Lsmb JWPnuSJ/Qg6/Bh9j6BAy9+th156fsypqkNbdzb2ev8eG0+4EVKrxUSAM37IeWQeN80zF shNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796164981; x=1796769781; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=pwHmnQ+HIoJGwF0ywgz2oMHWchyE75b/8YoQdO9JJEY=; b=ZhwWGyasppJeE3gWMBckFOHScrCX98Orhj2/lXuplSArThdep8EBTuzxm+jthFqqR+ kNYx/rMQ41Qv6RUAgnSomSojRLj/azyylHnFRMSXj6t6x53jxYZMiOj+cX4YosuKRC9a uzv5VQ/FsLEeoGR4FspqztxuCMOB6mk37KbjRaGI/E5luLa43pHg8jrWFrGYnVNWoE5Y Omkki47Xe0OXwbRwrqnIe4nComvNkEUZ6LeOqGR5u2nBltAHoPc5eSXp+Ed+adWI5l0N n9XJA0X9rKtq5SRt803ghR3cntDtSDgPQeycRZ5n+hUD5Atwnsfra3x+1A5obVyQRvGo VydA== X-Gm-Message-State: APuU4Z9/ScOyKiAR8HE/D/g/+XgoNUHrzQOvktCTLelZjG2LqaCOsbSJ /imDO5p91xGHkIflrbQg07RY1TmG4oashwCSUVpPnkD+2ut5a9Vp+yZehNogWdkE3wdoy17kRNp c5QYseWM= X-Gm-Gg: AZFdTZdZnng+rOwpP6m/JGThWRvueXQY7jR4+kjjG6VW/USbtXda2a7i98Zx8p/Eloi vC8DBs3qNZzPcS/RsTKl6bDfHfkHBQkw0eF1IJvl4m3LECMl3befNvGvXJjBhwHPqZ41HIxy+R7 rPb1NTcp5WMQjOKbjC2TDPnkuETcclH2Uq2aflXCAFOo11Rnxn7QBQ+0DEAOZkkEWogQ6KqeWyH jQwlrAZw94t/YCtG0gjyFhEHxsrQJzCqX5jN1d4cLigqoeGookhzooMiq6YVd6cF3d8YQ/aWxv9 Dbo+y4dDeIb/NjkoVHtB7WkvrMQIvEpcSZj5Q1nmQNdgY00bq8y8OLmbxbZTU2/o/aptOOBk0tD yqrJ4YbygK2rr+zPI2a2NDvkOkrTAWrqQIxGg+6PTrzkRtpNkKShXMOeKxHNUID1zlnCDYC7d2n 7hz/Sv6L2HvsyZUr4M+NLaZVG0uIv8EuU9c2xTJH50cTNGjlcCw//Y23eCXYOFOCH5tcPBLP4EU OiiPrJskdSXA13C/088v1PNszSgBmyNjKs8/o44d/gE831R2HpfLGzj9DSxDUKmKs1aa2GHL3pk ja1cfpPPf9EDSur2SpZieXhh84CjQpRnlwx328DWx29dzj8JuRMYNlnR0X2Gp31kXuWw X-Received: by 2002:a17:90b:250f:b0:3b5:7d1d:883d with SMTP id 98e67ed59e1d1-3b57d1d8edamr6735062a91.39.1796164980871; Tue, 01 Dec 2026 14:43:00 -0800 (PST) Received: from phoenix.lan (204-195-112-43.wavecable.com. [204.195.112.43]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-cde6cfebdbasm20739684a12.13.2026.12.01.14.43.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Dec 2026 14:43:00 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Subject: [PATCH 0/7] pcapng: fixes, timestamps and stdio output Date: Tue, 1 Dec 2026 14:41:33 -0800 Message-ID: <20261201224258.1962108-1-stephen@networkplumber.org> X-Mailer: git-send-email 2.53.0 X-Archived-By: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Archive: List-Post: List-Help: List-Subscribe: , X-Spam-Status: No, score=-11.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 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