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

Ananyev, Konstantin konstantin.ananyev at intel.com
Wed Jul 31 09:26:26 CEST 2019



> -----Original Message-----
> From: Thomas Monjalon [mailto:thomas at monjalon.net]
> Sent: Tuesday, July 30, 2019 6:53 PM
> To: Ananyev, Konstantin <konstantin.ananyev at intel.com>
> Cc: dev at dpdk.org; olivier.matz at 6wind.com
> Subject: Re: [dpdk-stable] [PATCH] examples/bpf: fix compilation issue
> 
> 30/07/2019 12:19, Konstantin Ananyev:
> > Example BPF programs t1.c, t2.c, 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.
> > To overcome the issue, minimize inclusion of DPDK header files
> > into BPF source code.
> >
> > Bugzilla ID: 321
> >
> > Fixes: 9dfc06c26a8b ("test/bpf: add samples")
> > Cc: stable at dpdk.org
> >
> > Reported-by: Michel Machado <michel at digirati.com.br>
> > Suggested-by: Michel Machado <michel at digirati.com.br>
> > Signed-off-by: Konstantin Ananyev <konstantin.ananyev at intel.com>
> > ---
> >  examples/bpf/mbuf.h | 24 ++++++++++++++++++++++--
> >  1 file changed, 22 insertions(+), 2 deletions(-)
> 
> I think that's really a bad idea to have this file.
> The BPF applications are supposed to update their own copy of mbuf?

Right now, yes (same as KNI).

> Please could you try to include rte_mbuf.h
> instead of duplicating the mbuf layout?

I don't think it is possible without some rework on rte_mbuf.h itself.
I thought about that, but for that we'll probably need to put just 
struct rte_mbuf definition into a separate  file (rte_mbuf_core.h or so)	
and might be some related definitions into rte_common.h or so.
Then re_mbuf.h will include rte_mbuf_core.h while bpf (and might be KNI?)
can include just rte_mbuf_core.h without any extra arch specific headers.
Another alternative probably to define bpf as a separate arch
(though don't know how big effort it will be).
I planned to try something like that, but then totally forgot.
And now it is too late, we are at RC4 already . 
Konstantin



More information about the dev mailing list