From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id D14C9A0C46; Fri, 7 May 2021 22:29:11 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9C6464013F; Fri, 7 May 2021 22:29:11 +0200 (CEST) Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by mails.dpdk.org (Postfix) with ESMTP id 1224C40040 for ; Fri, 7 May 2021 22:29:10 +0200 (CEST) Received: from pps.filterd (m0098421.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 147K4a9A078372; Fri, 7 May 2021 16:29:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=subject : to : cc : references : from : message-id : date : mime-version : in-reply-to : content-type : content-transfer-encoding; s=pp1; bh=mytAWi1rtfiY2LdFZK4NPZZTWSLnVTDObA9kjKhj59c=; b=ebxqQTJj51FVj2B9dCbfw16uea7UmrudGDySAu40rHLt2arW1yEMKfvg0N6gPSgGquWl IWSk6B4BM5g9dTaB00cUcmTqQTz17Dy3TXOpeTPZVqS97HSb8boDiMiAHgBAVEVd2kMx oCIMf9FXAkpT+zdlyUw1GSY4cwITE/xMLUjLKyOt/tMErzGiCWQIObsJ2FxglIdC0Gwt a7mdWYcbLR2IxZkzb0/3LRdtA3ACmsYQf93S4yVC2dpZ/u01eRK59NcnHlvZ2MMwbk0q Safr9LLbvRSOkNGdjsSkFKnSj/vv17PEWEp5+3OpBfP9kW5ApngmAgF8EnAQjxrEdyNG VA== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 38d8yteahk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 07 May 2021 16:29:00 -0400 Received: from m0098421.ppops.net (m0098421.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.43/8.16.0.43) with SMTP id 147K5Nkg085850; Fri, 7 May 2021 16:28:59 -0400 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 38d8yteahe-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 07 May 2021 16:28:59 -0400 Received: from pps.filterd (ppma01dal.us.ibm.com [127.0.0.1]) by ppma01dal.us.ibm.com (8.16.0.43/8.16.0.43) with SMTP id 147KQJoY023678; Fri, 7 May 2021 20:28:59 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 38csqr7y9v-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 07 May 2021 20:28:59 +0000 Received: from b01ledav001.gho.pok.ibm.com (b01ledav001.gho.pok.ibm.com [9.57.199.106]) by b01cxnp23034.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 147KSw7236307452 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 7 May 2021 20:28:58 GMT Received: from b01ledav001.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 2A7D1341ED; Fri, 7 May 2021 20:28:58 +0000 (GMT) Received: from b01ledav001.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 8D7A7347FF; Fri, 7 May 2021 20:28:56 +0000 (GMT) Received: from Davids-MBP.randomparity.org (unknown [9.211.102.205]) by b01ledav001.gho.pok.ibm.com (Postfix) with ESMTP; Fri, 7 May 2021 20:28:56 +0000 (GMT) To: Piotr Kubaj , David Marchand Cc: Nicolas Chautru , Declan Doherty , Ajit Khaparde , Somnath Kotur , Beilei Xing , Jeff Guo , "Wang, Haiyue" , Jiawen Wu , Jian Wang , dev References: <20210311161140.70534-1-pkubaj@FreeBSD.org> <2a3387dc-c9b7-2053-16f3-e4b595341eba@linux.vnet.ibm.com> From: David Christensen Message-ID: <082cada4-05cd-6029-600e-da7b6680310e@linux.vnet.ibm.com> Date: Fri, 7 May 2021 13:28:55 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 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-ORIG-GUID: YDWVr3YFYPJmvuuXEkjDV9k8f5DlEiEs X-Proofpoint-GUID: EisXCPFhZQu9Z5AWW4umaxgfr8ZCZzJz X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391, 18.0.761 definitions=2021-05-07_08:2021-05-06, 2021-05-07 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 bulkscore=0 mlxlogscore=999 priorityscore=1501 phishscore=0 adultscore=0 clxscore=1011 suspectscore=0 lowpriorityscore=0 mlxscore=0 malwarescore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2105070131 Subject: Re: [dpdk-dev] [PATCH] ppc64le: fix build with Clang and without glibc X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 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" On 5/5/21 3:39 PM, Piotr Kubaj wrote: > diff --git a/lib/librte_eal/ppc/include/rte_altivec.h b/lib/librte_eal/ppc/include/rte_altivec.h > index 1551a9454..3fcc819c1 100644 > --- a/lib/librte_eal/ppc/include/rte_altivec.h > +++ b/lib/librte_eal/ppc/include/rte_altivec.h > @@ -7,6 +7,9 @@ > #define_RTE_ALTIVEC_H_ > > /* To include altivec.h, GCC version must be >= 4.8 */ > +#ifdef __clang__ > +#define vector __vector > +#endif > #include > > /* > diff --git a/lib/librte_eal/ppc/include/rte_cycles.h b/lib/librte_eal/ppc/include/rte_cycles.h > index 5585f9273..a8307ceaf 100644 > --- a/lib/librte_eal/ppc/include/rte_cycles.h > +++ b/lib/librte_eal/ppc/include/rte_cycles.h > @@ -10,7 +10,13 @@ > extern "C" { > #endif > > +#ifdef linux > +#include > +#endif > + > +#ifdef __GLIBC__ > #include > +#endif > > #include "generic/rte_cycles.h" > > @@ -26,7 +32,13 @@ extern "C" { > static inline uint64_t > rte_rdtsc(void) > { > +#ifdef __GLIBC__ > return __ppc_get_timebase(); > +#else > + uint64_t __tb; > + __asm__ volatile ("mfspr %0, 268" : "=r" (__tb)); > + return __tb; > +#endif > } > > static inline uint64_t > diff --git a/lib/librte_eal/ppc/rte_cycles.c b/lib/librte_eal/ppc/rte_cycles.c > index 3180adb0f..48545c4d6 100644 > --- a/lib/librte_eal/ppc/rte_cycles.c > +++ b/lib/librte_eal/ppc/rte_cycles.c > @@ -2,12 +2,28 @@ > * Copyright (C) IBM Corporation 2019. > */ > > +#ifdef linux > +#include > +#elif defined(__FreeBSD__) > +#include > +#include > +#endif > + > +#ifdef __GLIBC__ > #include > +#endif > > #include "eal_private.h" > > uint64_t > get_tsc_freq_arch(void) > { > +#ifdef __GLIBC__ > return __ppc_get_timebase_freq(); > +#elif defined(__FreeBSD__) > + uint64_t freq; > + size_t length = sizeof(freq); > + sysctlbyname("kern.timecounter.tc.timebase.frequency", &freq, &length, NULL, 0); > + return freq; > +#endif > } > -- > 2.31.0 Reviewed-by: David Christensen