netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Björn Töpel" <bjorn.topel@intel.com>
To: Alexei Starovoitov <alexei.starovoitov@gmail.com>
Cc: "Magnus Karlsson" <magnus.karlsson@gmail.com>,
	"Jesper Dangaard Brouer" <brouer@redhat.com>,
	"Björn Töpel" <bjorn.topel@gmail.com>,
	"Karlsson, Magnus" <magnus.karlsson@intel.com>,
	ast@kernel.org, "Daniel Borkmann" <daniel@iogearbox.net>,
	"Network Development" <netdev@vger.kernel.org>,
	"William Tu" <u9012063@gmail.com>,
	"Zhang, Qi Z" <qi.z.zhang@intel.com>,
	"Jakub Kicinski" <jakub.kicinski@netronome.com>,
	andrew@lunn.ch
Subject: Re: [PATCH bpf-next v2 0/7] Add support for XDP_ATTACH
Date: Wed, 19 Dec 2018 10:34:28 +0100	[thread overview]
Message-ID: <a0e6c2cb-f2c8-ba7c-7c72-c20826b84172@intel.com> (raw)
In-Reply-To: <20181218230358.4bs53pwg65f2kdtc@ast-mbp>


On 2018-12-19 00:04, Alexei Starovoitov wrote:
> On Mon, Dec 17, 2018 at 04:30:05PM +0100, Björn Töpel wrote:
>>>
>>> Instead of introducing the XDP_ATTACH option to the bind call, can we
>>> just make this association between rx queue id and xsk every single
>>> time we bind? Then it is up to the user via the XDP program if he/she
>>> wants to use this by calling xsk_redirect. No new option needed.
>>>
>>
>> Nice! Then it would simply be a matter of adding the helper. Much better
>> than extending the uapi. Thank you for pointing this out!
> 
> Magnus's by-default association approach sounds good to me.
> I'm missing though why extra bpf helper is needed.
> This soft-bind rx queue with xsk at the time
> of normal bind() should work as-is and no program necessary.

Hmm, an XDP program has always been required. It's just whether the
program needs an XSKMAP or not. The XDP_ATTACH can be seens as "use an
internal map" -- and the mechanism to redirect using that map is via the
bpf_xsk_redirect helper. What Magnus proposed was populating the builtin
map unconditionally, and therefore removing the need for the XDP_ATTACH
option.

If I am interpreting what you're saying correctly, you thought
XDP_ATTACH (in v1) was bypassing the XDP path. This is not something
that we want. AF_XDP is a proper XDP construct, and require an XDP
program to receive frames. What I wanted to improve with this series was
to lower the complexity of the minimal XDP program to receive a frame.

> No prog -> default assoc. Yet the prog has an ability to redirect
> to specific xsk via existing bpf_redirect_map
> or via faster (future) xsk_redirect.
> 
> Also I agree with Jesper that per-queue programs would be good to have
> sooner than later, but I disagree that it's mandatory for this set.
> It seems the patches will give us performance boost and simplification
> of uapi while per-queue prog api is being discussed and implemented.
> 
> I like the other idea too (of having libbpf provide canned bpf progs
> for different use cases). That's better than loading them
> from the kernel.
>

To summarize; I'll hold off this series for now (except the first
cleanup patch which I'll send out today), and spend some time on
per-queue programs, iproute2 support and libbpf.


Björn

  reply	other threads:[~2018-12-19  9:34 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-17 10:24 [PATCH bpf-next v2 0/7] Add support for XDP_ATTACH Björn Töpel
2018-12-17 10:24 ` [PATCH bpf-next v2 1/7] xsk: simplify AF_XDP socket teardown Björn Töpel
2018-12-17 10:24 ` [PATCH bpf-next v2 2/7] xsk: add XDP_ATTACH bind() flag Björn Töpel
2018-12-17 10:24 ` [PATCH bpf-next v2 3/7] bpf: add bpf_xsk_redirect function Björn Töpel
2018-12-17 10:24 ` [PATCH bpf-next v2 4/7] tools/bpf: sync kernel uapi bpf.h to tools directory Björn Töpel
2018-12-17 10:24 ` [PATCH bpf-next v2 5/7] libbpf: initial support for builtin BPF programs Björn Töpel
2018-12-17 10:25 ` [PATCH bpf-next v2 6/7] samples: bpf: simplify/cleanup xdpsock Björn Töpel
2018-12-17 10:25 ` [PATCH bpf-next v2 7/7] samples: bpf: add support for XDP_ATTACH to xdpsock Björn Töpel
2018-12-17 12:50 ` [PATCH bpf-next v2 0/7] Add support for XDP_ATTACH Jesper Dangaard Brouer
2018-12-17 13:39   ` Björn Töpel
2018-12-17 14:10     ` Jesper Dangaard Brouer
2018-12-17 14:55       ` Magnus Karlsson
2018-12-17 15:30         ` Björn Töpel
2018-12-18 23:04           ` Alexei Starovoitov
2018-12-19  9:34             ` Björn Töpel [this message]
2018-12-19 16:23               ` Jesper Dangaard Brouer
2018-12-20  0:48               ` Alexei Starovoitov
2018-12-18  2:36     ` Jakub Kicinski
2018-12-18  8:59       ` Björn Töpel
2018-12-18 18:18         ` Jakub Kicinski

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=a0e6c2cb-f2c8-ba7c-7c72-c20826b84172@intel.com \
    --to=bjorn.topel@intel.com \
    --cc=alexei.starovoitov@gmail.com \
    --cc=andrew@lunn.ch \
    --cc=ast@kernel.org \
    --cc=bjorn.topel@gmail.com \
    --cc=brouer@redhat.com \
    --cc=daniel@iogearbox.net \
    --cc=jakub.kicinski@netronome.com \
    --cc=magnus.karlsson@gmail.com \
    --cc=magnus.karlsson@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=qi.z.zhang@intel.com \
    --cc=u9012063@gmail.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;
as well as URLs for NNTP newsgroup(s).