[PATCH 0/3] pcapng timestamp conversion and user-supplied timestamps

Stephen Hemminger stephen at networkplumber.org
Wed Oct 21 04:56:44 CEST 2026


On Tue, 20 Oct 2026 10:55:41 -0700
Stephen Hemminger <stephen at networkplumber.org> wrote:

> This extends the proposed user-supplied timestamps.
> 
> The pcapng library converts the TSC into nanoseconds since 1/1/1970,
> because that is what the pcapng file format records. Make that
> function available for more general use.
> 
> The third patch is Dawid's v8, rebased on the first two. 
> Some rework was needed to fit in because because adding
> new parameter to existing function creates lot of API and deprecation
> headaches so rte_pcapng_copy_ts() is added as a new experimental function instead.

FYI - AI says its own review is bogus..

1/3 Error, clock_gettime() failure: noise. CLOCK_REALTIME with a valid timespec cannot fail on Linux, FreeBSD, or the Windows shim. This is the same class as the pthread_mutex_init() false positive. Both suggested fixes are worse than the code. Failing EAL init over an unreachable path is overkill. rte_panic() in a library is unacceptable. The eal_tsc_base == 0 sentinel is also wrong, because base 0 already has a meaning.

1/3 Warning, missing test: weak. rte_tsc_to_ns() is already exercised through test_pcapng (test_write_before_open, test_long_timestamp). The suggested test is broken: it reads ts1/ts2 and never uses them. It only checks the frequency, not the epoch offset, which is the thing the API adds.

3/3 “Error” on 1ULL << 63: the bot raised it and then concluded “Not a finding”. That is exactly the retract-inline pattern AGENTS.md already forbids. Its own Pass 2 then claims nothing like that was left in, so the self-check is false.

3/3 testpmd hook: it invents a testpmd --pcap=<file> mode, which does not exist. It then talks itself out of the finding and ends with “No action required”. This should have been omitted.

2/3 “None”: should have been omitted entirely, not acknowledged as clean.


More information about the dev mailing list