[dpdk-dev] [PATCH v2 07/13] net/avp: fix errors in exported headers

Adrien Mazarguil adrien.mazarguil at 6wind.com
Tue Apr 25 14:49:59 CEST 2017


On Tue, Apr 25, 2017 at 12:31:56PM +0000, Legacy, Allain wrote:
> > -----Original Message-----
> > From: Adrien Mazarguil [mailto:adrien.mazarguil at 6wind.com]
> > Sent: Tuesday, April 25, 2017 4:30 AM
> <...>
> > 
> > +#include <stdint.h>
> >  #ifdef __KERNEL__
> >  #include <linux/if.h>
> > +#else
> > +#include <rte_common.h>
> > +#include <rte_memory.h>
> > +#include <rte_ether.h>
> > +#include <rte_atomic.h>
> > +#endif
> 
> I compiled this in our environment and found a couple of additional issues.  I apologize... I should have done that on the first pass.   It should actually look like this to handle both userspace and kernel compiles:
> 
> 	#ifdef __KERNEL__
> 	#include <linux/if.h>
> 	#define RTE_STD_C11
> 	#else
> 	#include <stdint.h>
> 	#include <rte_common.h>
> 	#include <rte_memory.h>
> 	#include <rte_ether.h>
> 	#include <rte_atomic.h>
> 	#endif
> 
> 1) stdint.h needs to be moved in to the #else, and 

OK, will update.

> 2) RTE_STD_C11 needs to be included in the #ifdef __KERNEL__.

Missed that one, however I suggest either:

 #ifndef __KERNEL__ around RTE_STD_C11

or using __extension__ directly. Which do you prefer?

By the way, is the kernel module that depends on rte_avp_common.h available
somewhere to validate compilation against it?

> <..>
> > diff --git a/drivers/net/avp/rte_avp_fifo.h b/drivers/net/avp/rte_avp_fifo.h
> > index 8262e4f..a0a37eb 100644
> > --- a/drivers/net/avp/rte_avp_fifo.h
> > +++ b/drivers/net/avp/rte_avp_fifo.h
> > @@ -57,6 +57,12 @@
> >  #ifndef _RTE_AVP_FIFO_H_
> >  #define _RTE_AVP_FIFO_H_
> > 
> > +#include <rte_avp_common.h>
> 
> Would you mind changing the brackets (<>) to quotes ("") since this is a local include file?  
> 
> 	#include "rte_avp_common.h"

I will update it.

-- 
Adrien Mazarguil
6WIND


More information about the dev mailing list