From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gowrishankar Subject: [PATCH v2 5/5] eal/timer: honor architecture specific rdtsc hz function Date: Fri, 22 Sep 2017 13:55:37 +0530 Message-ID: <05e205ba2a617012e7dbea4b384a2a2280b36b63.1506058385.git.gowrishankar.m@linux.vnet.ibm.com> References: Cc: Chao Zhu , Bruce Richardson , Konstantin Ananyev , Jerin Jacob , viktorin@rehivetech.com, jianbo.liu@linaro.org To: dev@dpdk.org Return-path: Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by dpdk.org (Postfix) with ESMTP id 4E0C71B1AA for ; Fri, 22 Sep 2017 10:26:02 +0200 (CEST) Received: from pps.filterd (m0098399.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id v8M8NuOq051478 for ; Fri, 22 Sep 2017 04:26:01 -0400 Received: from e23smtp01.au.ibm.com (e23smtp01.au.ibm.com [202.81.31.143]) by mx0a-001b2d01.pphosted.com with ESMTP id 2d4pnk997n-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Fri, 22 Sep 2017 04:26:01 -0400 Received: from localhost by e23smtp01.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 22 Sep 2017 18:25:58 +1000 Received: from d23av03.au.ibm.com (d23av03.au.ibm.com [9.190.234.97]) by d23relay06.au.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v8M8Ptpr32243738 for ; Fri, 22 Sep 2017 18:25:55 +1000 Received: from d23av03.au.ibm.com (localhost [127.0.0.1]) by d23av03.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id v8M8Pmcq009830 for ; Fri, 22 Sep 2017 18:25:48 +1000 In-Reply-To: In-Reply-To: References: List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Jerin Jacob 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 --- 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