netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jesper Dangaard Brouer via iovisor-dev <iovisor-dev-9jONkmmOlFHEE9lA1F8Ukti2O/JbrIOy@public.gmane.org>
To: Jakub Kicinski <jakub.kicinski-wFxRvT7yatFl57MIdRCFDg@public.gmane.org>
Cc: oisf-devel-ZwoEplunGu2j570ONfqVQLVmwVP6tfMwSoIsB4E12gc@public.gmane.org,
	Alexei Starovoitov <ast-b10kYP2dOMg@public.gmane.org>,
	Victor Julien <victor-BbQdigol64zk1uMJSBkQmQ@public.gmane.org>,
	netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	"iovisor-dev-9jONkmmOlFHEE9lA1F8Ukti2O/JbrIOy@public.gmane.org"
	<iovisor-dev-9jONkmmOlFHEE9lA1F8Ukti2O/JbrIOy@public.gmane.org>,
	Peter Manev <petermanev-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	Jiri Benc <jbenc-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>,
	Saeed Mahameed <saeedm-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>,
	Eric Leblond <eric-EVVnsjFE0OfYtjvyW6yDsg@public.gmane.org>,
	Daniel Borkmann
	<borkmann-FeC+5ew28dpmcu3hnIyYJQ@public.gmane.org>
Subject: Re: Best userspace programming API for XDP features query to kernel?
Date: Fri, 6 Apr 2018 10:47:24 +0200	[thread overview]
Message-ID: <20180406104724.5dc92a15@redhat.com> (raw)
In-Reply-To: <20180405144716.2bdd4214-68UzVGuGftmUSpRRplVxJ1aTQe2KTcn/@public.gmane.org>

On Thu, 5 Apr 2018 14:47:16 -0700
Jakub Kicinski <jakub.kicinski-wFxRvT7yatFl57MIdRCFDg@public.gmane.org> 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

  parent reply	other threads:[~2018-04-06  8:47 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20180404142856.284ee8c9@redhat.com>
     [not found] ` <20180404142856.284ee8c9-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2018-04-05 10:37   ` Best userspace programming API for XDP features query to kernel? Daniel Borkmann via iovisor-dev
     [not found]     ` <95ac793b-66aa-b53c-a9bc-c86cbc47ee1a-FeC+5ew28dpmcu3hnIyYJQ@public.gmane.org>
2018-04-05 20:51       ` Jesper Dangaard Brouer via iovisor-dev
     [not found]         ` <20180405225133.18a09883-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2018-04-05 21:47           ` Jakub Kicinski via iovisor-dev
     [not found]             ` <20180405144716.2bdd4214-68UzVGuGftmUSpRRplVxJ1aTQe2KTcn/@public.gmane.org>
2018-04-06  8:47               ` Jesper Dangaard Brouer via iovisor-dev [this message]
2018-04-06 10:36           ` Daniel Borkmann via iovisor-dev
2018-04-09 11:26             ` [iovisor-dev] " Jesper Dangaard Brouer
2018-04-10 10:13               ` Daniel Borkmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180406104724.5dc92a15@redhat.com \
    --to=iovisor-dev-9jonkmmolfhee9la1f8ukti2o/jbrioy@public.gmane.org \
    --cc=ast-b10kYP2dOMg@public.gmane.org \
    --cc=borkmann-FeC+5ew28dpmcu3hnIyYJQ@public.gmane.org \
    --cc=brouer-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=eric-EVVnsjFE0OfYtjvyW6yDsg@public.gmane.org \
    --cc=jakub.kicinski-wFxRvT7yatFl57MIdRCFDg@public.gmane.org \
    --cc=jbenc-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=oisf-devel-ZwoEplunGu2j570ONfqVQLVmwVP6tfMwSoIsB4E12gc@public.gmane.org \
    --cc=petermanev-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=saeedm-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
    --cc=victor-BbQdigol64zk1uMJSBkQmQ@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).