From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from dpdk.org (dpdk.org [92.243.14.124])
	by inbox.dpdk.org (Postfix) with ESMTP id A465BA0588;
	Fri, 17 Apr 2020 00:35:27 +0200 (CEST)
Received: from [92.243.14.124] (localhost [127.0.0.1])
	by dpdk.org (Postfix) with ESMTP id 5DC1B1DA7B;
	Fri, 17 Apr 2020 00:35:27 +0200 (CEST)
Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com
 [66.111.4.28]) by dpdk.org (Postfix) with ESMTP id B9A8E1DA74;
 Fri, 17 Apr 2020 00:35:25 +0200 (CEST)
Received: from compute7.internal (compute7.nyi.internal [10.202.2.47])
 by mailout.nyi.internal (Postfix) with ESMTP id 618E55C01C1;
 Thu, 16 Apr 2020 18:35:25 -0400 (EDT)
Received: from mailfrontend2 ([10.202.2.163])
 by compute7.internal (MEProxy); Thu, 16 Apr 2020 18:35:25 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h=
 from:to:cc:subject:date:message-id:in-reply-to:references
 :mime-version:content-transfer-encoding:content-type; s=mesmtp;
 bh=69ozMY5kR6pEuEsqX+zCnor3/aaCAWb0/aGNqp1bCPY=; b=e6dbUeFJOz9h
 4FiQfitv2KtqLgVun0nAn/4JHBV5fMV32CeYxKi5yuwqMUno3tynC1hT6jH6oYtG
 xzyGv4UW/G8/Z0Ea/nOdZiHiCmh45XZICDgqPqCqspxQXzACwLBF+Q5FYdIyMCd0
 oi8gLX8cReUZ0xccHwV4C9EyoWOmX7w=
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
 messagingengine.com; h=cc:content-transfer-encoding:content-type
 :date:from:in-reply-to:message-id:mime-version:references
 :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender
 :x-sasl-enc; s=fm2; bh=69ozMY5kR6pEuEsqX+zCnor3/aaCAWb0/aGNqp1bC
 PY=; b=v0e/AcZDDE5la8Lp1evPIlou9d9/tAvebpCSZeFi6OICu536Ig6ORuAUn
 7lmgOb/uv5oAM1xFGEBDO6+Yi8YsdTurSTcjMLJ5D+MklBR0VkS5wYhYpi35tOat
 fqXbA+RbFCZ7IYTCr/J9ZlOOO787z3c+C6C0Q9h4slrlIrNR1cL8FuAlycODONEv
 Ug61Mbe3TQrmbOpPeCfyV5aBwX4CGJHn2kjfLiLWwBz9jfAT3kNnaigohFsU5eOF
 Yfb6V9m2836R75CdnE6IvsU1fVipb2MUYH+2BX3CejHnxt41wrHwI6L1PWPhPX2P
 hPb4sicKEenzyA1rUrPAi+XoatABA==
X-ME-Sender: <xms:rd2YXsKs8nt4aOWAqfXyiogaUxudH7JG2gjiTBjhN_tLjGN9nIledQ>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduhedrfeeigddutdcutefuodetggdotefrodftvf
 curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu
 uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc
 fjughrpefhvffufffkjghfggfgtgesthhqredttddtjeenucfhrhhomhepvfhhohhmrghs
 ucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenucfkph
 epjeejrddufeegrddvtdefrddukeegnecuvehluhhsthgvrhfuihiivgeptdenucfrrghr
 rghmpehmrghilhhfrhhomhepthhhohhmrghssehmohhnjhgrlhhonhdrnhgvth
X-ME-Proxy: <xmx:rd2YXgR9VwZeOghOSsEaX6FVkh85zncbqRHbjq0FFhGXVGeCH1yhCg>
 <xmx:rd2YXpuRhk67ByRHM1PuxjBeDT0YZbjguwdRU0XWd6DgmDf75duSwg>
 <xmx:rd2YXj_d4r2RxNT1ISza228pw7YKArL-j4lSo-ncTkbys-xx0-e2QQ>
 <xmx:rd2YXs_37w-T48VGObCMvPfXTkw_pvFRU79xrhWp6E5-TrZrtzprsQ>
Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184])
 by mail.messagingengine.com (Postfix) with ESMTPA id 833E83060064;
 Thu, 16 Apr 2020 18:35:24 -0400 (EDT)
From: Thomas Monjalon <thomas@monjalon.net>
To: drc@linux.vnet.ibm.com
Cc: dev@dpdk.org, stable@dpdk.org, david.marchand@redhat.com,
 Thinh Tran <thinhtr@linux.vnet.ibm.com>
Date: Fri, 17 Apr 2020 00:35:23 +0200
Message-ID: <6156306.e8TTKsaY2g@thomas>
In-Reply-To: <20200325001356.147049-1-thinhtr@linux.vnet.ibm.com>
References: <20200325001356.147049-1-thinhtr@linux.vnet.ibm.com>
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset="UTF-8"
Subject: Re: [dpdk-dev] [PATCH v3] eal/ppc64: improve rte_rdtsc() with
	__ppc_get_timebase()
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org
Sender: "dev" <dev-bounces@dpdk.org>

Any review please?

25/03/2020 01:13, Thinh Tran:
>   __ppc_get_timebase() reads and returns the current value of the Time=20
>   Base Register. It's more efficient as it uses the processor=E2=80=99s t=
ime =20
>   base facility directly=20
>=20
>   the DPDK on FreeBSD currently is not supported on Powerpc64, it should
>   be safe to include the sys/platform/ppc.h
>=20
>=20
> Signed-off-by: Thinh Tran <thinhtr@linux.vnet.ibm.com>
> ---
>  .../common/include/arch/ppc_64/rte_cycles.h   | 28 ++-----------------
>  1 file changed, 2 insertions(+), 26 deletions(-)
>=20
> diff --git a/lib/librte_eal/common/include/arch/ppc_64/rte_cycles.h b/lib=
/librte_eal/common/include/arch/ppc_64/rte_cycles.h
> index 8f2e98642..871f9b6e4 100644
> --- a/lib/librte_eal/common/include/arch/ppc_64/rte_cycles.h
> +++ b/lib/librte_eal/common/include/arch/ppc_64/rte_cycles.h
> @@ -14,6 +14,7 @@ extern "C" {
> =20
>  #include <rte_byteorder.h>
>  #include <rte_common.h>
> +#include <sys/platform/ppc.h>
> =20
>  /**
>   * Read the time base register.
> @@ -24,32 +25,7 @@ extern "C" {
>  static inline uint64_t
>  rte_rdtsc(void)
>  {
> -	union {
> -		uint64_t tsc_64;
> -		RTE_STD_C11
> -		struct {
> -#if RTE_BYTE_ORDER =3D=3D RTE_BIG_ENDIAN
> -			uint32_t hi_32;
> -			uint32_t lo_32;
> -#else
> -			uint32_t lo_32;
> -			uint32_t hi_32;
> -#endif
> -		};
> -	} tsc;
> -	uint32_t tmp;
> -
> -	asm volatile(
> -			"0:\n"
> -			"mftbu   %[hi32]\n"
> -			"mftb    %[lo32]\n"
> -			"mftbu   %[tmp]\n"
> -			"cmpw    %[tmp],%[hi32]\n"
> -			"bne     0b\n"
> -			: [hi32] "=3Dr"(tsc.hi_32), [lo32] "=3Dr"(tsc.lo_32),
> -			[tmp] "=3Dr"(tmp)
> -		    );
> -	return tsc.tsc_64;
> +	return __ppc_get_timebase();
>  }
> =20
>  static inline uint64_t