From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-yw0-f180.google.com (mail-yw0-f180.google.com [209.85.161.180]) by dpdk.org (Postfix) with ESMTP id 876727D12 for ; Tue, 15 Aug 2017 05:35:16 +0200 (CEST) Received: by mail-yw0-f180.google.com with SMTP id l82so65642159ywc.2 for ; Mon, 14 Aug 2017 20:35:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=jMpyQALh5dZpGypsB60IP7fEBKDBirO5MKbpSaiqLaI=; b=RSYE4PJXvIhpE/HaxuFzxdDDMxx3yyXRDj5RDxbRdM5dma35Rna9FrETy1vBSJNZFp ZSIX5mcMf/jOHKRDNVrSFp8OATAwZJqu3d2QsnlL3MtClnEgcytPmH62L/Ix9/3GwdkG ILzsEJpwTBDCKODW0qwv6+tMA3tG2g1mwIxlk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=jMpyQALh5dZpGypsB60IP7fEBKDBirO5MKbpSaiqLaI=; b=QDhWcvOiljMat9Xa3Z9TEXKDvwPIVE+y/BvCeQCXXqOv+8YKhyvaCKQKpZ7V2CKme+ l//p/sF0D896lJfkSyB5F9RcwdTfn2tbMFr4RXTCjLk1LjKkzfYAQlTr549ZN0MS2LMb lXAMsseG+opd9HRssla69mP7gdbhJMKWpypXbxrQl8UAcdjEMkCK7hKJgmQx1ZSkWEhg Qf9r8SxsuwrXDnep7R9SNbFExDYS/XvKHwk+6M8QGU5Q9V9yerTvouvtdUKk5d6Ek0EX c/UuF7rCZN0/chJKnMSpp36oXxlEz4uLPxZe20VKPaXM9aUZfS0sZP44uQnavygMQcPw Cs1g== X-Gm-Message-State: AHYfb5jzIEoOWCcKB/sfM2vZeOwB11ezwQm93LDz6cDQYZmtiYlFZgsu woXr9EiQAVYOvW/OMb6ueHUpDyjaBff8 X-Received: by 10.13.211.197 with SMTP id v188mr21721867ywd.43.1502768115742; Mon, 14 Aug 2017 20:35:15 -0700 (PDT) MIME-Version: 1.0 Received: by 10.37.0.8 with HTTP; Mon, 14 Aug 2017 20:35:15 -0700 (PDT) In-Reply-To: <20170813070350.13700-5-jerin.jacob@caviumnetworks.com> References: <20170813070350.13700-1-jerin.jacob@caviumnetworks.com> <20170813070350.13700-5-jerin.jacob@caviumnetworks.com> From: Jianbo Liu Date: Tue, 15 Aug 2017 11:35:15 +0800 Message-ID: To: Jerin Jacob Cc: dev@dpdk.org, Thomas Monjalon , Bruce Richardson , "Ananyev, Konstantin" , Jan Viktorin , Chao Zhu Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [PATCH 4/5] eal/armv8: define architecture specific rdtsc hz X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Aug 2017 03:35:16 -0000 On 13 August 2017 at 15:03, Jerin Jacob 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 > Signed-off-by: Jerin Jacob > --- > .../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