DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Montorsi, Francesco" <fmontorsi@empirix.com>
To: "dev@dpdk.org" <dev@dpdk.org>
Subject: [dpdk-dev] conflict between ether_addr defined in rte_ether.h and the same structure in <net/ethernet.h>
Date: Fri, 31 Jul 2015 15:18:26 +0000	[thread overview]
Message-ID: <a80192fa37154d66adb788a03449970a@bilemail1.empirix.com> (raw)

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

             reply	other threads:[~2015-07-31 15:18 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-31 15:18 Montorsi, Francesco [this message]
2015-07-31 15:38 ` Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a80192fa37154d66adb788a03449970a@bilemail1.empirix.com \
    --to=fmontorsi@empirix.com \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).