dev.dpdk.org archive mirror
 help / color / mirror / Atom feed
From: Chao Zhu <chaozhu@linux.vnet.ibm.com>
To: dev@dpdk.org
Subject: [PATCH] PPC64: add cpu cycle support to IBM POWER8 PPC64LE
Date: Mon,  3 Aug 2015 15:16:18 +0800	[thread overview]
Message-ID: <1438586178-19555-2-git-send-email-chaozhu@linux.vnet.ibm.com> (raw)
In-Reply-To: <1438586178-19555-1-git-send-email-chaozhu@linux.vnet.ibm.com>

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 <chaozhu@linux.vnet.ibm.com>
---
 .../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

  reply	other threads:[~2015-08-03  7:14 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-03  7:16 [PATCH] PPC64: add cpu cycle support to IBM POWER8 PPC64LE Chao Zhu
2015-08-03  7:16 ` Chao Zhu [this message]
2015-08-03 10:45   ` Thomas Monjalon

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=1438586178-19555-2-git-send-email-chaozhu@linux.vnet.ibm.com \
    --to=chaozhu@linux.vnet.ibm.com \
    --cc=dev@dpdk.org \
    /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).