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 334B9A0524; Fri, 31 Jan 2020 16:13:09 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 107081C10A; Fri, 31 Jan 2020 16:13:09 +0100 (CET) Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by dpdk.org (Postfix) with ESMTP id 91CE21C0CF for ; Fri, 31 Jan 2020 16:13:07 +0100 (CET) Received: from pps.filterd (m0098399.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 00VF6FW1042032 for ; Fri, 31 Jan 2020 10:13:06 -0500 Received: from ppma01dal.us.ibm.com (83.d6.3fa9.ip4.static.sl-reverse.com [169.63.214.131]) by mx0a-001b2d01.pphosted.com with ESMTP id 2xvbehtvhb-3 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 31 Jan 2020 10:13:06 -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 00VEoY3S008994 for ; Fri, 31 Jan 2020 14:54:04 GMT Received: from b01cxnp22036.gho.pok.ibm.com (b01cxnp22036.gho.pok.ibm.com [9.57.198.26]) by ppma01dal.us.ibm.com with ESMTP id 2xrda7tk6j-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 31 Jan 2020 14:54:04 +0000 Received: from b01ledav003.gho.pok.ibm.com (b01ledav003.gho.pok.ibm.com [9.57.199.108]) by b01cxnp22036.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 00VEs3Vl13829106 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 31 Jan 2020 14:54:03 GMT Received: from b01ledav003.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A803BB205F; Fri, 31 Jan 2020 14:54:03 +0000 (GMT) Received: from b01ledav003.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 76804B2066; Fri, 31 Jan 2020 14:54:03 +0000 (GMT) Received: from [9.41.98.98] (unknown [9.41.98.98]) by b01ledav003.gho.pok.ibm.com (Postfix) with ESMTP; Fri, 31 Jan 2020 14:54:03 +0000 (GMT) To: dev@dpdk.org Cc: drc@linux.vnet.ibm.com References: <20200128210233.691-1-thinhtr@linux.vnet.ibm.com> From: Thinh Tran Message-ID: <49e369df-b726-c52a-2743-b006febdc28f@linux.vnet.ibm.com> Date: Fri, 31 Jan 2020 08:54:04 -0600 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.4.2 MIME-Version: 1.0 In-Reply-To: <20200128210233.691-1-thinhtr@linux.vnet.ibm.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit 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_03:2020-01-31, 2020-01-31 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=1 lowpriorityscore=0 spamscore=0 priorityscore=1501 malwarescore=0 bulkscore=0 mlxlogscore=881 adultscore=0 clxscore=1015 mlxscore=0 phishscore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-1911200001 definitions=main-2001310128 Subject: Re: [dpdk-dev] [PATCH] 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" Need to resubmit a new patch, since the same code may be used by other ppc platform such as FreeBSD that may not have the sys/platform/ppc.h Thinh Tran On 1/28/2020 3:02 PM, Thinh Tran wrote: > __ppc_get_timebase() is GNU extention and is more efficient > > Signed-off-by: Thinh Tran > --- > .../common/include/arch/ppc_64/rte_cycles.h | 28 ++----------------- > 1 file changed, 2 insertions(+), 26 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 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" { > > #include > #include > +#include > > /** > * 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 == 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] "=r"(tsc.hi_32), [lo32] "=r"(tsc.lo_32), > - [tmp] "=r"(tmp) > - ); > - return tsc.tsc_64; > + return __ppc_get_timebase(); > } > > static inline uint64_t >