git.droids-corp.org
/
dpdk.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
net/mlx5: fix missing packet type for IP-in-IP
[dpdk.git]
/
lib
/
librte_eal
/
linux
/
eal
/
eal_timer.c
diff --git
a/lib/librte_eal/linux/eal/eal_timer.c
b/lib/librte_eal/linux/eal/eal_timer.c
index
bc8f051
..
76ec170
100644
(file)
--- a/
lib/librte_eal/linux/eal/eal_timer.c
+++ b/
lib/librte_eal/linux/eal/eal_timer.c
@@
-232,6
+232,7
@@
get_tsc_freq(void)
{
#ifdef CLOCK_MONOTONIC_RAW
#define NS_PER_SEC 1E9
{
#ifdef CLOCK_MONOTONIC_RAW
#define NS_PER_SEC 1E9
+#define CYC_PER_10MHZ 1E7
struct timespec sleeptime = {.tv_nsec = NS_PER_SEC / 10 }; /* 1/10 second */
struct timespec sleeptime = {.tv_nsec = NS_PER_SEC / 10 }; /* 1/10 second */
@@
-248,7
+249,8
@@
get_tsc_freq(void)
double secs = (double)ns/NS_PER_SEC;
tsc_hz = (uint64_t)((end - start)/secs);
double secs = (double)ns/NS_PER_SEC;
tsc_hz = (uint64_t)((end - start)/secs);
- return tsc_hz;
+ /* Round up to 10Mhz. 1E7 ~ 10Mhz */
+ return RTE_ALIGN_MUL_NEAR(tsc_hz, CYC_PER_10MHZ);
}
#endif
return 0;
}
#endif
return 0;