Bug 754 - quick question about including netinet/ip.h in rte_ethdev.h
Summary: quick question about including netinet/ip.h in rte_ethdev.h
Status: UNCONFIRMED
Alias: None
Product: DPDK
Classification: Unclassified
Component: ethdev (show other bugs)
Version: 19.11
Hardware: All All
: Normal normal
Target Milestone: ---
Assignee: dev
URL:
Depends on:
Blocks:
 
Reported: 2021-07-13 12:14 CEST by jy7805.heo
Modified: 2021-07-14 04:05 CEST (History)
0 users



Attachments

Description jy7805.heo 2021-07-13 12:14:20 CEST
Hello all, 

I'm making some application using DPDK. Once I want to include <linux/ip.h> and <rte_ethdev.h> together, below redefinition error is being show. 


/usr/include/linux/ip.h:86:8: error: redefinition of ‘struct iphdr’
 struct iphdr {
        ^~~~~
In file included from /usr/local/include/rte_ip.h:21:0,
                 from /usr/local/include/rte_flow.h:24,
                 from /usr/local/include/rte_eth_ctrl.h:11,
                 from /usr/local/include/rte_ethdev.h:978,
                 from /home/jy7805.heo/git/srsLTE/lib/include/srslte/dpdk/dpdk_utils.h:18,
                 from /home/jy7805.heo/git/srsLTE/lib/include/srslte/dpdk/dpdk_threads.h:9,
                 from /home/jy7805.heo/git/srsLTE/lib/include/srslte/ph_thread/ph_tx.h:4,
                 from /home/jy7805.heo/git/srsLTE/lib/src/ph_thread/ph_tx.cc:1:

I found that rte_ip.h is including netinet/ip.h which is making collision with linux/ip.h

Does anyone who ever seen this kind of error before ? Should I change linux/ip.h to netinet/ip.h ? 

Thank you. 

Thank you.
Comment 1 Stephen Hemminger 2021-07-13 18:22:59 CEST
On Tue, 13 Jul 2021 10:14:20 +0000
bugzilla@dpdk.org wrote:

> https://bugs.dpdk.org/show_bug.cgi?id=754
> 
>             Bug ID: 754
>            Summary: quick question about including netinet/ip.h in
>                     rte_ethdev.h
>            Product: DPDK
>            Version: 19.11
>           Hardware: All
>                 OS: All
>             Status: UNCONFIRMED
>           Severity: normal
>           Priority: Normal
>          Component: ethdev
>           Assignee: dev@dpdk.org
>           Reporter: jy7805.heo@samsung.com
>   Target Milestone: ---
> 
> Hello all, 
> 
> I'm making some application using DPDK. Once I want to include <linux/ip.h>
> and
> <rte_ethdev.h> together, below redefinition error is being show. 
> 
> 
> /usr/include/linux/ip.h:86:8: error: redefinition of ‘struct iphdr’
>  struct iphdr {
>         ^~~~~
> In file included from /usr/local/include/rte_ip.h:21:0,
>                  from /usr/local/include/rte_flow.h:24,
>                  from /usr/local/include/rte_eth_ctrl.h:11,
>                  from /usr/local/include/rte_ethdev.h:978,
>                  from
> /home/jy7805.heo/git/srsLTE/lib/include/srslte/dpdk/dpdk_utils.h:18,
>                  from
> /home/jy7805.heo/git/srsLTE/lib/include/srslte/dpdk/dpdk_threads.h:9,
>                  from
> /home/jy7805.heo/git/srsLTE/lib/include/srslte/ph_thread/ph_tx.h:4,
>                  from
>                  /home/jy7805.heo/git/srsLTE/lib/src/ph_thread/ph_tx.cc:1:
> 
> I found that rte_ip.h is including netinet/ip.h which is making collision
> with
> linux/ip.h
> 
> Does anyone who ever seen this kind of error before ? Should I change
> linux/ip.h to netinet/ip.h ? 

What distribution? 
In the general the simple solution is not include linux/ip.h
Comment 2 jy7805.heo 2021-07-14 04:05:47 CEST
yeah, I am using netinet/ip.h as W/A. 
The distribution is dpdk-stable-19.11.6.

Note You need to log in before you can comment on or make changes to this bug.