[dpdk-dev] rte_get_tsc_cycles function slowly increase ?

From: 小祥子 <hidden>
Date: 2021-07-05 06:58:13

hi all,


rte_get_tsc_cycles function slowly increase, gettimeofday function is normally increase.

The following pseudo-code is my test example:
``` uint64_t hz = rte_get_tsc_hz(); uint64_t start_cycles = rte_get_tsc_cycles();           // running on first cpuuint64_t start_time = gettimeofday();                   // running on first cpu <perform operations&gt;                                    // running for 1 day or 2 day uint64_t end_cycles = rte_get_tsc_cycles();             // running on second cpuuint64_t end_time = gettimeofday();                     // running on first cpu
elapsed1_s = (end_cycles - start_cycles) / hz;elapsed2_s = (end_time - start_time);
I found a&nbsp;&nbsp;phenomenon&nbsp;that&nbsp;elapsed1_s is&nbsp;inaccurate,&nbsp;elapsed2_s is&nbsp;accurate. and the gap between elapsed2_s and&nbsp;elapsed1_s has&nbsp;increasingly widened.&nbsp;&nbsp;


why? how to explain the&nbsp;phenomenon or fix the problem.




Hope that helps! Regards, 
wang.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help