* [DPDK/core Bug 1869] incorrect get_tsc_freq_arch() due to integer truncation
@ 2026-01-22 18:03 bugzilla
2026-02-17 22:03 ` bugzilla
0 siblings, 1 reply; 2+ messages in thread
From: bugzilla @ 2026-01-22 18:03 UTC (permalink / raw)
To: dev
http://bugs.dpdk.org/show_bug.cgi?id=1869
Bug ID: 1869
Summary: incorrect get_tsc_freq_arch() due to integer
truncation
Product: DPDK
Version: unspecified
Hardware: x86
OS: All
Status: UNCONFIRMED
Severity: normal
Priority: Normal
Component: core
Assignee: dev@dpdk.org
Reporter: rizzo.unipi@gmail.com
Target Milestone: ---
There is a bug in
https://github.com/DPDK/dpdk/blob/main/lib/eal/x86/rte_cycles.c#L148
143 __cpuid(0x15, a, b, c, d);
...
146 /* EBX : TSC/Crystal ratio, ECX : Crystal Hz */
147 if (b && c)
148 return c * (b / a);
On one machine, line 143 returns a 10 b 23 c 1000000000 d 0,
the division (b / a) returns 2 hence leading to
an incorrect value (2 GHz instead of 2.3 GHz)
The trivial fix is to replace line 148 with
return (uint64_t)c * b / a;
--
You are receiving this mail because:
You are the assignee for the bug.
^ permalink raw reply [flat|nested] 2+ messages in thread
* [DPDK/core Bug 1869] incorrect get_tsc_freq_arch() due to integer truncation
2026-01-22 18:03 [DPDK/core Bug 1869] incorrect get_tsc_freq_arch() due to integer truncation bugzilla
@ 2026-02-17 22:03 ` bugzilla
0 siblings, 0 replies; 2+ messages in thread
From: bugzilla @ 2026-02-17 22:03 UTC (permalink / raw)
To: dev
http://bugs.dpdk.org/show_bug.cgi?id=1869
Thomas Monjalon (thomas@monjalon.net) changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |FIXED
Status|UNCONFIRMED |RESOLVED
--- Comment #4 from Thomas Monjalon (thomas@monjalon.net) ---
Resolved in http://git.dpdk.org/dpdk/commit/?id=a17499cf33
--
You are receiving this mail because:
You are the assignee for the bug.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-02-17 22:03 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-22 18:03 [DPDK/core Bug 1869] incorrect get_tsc_freq_arch() due to integer truncation bugzilla
2026-02-17 22:03 ` bugzilla
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox