[dpdk-dev] [PATCH v2 5/5] eal/timer: honor architecture specific rdtsc hz function
Gowrishankar
gowrishankar.m at linux.vnet.ibm.com
Fri Sep 22 10:25:37 CEST 2017
From: Jerin Jacob <jerin.jacob at caviumnetworks.com>
When calibrating the tsc frequency, first, probe the architecture specific
rdtsc hz function. if not available, use the existing calibrate scheme
to calibrate the tsc frequency.
Signed-off-by: Jerin Jacob <jerin.jacob at caviumnetworks.com>
---
lib/librte_eal/common/eal_common_timer.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/lib/librte_eal/common/eal_common_timer.c b/lib/librte_eal/common/eal_common_timer.c
index ed0b16d..978edae 100644
--- a/lib/librte_eal/common/eal_common_timer.c
+++ b/lib/librte_eal/common/eal_common_timer.c
@@ -80,8 +80,11 @@
void
set_tsc_freq(void)
{
- uint64_t freq = get_tsc_freq();
+ uint64_t freq;
+ freq = rte_rdtsc_arch_hz();
+ if (!freq)
+ freq = get_tsc_freq();
if (!freq)
freq = estimate_tsc_freq();
--
1.9.1
More information about the dev
mailing list