[dpdk-dev] [PATCH 5/5] eal/timer: honor architecture specific rdtsc hz function

Jerin Jacob jerin.jacob at caviumnetworks.com
Sun Aug 13 09:03:50 CEST 2017


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 ed0b16d05..978edaed7 100644
--- a/lib/librte_eal/common/eal_common_timer.c
+++ b/lib/librte_eal/common/eal_common_timer.c
@@ -80,8 +80,11 @@ estimate_tsc_freq(void)
 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();
 
-- 
2.14.0



More information about the dev mailing list