HI ! rte_rdtsc is wrong on some cpu. when runing on Intel(R) Xeon(R) CPU E5-2640 v2 @ 2.00GHz , it is OK. But on Intel(R) Xeon(R) CPU E5-4610 v2 @ 2.30GHz, it return a very big value sometime.
Here is my test use gdb. It can jump from 26460438829980939 to 2840228530541503 in less one second ! Breakpoint 1, rte_rdtsc() at dpdk-2.2.0/lib/librte_eal/common/include/arch/x86/rte_cycles.h:104 $184 = {tsc_64 = 0x5e01a008be027f, {lo_32 = 0x8be027f, hi_32 = 0x5e01a0}} $185 = {tsc_64 = 26460434663867007, {lo_32 = 146670207, hi_32 = 6160800}} (gdb) Continuing. Breakpoint 2, rte_rdtsc() at dpdk-2.2.0/lib/librte_eal/common/include/arch/x86/rte_cycles.h:104 32 in /home/yangqiang/gajet/gajet_branch/2.0/code/src/nsdpf/tsc_time.h $186 = {tsc_64 = 0x5e01a1010fdd0b, {lo_32 = 0x10fdd0b, hi_32 = 0x5e01a1}} $187 = {tsc_64 = 26460438829980939, {lo_32 = 17816843, hi_32 = 6160801}} (gdb) Continuing. Breakpoint 2, rte_rdtsc() at dpdk-2.2.0/lib/librte_eal/common/include/arch/x86/rte_cycles.h:104 32 in /home/yangqiang/gajet/gajet_branch/2.0/code/src/nsdpf/tsc_time.h $188 = {tsc_64 = 0xa172c3ca4d3bf, {lo_32 = 0x3ca4d3bf, hi_32 = 0xa172c}} $189 = {tsc_64 = 2840228530541503, {lo_32 = 1017435071, hi_32 = 661292}} (gdb) Continuing. Breakpoint 2, tsc_time () at /home/yangqiang/gajet/gajet_branch/2.0/code/src/nsdpf/tsc_time.h:32 32 in /home/yangqiang/gajet/gajet_branch/2.0/code/src/nsdpf/tsc_time.h $190 = {tsc_64 = 0xa172c7cd5f131, {lo_32 = 0x7cd5f131, hi_32 = 0xa172c}} $191 = {tsc_64 = 2840229607502129, {lo_32 = 2094395697, hi_32 = 661292}} lvenyong at 1218.com.cn