[dpdk-dev] conflict between ether_addr defined in rte_ether.h and the same structure in <net/ethernet.h>

Montorsi, Francesco fmontorsi at empirix.com
Fri Jul 31 17:18:26 CEST 2015


Hi all,

I 'm attempting to integrate DPDK code in an existing application, which includes <net/ethernet.h>.
That standard glibc header already provides a structure named ether_addr defined 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: warning: "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: warning: "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: warning: "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: warning: "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: error: '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: error: '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: error: '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: error: '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: error: '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: error: '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: error: '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: error: '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: error: '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: error: '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: error: '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: error: '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: error: 'const struct ether_addr' has no member named 'addr_bytes'

My idea here is that DPDK should rather define an "rte_ether_addr" (or directly always use <net/Ethernet.h> but I guess this is not done for some good reason)... isn't it?

Thanks,
Francesco Montorsi



More information about the dev mailing list