[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180406104724.5dc92a15@redhat.com>
Date: Fri, 6 Apr 2018 10:47:24 +0200
From: Jesper Dangaard Brouer <brouer@...hat.com>
To: Jakub Kicinski <jakub.kicinski@...ronome.com>
Cc: Daniel Borkmann <daniel@...earbox.net>,
Eric Leblond <eric@...it.org>,
Victor Julien <victor@...iniac.net>,
Peter Manev <petermanev@...il.com>,
oisf-devel@...ts.openinfosecfoundation.org,
Alexei Starovoitov <ast@...com>,
"iovisor-dev@...ts.iovisor.org" <iovisor-dev@...ts.iovisor.org>,
Saeed Mahameed <saeedm@...lanox.com>,
Daniel Borkmann <borkmann@...earbox.net>,
netdev@...r.kernel.org, davem@...emloft.net,
Jiri Benc <jbenc@...hat.com>, brouer@...hat.com
Subject: Re: [iovisor-dev] Best userspace programming API for XDP features
query to kernel?
On Thu, 5 Apr 2018 14:47:16 -0700
Jakub Kicinski <jakub.kicinski@...ronome.com> wrote:
> On Thu, 5 Apr 2018 22:51:33 +0200, Jesper Dangaard Brouer wrote:
> > > What about nfp in terms of XDP
> > > offload capabilities, should they be included as well or is probing to load
> > > the program and see if it loads/JITs as we do today just fine (e.g. you'd
> > > otherwise end up with extra flags on a per BPF helper basis)?
> >
> > No, flags per BPF helper basis. As I've described above, helper belong
> > to the BPF core, not the driver. Here I want to know what the specific
> > driver support.
>
> I think Daniel meant for nfp offload. The offload restrictions are
> quite involved, are we going to be able to express those?
Let's keep thing separate.
I'm requesting something really simple. I want the driver to tell me
what XDP actions it supports. We/I can implement an XDP_QUERY_ACTIONS
via ndo_bpf, problem solved. It is small, specific and simple.
For my other use-case of enabling XDP-xmit on a device, I can
implement another ndo_bpf extension. Current approach today is loading
a dummy XDP prog via ndo_bpf anyway (which is awkward). Again a
specific change that let us move one-step further.
For your nfp offload use-case, you/we have to find a completely
different solution. You have hit a design choice made by BPF.
Which is that BPF is part of the core kernel, and helpers cannot be
loaded as kernel modules. As we cannot remove or add helpers after the
verifier certified the program. And basically your nfp offload driver
comes as a kernel module.
(Details: and you basically already solved your issue by modifying the
core verifier to do a call back to bpf_prog_offload_verify_insn()).
Point being this is very different from what I'm requesting. Thus, for
offloading you already have a solution, to my setup time detect
problem, as your program gets rejected setup/load time by the verifier.
--
Best regards,
Jesper Dangaard Brouer
MSc.CS, Principal Kernel Engineer at Red Hat
LinkedIn: http://www.linkedin.com/in/brouer
Powered by blists - more mailing lists