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 806F9A056E; Wed, 11 Mar 2020 21:27:03 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 6F7A21BF7F; Wed, 11 Mar 2020 21:27:02 +0100 (CET) Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by dpdk.org (Postfix) with ESMTP id ADCD82BE6 for ; Wed, 11 Mar 2020 21:27:00 +0100 (CET) Received: from pps.filterd (m0098416.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 02BKQR7Z183438 for ; Wed, 11 Mar 2020 16:26:59 -0400 Received: from pps.reinject (localhost [127.0.0.1]) by mx0b-001b2d01.pphosted.com with ESMTP id 2yq6p6s7ry-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 11 Mar 2020 16:26:57 -0400 Received: from m0098416.ppops.net (m0098416.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id 02BKQThf183521 for ; Wed, 11 Mar 2020 16:26:49 -0400 Received: from ppma04wdc.us.ibm.com (1a.90.2fa9.ip4.static.sl-reverse.com [169.47.144.26]) by mx0b-001b2d01.pphosted.com with ESMTP id 2yq6p6s781-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 11 Mar 2020 16:26:48 -0400 Received: from pps.filterd (ppma04wdc.us.ibm.com [127.0.0.1]) by ppma04wdc.us.ibm.com (8.16.0.27/8.16.0.27) with SMTP id 02BKOYnA018183; Wed, 11 Mar 2020 20:26:33 GMT Received: from b03cxnp08026.gho.boulder.ibm.com (b03cxnp08026.gho.boulder.ibm.com [9.17.130.18]) by ppma04wdc.us.ibm.com with ESMTP id 2ypjxr7j41-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 11 Mar 2020 20:26:33 +0000 Received: from b03ledav004.gho.boulder.ibm.com (b03ledav004.gho.boulder.ibm.com [9.17.130.235]) by b03cxnp08026.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 02BKQWb755640546 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 11 Mar 2020 20:26:32 GMT Received: from b03ledav004.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 132A378069; Wed, 11 Mar 2020 20:26:32 +0000 (GMT) Received: from b03ledav004.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D099B7805C; Wed, 11 Mar 2020 20:26:31 +0000 (GMT) Received: from [9.41.98.98] (unknown [9.41.98.98]) by b03ledav004.gho.boulder.ibm.com (Postfix) with ESMTP; Wed, 11 Mar 2020 20:26:31 +0000 (GMT) To: David Marchand Cc: dev , David Christensen References: <20200128210233.691-1-thinhtr@linux.vnet.ibm.com> <20200131220336.103874-1-thinhtr@linux.vnet.ibm.com> From: Thinh Tran Message-ID: Date: Wed, 11 Mar 2020 15:26:31 -0500 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 MIME-Version: 1.0 In-Reply-To: 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-03-11_11:2020-03-11, 2020-03-11 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 malwarescore=0 suspectscore=0 adultscore=0 spamscore=0 bulkscore=0 priorityscore=1501 lowpriorityscore=0 phishscore=0 impostorscore=0 mlxlogscore=999 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2001150001 definitions=main-2003110113 Subject: Re: [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" Hi David, Thanks for your response. We were worry about breaking the DPDK/FreeBSD on power, may hit the similar bug: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=241146 From my understanding, and also from the documentation https://doc.dpdk.org/guides/freebsd_gsg/install_from_ports.html DPDK is supported, glibc may not be required by default, and it is not clear what the supported architectures are. So if FreeBSD does not support DPDK on powerpc or FreeBSD supports DPDK on powerpc and requires glibc installed, then the GLIBC guard can be removed This is unknown to me. Agreed. __powerpc__ guard is not necessary in this path and will be removed. Thanks, Thinh Tran On 3/10/2020 7:55 AM, David Marchand wrote: > On Fri, Jan 31, 2020 at 11:04 PM Thinh Tran wrote: >> >> __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. > > dpdk only supports glibc at the moment. > https://doc.dpdk.org/guides/linux_gsg/sys_reqs.html#system-software > > Now the 1M$ question is which C library are you using and on which platform :-). > >> >> 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 > > libc headers must come first: > https://doc.dpdk.org/guides/contributing/coding_style.html#header-includes > > Why do you need the __powerpc__ guard? > >> >> /** >> * 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 >> > >