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 27C71A00BE; Tue, 28 Apr 2020 18:52:43 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E3B9A1D61D; Tue, 28 Apr 2020 18:52:42 +0200 (CEST) Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by dpdk.org (Postfix) with ESMTP id 77CFD1D61A for ; Tue, 28 Apr 2020 18:52:41 +0200 (CEST) Received: from pps.filterd (m0098420.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 03SGX1io005804; Tue, 28 Apr 2020 12:52:40 -0400 Received: from pps.reinject (localhost [127.0.0.1]) by mx0b-001b2d01.pphosted.com with ESMTP id 30pqr099bh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 28 Apr 2020 12:52:40 -0400 Received: from m0098420.ppops.net (m0098420.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id 03SGhM28033666; Tue, 28 Apr 2020 12:52:40 -0400 Received: from ppma01wdc.us.ibm.com (fd.55.37a9.ip4.static.sl-reverse.com [169.55.85.253]) by mx0b-001b2d01.pphosted.com with ESMTP id 30pqr099ay-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 28 Apr 2020 12:52:40 -0400 Received: from pps.filterd (ppma01wdc.us.ibm.com [127.0.0.1]) by ppma01wdc.us.ibm.com (8.16.0.27/8.16.0.27) with SMTP id 03SGomQn011589; Tue, 28 Apr 2020 16:52:39 GMT Received: from b03cxnp08028.gho.boulder.ibm.com (b03cxnp08028.gho.boulder.ibm.com [9.17.130.20]) by ppma01wdc.us.ibm.com with ESMTP id 30mcu6dk2j-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 28 Apr 2020 16:52:39 +0000 Received: from b03ledav004.gho.boulder.ibm.com (b03ledav004.gho.boulder.ibm.com [9.17.130.235]) by b03cxnp08028.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 03SGqcZE13369784 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 28 Apr 2020 16:52:38 GMT Received: from b03ledav004.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 42B847805C; Tue, 28 Apr 2020 16:52:38 +0000 (GMT) Received: from b03ledav004.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C4CA17805F; Tue, 28 Apr 2020 16:52:37 +0000 (GMT) Received: from ltc17u31.pok.stglabs.ibm.com (unknown [9.114.224.16]) by b03ledav004.gho.boulder.ibm.com (Postfix) with ESMTP; Tue, 28 Apr 2020 16:52:37 +0000 (GMT) From: Thinh Tran To: dev@dpdk.org Cc: drc@linux.vnet.ibm.com, david.marchand@redhat.com, jerinjacobk@gmail.com, orika@mellanox.com, Thinh Tran Date: Tue, 28 Apr 2020 12:52:30 -0400 Message-Id: <20200428165230.22589-1-thinhtr@linux.vnet.ibm.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138, 18.0.676 definitions=2020-04-28_11:2020-04-28, 2020-04-28 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=1 mlxscore=0 lowpriorityscore=0 mlxlogscore=999 clxscore=1011 bulkscore=0 priorityscore=1501 adultscore=0 phishscore=0 spamscore=0 impostorscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2004280126 Subject: [dpdk-dev] [PATCH] PPC64: fix boolean type conflict 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" The altivec.h on PPC64 breaks boolean type: In file included from ../lib/librte_mempool/rte_mempool_trace_fp.h:18:0, from ../lib/librte_mempool/rte_mempool.h:54, from ../lib/librte_mbuf/rte_mbuf.h:38, from ../lib/librte_net/rte_ether.h:23, from ../drivers/common/mlx5/mlx5_nl.h:10, from ../drivers/common/mlx5/mlx5_nl.c:23: ../lib/librte_eal/include/rte_trace_point.h: In function ‘__rte_trace_point_fp_is_enabled’: ../lib/librte_eal/include/rte_trace_point.h:226:9: error: incompatible types when returning type ‘int’ but ‘__vector __bool int {aka __vector(4) __bool int}’ was expected return false; It needs to be redefinded as in the stdbool.h Signed-off-by: Thinh Tran --- drivers/common/mlx5/mlx5_common.h | 10 ---------- drivers/net/mlx4/mlx4_utils.h | 10 ---------- drivers/net/mlx5/mlx5_utils.h | 10 ---------- lib/librte_eal/ppc/include/rte_memcpy.h | 4 ++++ 4 files changed, 4 insertions(+), 30 deletions(-) diff --git a/drivers/common/mlx5/mlx5_common.h b/drivers/common/mlx5/mlx5_common.h index 16de1b397..c2d688a9b 100644 --- a/drivers/common/mlx5/mlx5_common.h +++ b/drivers/common/mlx5/mlx5_common.h @@ -17,16 +17,6 @@ #include "mlx5_prm.h" -/* - * Compilation workaround for PPC64 when AltiVec is fully enabled, e.g. std=c11. - * Otherwise there would be a type conflict between stdbool and altivec. - */ -#if defined(__PPC64__) && !defined(__APPLE_ALTIVEC__) -#undef bool -/* redefine as in stdbool.h */ -#define bool _Bool -#endif - /* Bit-field manipulation. */ #define BITFIELD_DECLARE(bf, type, size) \ type bf[(((size_t)(size) / (sizeof(type) * CHAR_BIT)) + \ diff --git a/drivers/net/mlx4/mlx4_utils.h b/drivers/net/mlx4/mlx4_utils.h index b8769562a..095958f3d 100644 --- a/drivers/net/mlx4/mlx4_utils.h +++ b/drivers/net/mlx4/mlx4_utils.h @@ -14,16 +14,6 @@ #include "mlx4.h" -/* - * Compilation workaround for PPC64 when AltiVec is fully enabled, e.g. std=c11. - * Otherwise there would be a type conflict between stdbool and altivec. - */ -#if defined(__PPC64__) && !defined(__APPLE_ALTIVEC__) -#undef bool -/* redefine as in stdbool.h */ -#define bool _Bool -#endif - extern int mlx4_logtype; #ifdef RTE_LIBRTE_MLX4_DEBUG diff --git a/drivers/net/mlx5/mlx5_utils.h b/drivers/net/mlx5/mlx5_utils.h index d81ace394..0e016f87c 100644 --- a/drivers/net/mlx5/mlx5_utils.h +++ b/drivers/net/mlx5/mlx5_utils.h @@ -21,16 +21,6 @@ #include "mlx5_defs.h" -/* - * Compilation workaround for PPC64 when AltiVec is fully enabled, e.g. std=c11. - * Otherwise there would be a type conflict between stdbool and altivec. - */ -#if defined(__PPC64__) && !defined(__APPLE_ALTIVEC__) -#undef bool -/* redefine as in stdbool.h */ -#define bool _Bool -#endif - /* Convert a bit number to the corresponding 64-bit mask */ #define MLX5_BITSHIFT(v) (UINT64_C(1) << (v)) diff --git a/lib/librte_eal/ppc/include/rte_memcpy.h b/lib/librte_eal/ppc/include/rte_memcpy.h index 25311ba1d..abeede231 100644 --- a/lib/librte_eal/ppc/include/rte_memcpy.h +++ b/lib/librte_eal/ppc/include/rte_memcpy.h @@ -11,6 +11,10 @@ /*To include altivec.h, GCC version must >= 4.8 */ #include +/* redefine as in stdbool.h after altivec.h */ +#undef bool +#define bool _Bool + #ifdef __cplusplus extern "C" { #endif -- 2.17.1