From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id AE0FAA0524; Fri, 31 Jan 2020 23:04:12 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 8B5A71C0DC; Fri, 31 Jan 2020 23:04:12 +0100 (CET) Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by dpdk.org (Postfix) with ESMTP id 445CE1C0D3 for ; Fri, 31 Jan 2020 23:04:11 +0100 (CET) Received: from pps.filterd (m0098413.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 00VM0bN7082232 for ; Fri, 31 Jan 2020 17:04:10 -0500 Received: from ppma01dal.us.ibm.com (83.d6.3fa9.ip4.static.sl-reverse.com [169.63.214.131]) by mx0b-001b2d01.pphosted.com with ESMTP id 2xvq5mb4g8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 31 Jan 2020 17:04:10 -0500 Received: from pps.filterd (ppma01dal.us.ibm.com [127.0.0.1]) by ppma01dal.us.ibm.com (8.16.0.27/8.16.0.27) with SMTP id 00VM3gt0004288 for ; Fri, 31 Jan 2020 22:04:09 GMT Received: from b01cxnp23034.gho.pok.ibm.com (b01cxnp23034.gho.pok.ibm.com [9.57.198.29]) by ppma01dal.us.ibm.com with ESMTP id 2xrda7wve0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 31 Jan 2020 22:04:09 +0000 Received: from b01ledav006.gho.pok.ibm.com (b01ledav006.gho.pok.ibm.com [9.57.199.111]) by b01cxnp23034.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 00VM48rd10748180 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 31 Jan 2020 22:04:08 GMT Received: from b01ledav006.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id BFE5EAC094; Fri, 31 Jan 2020 22:04:08 +0000 (GMT) Received: from b01ledav006.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A9FC1AC081; Fri, 31 Jan 2020 22:04:08 +0000 (GMT) Received: from ltc17u31.pok.stglabs.ibm.com (unknown [9.114.224.16]) by b01ledav006.gho.pok.ibm.com (Postfix) with ESMTP; Fri, 31 Jan 2020 22:04:08 +0000 (GMT) From: Thinh Tran To: dev@dpdk.org Cc: drc@linux.vnet.ibm.com, Thinh Tran Date: Fri, 31 Jan 2020 17:03:36 -0500 Message-Id: <20200131220336.103874-1-thinhtr@linux.vnet.ibm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200128210233.691-1-thinhtr@linux.vnet.ibm.com> References: <20200128210233.691-1-thinhtr@linux.vnet.ibm.com> X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138, 18.0.572 definitions=2020-01-31_07:2020-01-31, 2020-01-31 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 bulkscore=0 phishscore=0 mlxlogscore=536 lowpriorityscore=0 impostorscore=0 mlxscore=0 adultscore=0 suspectscore=1 spamscore=0 clxscore=1015 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-1911200001 definitions=main-2001310176 Subject: [dpdk-dev] [PATCH v2] 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" __ppc_get_timebase() is GNU extension and is more efficient v2: Advoid breaking other ppc_64 flatforms. The __ppc_get_timebase() seems to be specific to powerpc platform and with GLIBC. Signed-off-by: Thinh Tran --- lib/librte_eal/common/include/arch/ppc_64/rte_cycles.h | 7 +++++++ 1 file changed, 7 insertions(+) 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..1c3fd556e 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,9 @@ extern "C" { #include #include +#if defined(__powerpc__) && defined(__GLIBC__) +#include +#endif /** * Read the time base register. @@ -24,6 +27,9 @@ extern "C" { static inline uint64_t rte_rdtsc(void) { +#if defined(__powerpc__) && defined(__GLIBC__) + return __ppc_get_timebase(); +#else union { uint64_t tsc_64; RTE_STD_C11 @@ -50,6 +56,7 @@ rte_rdtsc(void) [tmp] "=r"(tmp) ); return tsc.tsc_64; +#endif /* __powerpc__ && __GLIBC__ */ } static inline uint64_t -- 2.17.1