BPF List
 help / color / mirror / Atom feed
From: Jakub Kicinski <jakub.kicinski@netronome.com>
To: "Björn Töpel" <bjorn.topel@gmail.com>
Cc: "Jesper Dangaard Brouer" <brouer@redhat.com>,
	"Björn Töpel" <bjorn.topel@intel.com>,
	"Ilias Apalodimas" <ilias.apalodimas@linaro.org>,
	"Toke Høiland-Jørgensen" <toke@redhat.com>,
	"Karlsson, Magnus" <magnus.karlsson@intel.com>,
	maciej.fijalkowski@intel.com, "Jason Wang" <jasowang@redhat.com>,
	"Alexei Starovoitov" <ast@fb.com>,
	"Daniel Borkmann" <borkmann@iogearbox.net>,
	"John Fastabend" <john.fastabend@gmail.com>,
	"David Miller" <davem@davemloft.net>,
	"Andy Gospodarek" <andy@greyhouse.net>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	bpf <bpf@vger.kernel.org>, "Thomas Graf" <tgraf@suug.ch>,
	"Thomas Monjalon" <thomas@monjalon.net>,
	"Jonathan Lemon" <bsd@fb.com>
Subject: Re: Per-queue XDP programs, thoughts
Date: Tue, 16 Apr 2019 14:17:59 -0700	[thread overview]
Message-ID: <20190416141759.309f6435@cakuba.netronome.com> (raw)
In-Reply-To: <CAJ+HfNiBcR4yOBXFM3h9RG_bpu25YGcJtT=dqV1WwNaFmCf77A@mail.gmail.com>

On Tue, 16 Apr 2019 09:45:24 +0200, Björn Töpel wrote:
> > > > If we'd like to slice a netdevice into multiple queues. Isn't macvlan
> > > > or similar *virtual* netdevices a better path, instead of introducing
> > > > yet another abstraction?  
> >
> > Yes, the question of use cases is extremely important.  It seems
> > Mellanox is working on "spawning devlink ports" IOW slicing a device
> > into subdevices.  Which is a great way to run bifurcated DPDK/netdev
> > applications :/  If that gets merged I think we have to recalculate
> > what purpose AF_XDP is going to serve, if any.
> 
> I really like the subdevice-think, but let's have the drivers in the
> kernel. I don't see how the XDP view (including AF_XDP) changes with
> subdevices. My view on AF_XDP is that it's a socket that can
> receive/send data efficiently from/to the kernel. What subdevice
> *might* change is the requirement for a per-queue XDP program.

My worry is that the sockets are not expressive enough.  You can't have
a flower rule that forwards to a socket.  You can't have a flower rule
which forwards to an RSS context (AFAIK).  We have a model for doing
those things with port netdevs (A(incorrectly)KA representors).

> > > That is actually the reason I want XDP per-queue, as it is a way to
> > > offload the filtering to the hardware.  And if the per-queue XDP-prog
> > > becomes simple enough, the hardware can eliminate and do everything in
> > > hardware (hopefully).
> > >  
> > > > The control plane should IMO be outside of the XDP program.  
> >
> > ENOCOMPUTE :)  XDP program is the BPF byte code, it's never control
> > plance.  Do you mean application should not control the "context/
> > channel/subdev" creation?  
> 
> Yes, but I'm not sure. I'd like to hear more opinions.
> 
> Let me try to think out loud here. Say that per-queue XDP programs
> exist. The main XDP program receives all packets and makes the
> decision that a certain flow should end up in say queue X, and that
> the hardware supports offloading that. Should the knobs to program the
> hardware be in via BPF or by some other mechanism (perf ring to
> userland daemon)? Further, setting the XDP program per queue. Should
> that be done via XDP (the main XDP program has knowledge of all
> programs) or via say netlink (as XDP is today). One could argue that
> the per-queue setup should be a map (like tail-calls).

This is a philosophical discussion reminiscent of Saeed's control map
proposal.

I don't like the idea of purposefully shoehorning the networking
configuration into special maps.  It should probably be judged on
patch-by-patch basis, tho.

> > You're not saying "it's not the XDP program
> > which should be making the classification", no?  XDP program
> > controlling the classification was _the_ reason why we liked AF_XDP :)  
> 
> XDP program not doing classification would be weird. But if there's a
> scenario where *everything for a certain HW filter* end up in an
> AF_XDP queue, should we require an XDP program. I've been going back
> and forth here... :-)

  reply	other threads:[~2019-04-16 21:18 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20190405131745.24727-1-bjorn.topel@gmail.com>
     [not found] ` <20190405131745.24727-2-bjorn.topel@gmail.com>
     [not found]   ` <64259723-f0d8-8ade-467e-ad865add4908@intel.com>
2019-04-15 16:32     ` Per-queue XDP programs, thoughts Jesper Dangaard Brouer
2019-04-15 17:08       ` Toke Høiland-Jørgensen
2019-04-15 17:58       ` Jonathan Lemon
2019-04-16 14:48         ` Jesper Dangaard Brouer
2019-04-17 20:17           ` Tom Herbert
2019-04-15 22:49       ` Jakub Kicinski
2019-04-16  7:45         ` Björn Töpel
2019-04-16 21:17           ` Jakub Kicinski [this message]
2019-04-16 13:55         ` Jesper Dangaard Brouer
2019-04-16 16:53           ` Jonathan Lemon
2019-04-16 18:23             ` Björn Töpel
2019-04-16 21:28           ` Jakub Kicinski
2019-04-16  7:44       ` Björn Töpel
2019-04-16  9:36         ` Toke Høiland-Jørgensen
2019-04-16 12:07           ` Björn Töpel
2019-04-16 13:25             ` Toke Høiland-Jørgensen
2019-04-16 10:15       ` Jason Wang
2019-04-16 10:41       ` Jason Wang
2019-04-17 16:46       ` Björn Töpel

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=20190416141759.309f6435@cakuba.netronome.com \
    --to=jakub.kicinski@netronome.com \
    --cc=andy@greyhouse.net \
    --cc=ast@fb.com \
    --cc=bjorn.topel@gmail.com \
    --cc=bjorn.topel@intel.com \
    --cc=borkmann@iogearbox.net \
    --cc=bpf@vger.kernel.org \
    --cc=brouer@redhat.com \
    --cc=bsd@fb.com \
    --cc=davem@davemloft.net \
    --cc=ilias.apalodimas@linaro.org \
    --cc=jasowang@redhat.com \
    --cc=john.fastabend@gmail.com \
    --cc=maciej.fijalkowski@intel.com \
    --cc=magnus.karlsson@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=tgraf@suug.ch \
    --cc=thomas@monjalon.net \
    --cc=toke@redhat.com \
    /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