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 86B82A04A2; Wed, 6 Nov 2019 06:45:42 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A54CF1BFBB; Wed, 6 Nov 2019 06:45:41 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by dpdk.org (Postfix) with ESMTP id C4BDD1BE97 for ; Wed, 6 Nov 2019 06:45:39 +0100 (CET) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id xA65j9es016543; Tue, 5 Nov 2019 21:45:39 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type : content-transfer-encoding; s=pfpt0818; bh=SqXCOTd9xXrtGLnufgpII4NSguFxcWnEaNGgsGutKgw=; b=QMW6scNx67aA7H6QAFXFzYgYD2PFE2/l9/DGY+Nx76jL+Z0WFLnbl39W03YMSE/bWf3f 9Z7sY7E4QRyyfQcap5QJbDStUlmEg9MRDCef2/YTVQ3Al77gEAV6eZD1vpSLgTsTBX2+ u2wAR6f6gtksiKJrIStQQMcK+Tpj99zujpFKtot+zWSsu9AY+aO2Pp5YaqsDfz5A9zjL 4zCdxZ7OSPmSA0/VhD4nA9JIPHzVVDa1xC/JD63cRLnIMiVqpoZ27GdhXGAWwM1zNb/X g7Q3x0vA6CdvMZV4ZGPk005y2Y6EnVYB2LpZXWc/beLe/CAiRG+90P43gBYFm4GTcr7g ug== Received: from sc-exch01.marvell.com ([199.233.58.181]) by mx0b-0016f401.pphosted.com with ESMTP id 2w19amxfx3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Tue, 05 Nov 2019 21:45:38 -0800 Received: from SC-EXCH01.marvell.com (10.93.176.81) by SC-EXCH01.marvell.com (10.93.176.81) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Tue, 5 Nov 2019 21:45:36 -0800 Received: from maili.marvell.com (10.93.176.43) by SC-EXCH01.marvell.com (10.93.176.81) with Microsoft SMTP Server id 15.0.1367.3 via Frontend Transport; Tue, 5 Nov 2019 21:45:36 -0800 Received: from irv1user08.caveonetworks.com (unknown [10.104.116.105]) by maili.marvell.com (Postfix) with ESMTP id B5B293F703F; Tue, 5 Nov 2019 21:45:36 -0800 (PST) Received: (from rmody@localhost) by irv1user08.caveonetworks.com (8.14.4/8.14.4/Submit) id xA65jZlE019648; Tue, 5 Nov 2019 21:45:35 -0800 X-Authentication-Warning: irv1user08.caveonetworks.com: rmody set sender to rmody@marvell.com using -f From: Rasesh Mody To: Thomas Monjalon , "dev @ dpdk . org" , Bruce Richardson , Ferruh Yigit , Jerin Jacob Kollanukkaran CC: Rasesh Mody , GR-Everest-DPDK-Dev Date: Tue, 5 Nov 2019 21:45:20 -0800 Message-ID: <20191106054520.19580-1-rmody@marvell.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20191101060228.23271-1-rmody@marvell.com> References: <20191101060228.23271-1-rmody@marvell.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.95,18.0.572 definitions=2019-11-06_01:2019-11-05,2019-11-06 signatures=0 Subject: [dpdk-dev] [PATCH v2] net/bnx2x: fix meson build failure 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" Use kernel headers for __le* types to avoid potential conflicts resulting in redefinition errors for Linux build environments. Add check for FreeBSD execution environments. Without this fix, aarch64 builds can fail with error [1] below. [1] In file included from ../drivers/net/bnx2x/bnx2x.h:22, from ../drivers/net/bnx2x/bnx2x_ethdev.c:8: ../drivers/net/bnx2x/bnx2x_osal.h:27:17: error: conflicting types for ‘uint64_t’ #define __le64 uint64_t ^~~~~~~~ In file included from /usr/include/stdint.h:37, from /usr/lib/gcc/aarch64-linux-gnu/8/include/stdint.h:9, from ../lib/librte_eal/common/include/arch/arm/rte_byteorder.h:16, from ../drivers/net/bnx2x/bnx2x.h:17, from ../drivers/net/bnx2x/bnx2x_ethdev.c:8: /usr/include/aarch64-linux-gnu/bits/stdint-uintn.h:27:20: note: previous declaration of ‘uint64_t’ was here typedef __uint64_t uint64_t; ^~~~~~~~ Fixes: 38dff79ba736 ("net/bnx2x: update HSI") v2: Use RTE_EXEC_ENV_FREEBSD in place of __FreeBSD__ Signed-off-by: Rasesh Mody Tested-by: Dharmik Thakkar Tested-by: Gavin Hu --- drivers/net/bnx2x/bnx2x.c | 4 ++-- drivers/net/bnx2x/bnx2x.h | 4 ++-- drivers/net/bnx2x/bnx2x_osal.h | 6 ++++++ 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/drivers/net/bnx2x/bnx2x.c b/drivers/net/bnx2x/bnx2x.c index e1dfe602c..ed31335ac 100644 --- a/drivers/net/bnx2x/bnx2x.c +++ b/drivers/net/bnx2x/bnx2x.c @@ -9581,7 +9581,7 @@ static int bnx2x_pci_get_caps(struct bnx2x_softc *sc) return -ENOMEM; } -#ifndef __FreeBSD__ +#ifndef RTE_EXEC_ENV_FREEBSD pci_read(sc, PCI_STATUS, &status, 2); if (!(status & PCI_STATUS_CAP_LIST)) { #else @@ -9592,7 +9592,7 @@ static int bnx2x_pci_get_caps(struct bnx2x_softc *sc) return -1; } -#ifndef __FreeBSD__ +#ifndef RTE_EXEC_ENV_FREEBSD pci_read(sc, PCI_CAPABILITY_LIST, &pci_cap.next, 1); #else pci_read(sc, PCIR_CAP_PTR, &pci_cap.next, 1); diff --git a/drivers/net/bnx2x/bnx2x.h b/drivers/net/bnx2x/bnx2x.h index 43c60408a..3383c7675 100644 --- a/drivers/net/bnx2x/bnx2x.h +++ b/drivers/net/bnx2x/bnx2x.h @@ -30,7 +30,7 @@ #include "elink.h" -#ifndef __FreeBSD__ +#ifndef RTE_EXEC_ENV_FREEBSD #include #define PCIY_PMG PCI_CAP_ID_PM @@ -60,7 +60,7 @@ #define IFM_10G_TWINAX 22 /* 10GBase Twinax copper */ #define IFM_10G_T 26 /* 10GBase-T - RJ45 */ -#ifndef __FreeBSD__ +#ifndef RTE_EXEC_ENV_FREEBSD #define PCIR_EXPRESS_DEVICE_STA PCI_EXP_TYPE_RC_EC #define PCIM_EXP_STA_TRANSACTION_PND PCI_EXP_DEVSTA_TRPND #define PCIR_EXPRESS_LINK_STA PCI_EXP_LNKSTA diff --git a/drivers/net/bnx2x/bnx2x_osal.h b/drivers/net/bnx2x/bnx2x_osal.h index 7cd293259..c4818bb22 100644 --- a/drivers/net/bnx2x/bnx2x_osal.h +++ b/drivers/net/bnx2x/bnx2x_osal.h @@ -8,7 +8,11 @@ #ifndef BNX2X_OSAL_H #define BNX2X_OSAL_H +#ifdef RTE_EXEC_ENV_FREEBSD #include +#else +#include +#endif #if RTE_BYTE_ORDER == RTE_LITTLE_ENDIAN #ifndef __LITTLE_ENDIAN @@ -22,8 +26,10 @@ #undef __LITTLE_ENDIAN #endif +#ifdef RTE_EXEC_ENV_FREEBSD #define __le16 uint16_t #define __le32 uint32_t #define __le64 uint64_t +#endif #endif /* BNX2X_OSAL_H */ -- 2.18.0