From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: <fmontorsi@empirix.com> Received: from bilemail1.empirix.com (bilemail1.empirix.com [208.67.76.245]) by dpdk.org (Postfix) with ESMTP id 4980FC6FA for <dev@dpdk.org>; Fri, 31 Jul 2015 17:18:46 +0200 (CEST) Received: from BILEMAIL1.empirix.com (10.17.8.30) by bilemail1.empirix.com (10.17.8.30) with Microsoft SMTP Server (TLS) id 15.0.775.38; Fri, 31 Jul 2015 11:18:27 -0400 Received: from BILEMAIL1.empirix.com ([fe80::f9e0:9293:2523:f021]) by bilemail1.empirix.com ([fe80::f9e0:9293:2523:f021%22]) with mapi id 15.00.0775.031; Fri, 31 Jul 2015 11:18:27 -0400 From: "Montorsi, Francesco" <fmontorsi@empirix.com> To: "dev@dpdk.org" <dev@dpdk.org> Thread-Topic: conflict between ether_addr defined in rte_ether.h and the same structure in <net/ethernet.h> Thread-Index: AdDLo4dIvgAxSFFQQL6bvhoyuKbJDg== Date: Fri, 31 Jul 2015 15:18:26 +0000 Message-ID: <a80192fa37154d66adb788a03449970a@bilemail1.empirix.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.12.50.109] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: [dpdk-dev] conflict between ether_addr defined in rte_ether.h and the same structure in <net/ethernet.h> X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK <dev.dpdk.org> List-Unsubscribe: <http://dpdk.org/ml/options/dev>, <mailto:dev-request@dpdk.org?subject=unsubscribe> List-Archive: <http://dpdk.org/ml/archives/dev/> List-Post: <mailto:dev@dpdk.org> List-Help: <mailto:dev-request@dpdk.org?subject=help> List-Subscribe: <http://dpdk.org/ml/listinfo/dev>, <mailto:dev-request@dpdk.org?subject=subscribe> X-List-Received-Date: Fri, 31 Jul 2015 15:18:46 -0000 Hi all, I 'm attempting to integrate DPDK code in an existing application, which in= cludes <net/ethernet.h>. That standard glibc header already provides a structure named ether_addr de= fined as: struct ether_addr { u_int8_t ether_addr_octet[ETH_ALEN]; } __attribute__ ((__packed__)); So the result is that gcc complains about the redefinition: dpdk/dpdk-2.0.0/x86_64-native-linuxapp-gcc/include/rte_ether.h:55:0: warnin= g: "ETHER_ADDR_LEN" redefined [enabled by default] /opt/empirix/toolchains/x86_64-gcc-4.6.1-glibc-2.14-1.0-6/tools/include/net= /ethernet.h:60:0: note: this is the location of the previous definition dpdk/dpdk-2.0.0/x86_64-native-linuxapp-gcc/include/rte_ether.h:58:0: warnin= g: "ETHER_HDR_LEN" redefined [enabled by default] /opt/empirix/toolchains/x86_64-gcc-4.6.1-glibc-2.14-1.0-6/tools/include/net= /ethernet.h:63:0: note: this is the location of the previous definition dpdk/dpdk-2.0.0/x86_64-native-linuxapp-gcc/include/rte_ether.h:60:0: warnin= g: "ETHER_MIN_LEN" redefined [enabled by default] /opt/empirix/toolchains/x86_64-gcc-4.6.1-glibc-2.14-1.0-6/tools/include/net= /ethernet.h:64:0: note: this is the location of the previous definition dpdk/dpdk-2.0.0/x86_64-native-linuxapp-gcc/include/rte_ether.h:61:0: warnin= g: "ETHER_MAX_LEN" redefined [enabled by default] /opt/empirix/toolchains/x86_64-gcc-4.6.1-glibc-2.14-1.0-6/tools/include/net= /ethernet.h:65:0: note: this is the location of the previous definition dpdk/dpdk-2.0.0/x86_64-native-linuxapp-gcc/include/rte_ether.h:86:8: error:= redefinition of 'struct ether_addr' /opt/empirix/toolchains/x86_64-gcc-4.6.1-glibc-2.14-1.0-6/tools/include/net= /ethernet.h:33:8: error: previous definition of 'struct ether_addr' dpdk/dpdk-2.0.0/x86_64-native-linuxapp-gcc/include/rte_ether.h: In function= 'int is_same_ether_addr(const ether_addr*, const ether_addr*)': dpdk/dpdk-2.0.0/x86_64-native-linuxapp-gcc/include/rte_ether.h:112:12: erro= r: 'const struct ether_addr' has no member named 'addr_bytes' dpdk/dpdk-2.0.0/x86_64-native-linuxapp-gcc/include/rte_ether.h:112:34: erro= r: 'const struct ether_addr' has no member named 'addr_bytes' dpdk/dpdk-2.0.0/x86_64-native-linuxapp-gcc/include/rte_ether.h: In function= 'int is_zero_ether_addr(const ether_addr*)': dpdk/dpdk-2.0.0/x86_64-native-linuxapp-gcc/include/rte_ether.h:131:11: erro= r: 'const struct ether_addr' has no member named 'addr_bytes' dpdk/dpdk-2.0.0/x86_64-native-linuxapp-gcc/include/rte_ether.h: In function= 'int is_unicast_ether_addr(const ether_addr*)': dpdk/dpdk-2.0.0/x86_64-native-linuxapp-gcc/include/rte_ether.h:148:15: erro= r: 'const struct ether_addr' has no member named 'addr_bytes' dpdk/dpdk-2.0.0/x86_64-native-linuxapp-gcc/include/rte_ether.h: In function= 'int is_multicast_ether_addr(const ether_addr*)': dpdk/dpdk-2.0.0/x86_64-native-linuxapp-gcc/include/rte_ether.h:163:14: erro= r: 'const struct ether_addr' has no member named 'addr_bytes' dpdk/dpdk-2.0.0/x86_64-native-linuxapp-gcc/include/rte_ether.h: In function= 'int is_universal_ether_addr(const ether_addr*)': dpdk/dpdk-2.0.0/x86_64-native-linuxapp-gcc/include/rte_ether.h:196:15: erro= r: 'const struct ether_addr' has no member named 'addr_bytes' dpdk/dpdk-2.0.0/x86_64-native-linuxapp-gcc/include/rte_ether.h: In function= 'int is_local_admin_ether_addr(const ether_addr*)': dpdk/dpdk-2.0.0/x86_64-native-linuxapp-gcc/include/rte_ether.h:211:15: erro= r: 'const struct ether_addr' has no member named 'addr_bytes' dpdk/dpdk-2.0.0/x86_64-native-linuxapp-gcc/include/rte_ether.h: In function= 'void ether_format_addr(char*, uint16_t, const ether_addr*)': dpdk/dpdk-2.0.0/x86_64-native-linuxapp-gcc/include/rte_ether.h:288:14: erro= r: 'const struct ether_addr' has no member named 'addr_bytes' dpdk/dpdk-2.0.0/x86_64-native-linuxapp-gcc/include/rte_ether.h:289:14: erro= r: 'const struct ether_addr' has no member named 'addr_bytes' dpdk/dpdk-2.0.0/x86_64-native-linuxapp-gcc/include/rte_ether.h:290:14: erro= r: 'const struct ether_addr' has no member named 'addr_bytes' dpdk/dpdk-2.0.0/x86_64-native-linuxapp-gcc/include/rte_ether.h:291:14: erro= r: 'const struct ether_addr' has no member named 'addr_bytes' dpdk/dpdk-2.0.0/x86_64-native-linuxapp-gcc/include/rte_ether.h:292:14: erro= r: 'const struct ether_addr' has no member named 'addr_bytes' dpdk/dpdk-2.0.0/x86_64-native-linuxapp-gcc/include/rte_ether.h:293:14: erro= r: 'const struct ether_addr' has no member named 'addr_bytes' My idea here is that DPDK should rather define an "rte_ether_addr" (or dire= ctly always use <net/Ethernet.h> but I guess this is not done for some good= reason)... isn't it? Thanks, Francesco Montorsi