DPDK patches and discussions
 help / color / mirror / Atom feed
From: Jerin Jacob <jerin.jacob@caviumnetworks.com>
To: dev@dpdk.org
Cc: thomas@monjalon.net, bruce.richardson@intel.com,
	konstantin.ananyev@intel.com, viktorin@rehivetech.com,
	jianbo.liu@linaro.org, chaozhu@linux.vnet.ibm.com,
	Jerin Jacob <jerin.jacob@caviumnetworks.com>
Subject: [dpdk-dev] [PATCH 5/5] eal/timer: honor architecture specific rdtsc hz function
Date: Sun, 13 Aug 2017 12:33:50 +0530	[thread overview]
Message-ID: <20170813070350.13700-6-jerin.jacob@caviumnetworks.com> (raw)
In-Reply-To: <20170813070350.13700-1-jerin.jacob@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@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

      parent reply	other threads:[~2017-08-13  7:04 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-13  7:03 [dpdk-dev] [PATCH 0/5] improve tsc frequency calibration Jerin Jacob
2017-08-13  7:03 ` [dpdk-dev] [PATCH 1/5] eal/x86: define architecture specific rdtsc hz Jerin Jacob
2017-09-18 12:54   ` Burakov, Anatoly
2017-08-13  7:03 ` [dpdk-dev] [PATCH 2/5] eal/ppc64: " Jerin Jacob
2017-09-28  1:53   ` Chao Zhu
2017-08-13  7:03 ` [dpdk-dev] [PATCH 3/5] eal/armv7: " Jerin Jacob
2017-08-13  7:03 ` [dpdk-dev] [PATCH 4/5] eal/armv8: " Jerin Jacob
2017-08-15  3:35   ` Jianbo Liu
2017-08-13  7:03 ` Jerin Jacob [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170813070350.13700-6-jerin.jacob@caviumnetworks.com \
    --to=jerin.jacob@caviumnetworks.com \
    --cc=bruce.richardson@intel.com \
    --cc=chaozhu@linux.vnet.ibm.com \
    --cc=dev@dpdk.org \
    --cc=jianbo.liu@linaro.org \
    --cc=konstantin.ananyev@intel.com \
    --cc=thomas@monjalon.net \
    --cc=viktorin@rehivetech.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).