From: Jianbo Liu <jianbo.liu@linaro.org>
To: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Cc: dev@dpdk.org, Thomas Monjalon <thomas@monjalon.net>,
Bruce Richardson <bruce.richardson@intel.com>,
"Ananyev, Konstantin" <konstantin.ananyev@intel.com>,
Jan Viktorin <viktorin@rehivetech.com>,
Chao Zhu <chaozhu@linux.vnet.ibm.com>
Subject: Re: [dpdk-dev] [PATCH 4/5] eal/armv8: define architecture specific rdtsc hz
Date: Tue, 15 Aug 2017 11:35:15 +0800 [thread overview]
Message-ID: <CAP4Qi38f+M2xvUf99Vu3rMCK68SPkHvxw6+rD3-WnN0Yr2ROGA@mail.gmail.com> (raw)
In-Reply-To: <20170813070350.13700-5-jerin.jacob@caviumnetworks.com>
On 13 August 2017 at 15:03, Jerin Jacob <jerin.jacob@caviumnetworks.com> wrote:
> Use cntvct_el0 system register to get the system counter frequency.
>
> If the system is configured with RTE_ARM_EAL_RDTSC_USE_PMU then
> return 0(let the common code calibrate the tsc frequency).
>
> CC: Jianbo Liu <jianbo.liu@linaro.org>
> Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
> ---
> .../common/include/arch/arm/rte_cycles_64.h | 30 ++++++++++++++++++++++
> 1 file changed, 30 insertions(+)
>
> diff --git a/lib/librte_eal/common/include/arch/arm/rte_cycles_64.h b/lib/librte_eal/common/include/arch/arm/rte_cycles_64.h
> index 154576910..5b95cb67d 100644
> --- a/lib/librte_eal/common/include/arch/arm/rte_cycles_64.h
> +++ b/lib/librte_eal/common/include/arch/arm/rte_cycles_64.h
> @@ -58,6 +58,23 @@ rte_rdtsc(void)
> asm volatile("mrs %0, cntvct_el0" : "=r" (tsc));
> return tsc;
> }
> +
> +/**
> + * Get the number of rdtsc cycles in one second if the architecture supports.
> + *
> + * @return
> + * The number of rdtsc cycles in one second. Return zero if the architecture
> + * support is not available.
> + */
> +static inline uint64_t
> +rte_rdtsc_arch_hz(void)
> +{
> + uint64_t freq;
> +
> + asm volatile("mrs %0, cntfrq_el0" : "=r" (freq));
> + return freq;
> +}
> +
> #else
> /**
> * This is an alternative method to enable rte_rdtsc() with high resolution
> @@ -85,6 +102,19 @@ rte_rdtsc(void)
> asm volatile("mrs %0, pmccntr_el0" : "=r"(tsc));
> return tsc;
> }
> +
> +/**
> + * Get the number of rdtsc cycles in one second if the architecture supports.
> + *
> + * @return
> + * The number of rdtsc cycles in one second. Return zero if the architecture
> + * support is not available.
> + */
> +static inline uint64_t
> +rte_rdtsc_arch_hz(void)
> +{
> + return 0;
> +}
> #endif
>
> static inline uint64_t
> --
> 2.14.0
>
Acked-by: Jianbo Liu <jianbo.liu@linaro.org>
next prev parent reply other threads:[~2017-08-15 3:35 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 [this message]
2017-08-13 7:03 ` [dpdk-dev] [PATCH 5/5] eal/timer: honor architecture specific rdtsc hz function Jerin Jacob
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=CAP4Qi38f+M2xvUf99Vu3rMCK68SPkHvxw6+rD3-WnN0Yr2ROGA@mail.gmail.com \
--to=jianbo.liu@linaro.org \
--cc=bruce.richardson@intel.com \
--cc=chaozhu@linux.vnet.ibm.com \
--cc=dev@dpdk.org \
--cc=jerin.jacob@caviumnetworks.com \
--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).