From: bugzilla@dpdk.org
To: dev@dpdk.org
Subject: [DPDK/ethdev Bug 1961] Rx timestamp no rollover indication
Date: Tue, 30 Jun 2026 00:19:47 +0000 [thread overview]
Message-ID: <bug-1961-3@http.bugs.dpdk.org/> (raw)
http://bugs.dpdk.org/show_bug.cgi?id=1961
Bug ID: 1961
Summary: Rx timestamp no rollover indication
Product: DPDK
Version: unspecified
Hardware: All
OS: All
Status: UNCONFIRMED
Severity: enhancement
Priority: Normal
Component: ethdev
Assignee: dev@dpdk.org
Reporter: stephen@networkplumber.org
Target Milestone: ---
Each PMD has its own internal hardware counter for receive timestamps. But this
counter can and will roll over so using it for things like packet capture is
impossible with current API's. Need something more complete and richer than
existing read_clock API.
AI analysis showed:
The Rollover Problem
Hardware timestamps typically use a fixed-width counter that wraps around:
- 32-bit counter at 1GHz = rollover every ~4.3 seconds
- 40-bit counter at 1GHz = rollover every ~18 minutes
- 48-bit counter at 1GHz = rollover every ~3.3 days
Without knowing the counter width, you can't detect or handle rollovers
correctly!
Current API Limitations
The read_clock operation only returns:
int rte_eth_read_clock(uint16_t port_id, uint64_t *clock);
This doesn't tell you:
1. Counter bit width - Is it 32, 40, 48, or 64 bits?
2. Rollover period - How often does it wrap?
3. Clock frequency - Needed to calculate rollover time
4. Timestamp format - Raw counter vs scaled nanoseconds
What's Needed for Robust Packet Capture
struct rte_eth_timestamp_info {
uint64_t frequency_hz; /* Clock frequency */
uint8_t counter_bits; /* Actual counter width (32/40/48/64) */
uint64_t rollover_nsec; /* Rollover period in nanoseconds */
uint64_t current_value; /* Current counter reading */
enum {
RTE_TS_FORMAT_RAW_COUNTER,
RTE_TS_FORMAT_NANOSECONDS,
RTE_TS_FORMAT_PTP_TIME
} format;
};
Real-World Impact on Packet Capture
Without rollover information, packet capture tools face impossible choices:
Problem 1: Undetected Rollover
/* Packet 1: timestamp = 0xFFFFFFF0 (near max for 32-bit) */
/* Packet 2: timestamp = 0x00000010 (rolled over) */
/* Without knowing it's 32-bit, this looks like time went backwards! */
Problem 2: Incorrect Delta Calculation
/* If you assume 64-bit but it's actually 40-bit: */
delta = pkt2_ts - pkt1_ts; /* Huge negative or wrong positive value */
Problem 3: Can't Maintain Absolute Time
/* Need to track rollovers to maintain wall-clock correlation: */
absolute_time = (rollover_count * rollover_period) + current_timestamp;
/* But without knowing rollover_period, this is impossible */
Specific Driver Issues
Looking at actual implementations:
- Intel E810 (ice): 40-bit counter @ 812.5MHz = ~22 minute rollover
- Intel 700 series (i40e/iavf): 48-bit counter, but what frequency?
- Mellanox: Various counter widths depending on firmware
- Broadcom: Often 48-bit, but frequency varies
None of this is exposed through the API!
Proposed API Enhancement
/* Better API for timestamp capabilities */
int rte_eth_timestamp_info_get(uint16_t port_id,
struct rte_eth_timestamp_info *info);
/* Helper to handle rollover */
uint64_t rte_eth_timestamp_normalize(uint16_t port_id,
uint64_t hw_timestamp,
uint64_t *rollover_count);
This would let packet capture tools:
1. Detect and handle rollovers correctly
2. Maintain accurate absolute timestamps across rollovers
3. Generate proper pcap timestamps even for long captures
4. Warn users about rollover limitations
--
You are receiving this mail because:
You are the assignee for the bug.
reply other threads:[~2026-06-30 0:19 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=bug-1961-3@http.bugs.dpdk.org/ \
--to=bugzilla@dpdk.org \
--cc=dev@dpdk.org \
/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