[dpdk-stable] [dpdk-dev] [PATCH] examples/bpf: fix compilation issue

Varghese, Vipin vipin.varghese at intel.com
Wed Jul 31 10:20:03 CEST 2019


Snipped

> > > Example BPF programs t1.c, t2.c, t3.c in folder examples/bpf are
> > > failing to compile with latest dpdk.org master.
> >
> > As a note, the file t3.c is one which fails to get compiled.
> 
> t2.c also uses rte_mbuf, so same story  for both.

Thank you. So, the rewrite will be ' Example BPF programs t2.c, and t3.c in folder examples/bpf are failing to compile with latest dpdk.org master.'

> 
> >
> > > The reason is changes in some core DPDK header files, that causes
> > > now inclusion of x86 specific headers.
> >
> > snipped
> >
> >
> > >
> > >  #include <stdint.h>
> > >  #include <rte_common.h>
> > > -#include <rte_memory.h>
> > >
> > >  #ifdef __cplusplus
> > >  extern "C" {
> > > @@ -364,6 +363,23 @@ typedef struct {
> > >  	volatile int16_t cnt; /**< An internal counter value. */  }
> > > rte_atomic16_t;
> > >
> > > +#define RTE_CACHE_LINE_MIN_SIZE 64      /**< Minimum Cache line size.
> */
> >
> > The definition for RTE_CACHE_LINE_MIN_SIZE is present in ` rte_config.h`.
> 
> I believe it is not:
> $ find lib config -type f | xargs grep CACHE_LINE_MIN_SIZE
> lib/librte_eal/linux/eal/include/rte_kni_common.h:#define
> RTE_CACHE_LINE_MIN_SIZE 64
> lib/librte_eal/linux/eal/include/rte_kni_common.h:      char pad3[8]
> __attribute__((__aligned__(RTE_CACHE_LINE_MIN_SIZE)));
> lib/librte_eal/common/include/rte_memory.h:#define
> RTE_CACHE_LINE_MIN_SIZE 64  /**< Minimum Cache line size. */
> lib/librte_eal/common/include/rte_memory.h:#define
> __rte_cache_min_aligned __rte_aligned(RTE_CACHE_LINE_MIN_SIZE)
> 
> Konstantin

Thanks. So, is not the best approach to place RTE_CACHE_LINE_MIN_SIZE in rte_config.h to prevent multiple definition (rte_kni_common.h, rte_memory.h and examples/bpf/mbuf.h)?


More information about the stable mailing list