From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chao Zhu Subject: [PATCH] PPC64: add cpu cycle support to IBM POWER8 PPC64LE Date: Mon, 3 Aug 2015 15:16:18 +0800 Message-ID: <1438586178-19555-2-git-send-email-chaozhu@linux.vnet.ibm.com> References: <1438586178-19555-1-git-send-email-chaozhu@linux.vnet.ibm.com> To: dev@dpdk.org Return-path: Received: from e28smtp05.in.ibm.com (e28smtp05.in.ibm.com [122.248.162.5]) by dpdk.org (Postfix) with ESMTP id EB2B6C40A for ; Mon, 3 Aug 2015 09:14:31 +0200 (CEST) Received: from /spool/local by e28smtp05.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 3 Aug 2015 12:44:30 +0530 Received: from d28relay01.in.ibm.com (d28relay01.in.ibm.com [9.184.220.58]) by d28dlp02.in.ibm.com (Postfix) with ESMTP id 73E303940067 for ; Mon, 3 Aug 2015 12:44:27 +0530 (IST) Received: from d28av05.in.ibm.com (d28av05.in.ibm.com [9.184.220.67]) by d28relay01.in.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id t737EO6G27918520 for ; Mon, 3 Aug 2015 12:44:24 +0530 Received: from d28av05.in.ibm.com (localhost [127.0.0.1]) by d28av05.in.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id t737EN2t014688 for ; Mon, 3 Aug 2015 12:44:23 +0530 Received: from os_controller.crl.ibm.com ([9.186.57.26]) by d28av05.in.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id t737ELE8014417 for ; Mon, 3 Aug 2015 12:44:22 +0530 In-Reply-To: <1438586178-19555-1-git-send-email-chaozhu@linux.vnet.ibm.com> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On IBM POWER8 PPC64 little endian architecture, the definition of tsc union will be different. This patch fix this to enable the right output from rte_rdtsc(). Signed-off-by: Chao Zhu --- .../common/include/arch/ppc_64/rte_cycles.h | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) 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 fd26e8e..e663c48 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 @@ -51,8 +51,13 @@ rte_rdtsc(void) union { uint64_t tsc_64; struct { +#if RTE_BYTE_ORDER == 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; -- 1.7.1