[PATCH 5/5] eal/timer: honor architecture specific rdtsc hz function
From: Jerin Jacob <hidden>
Date: 2017-08-13 07:04:50
Subsystem:
library code, the rest · Maintainers:
Andrew Morton, Linus Torvalds
From: Jerin Jacob <hidden>
Date: 2017-08-13 07:04:50
Subsystem:
library code, the rest · Maintainers:
Andrew Morton, Linus Torvalds
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 <redacted> --- 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