[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAJ8uoz18+4fFP_JMu0kzFehZceATs5aAD8VUMQY2ax-S2=7Pvg@mail.gmail.com>
Date: Sun, 20 Oct 2019 21:12:01 +0200
From: Magnus Karlsson <magnus.karlsson@...il.com>
To: Alexei Starovoitov <alexei.starovoitov@...il.com>
Cc: Magnus Karlsson <magnus.karlsson@...el.com>,
Björn Töpel <bjorn.topel@...el.com>,
Alexei Starovoitov <ast@...nel.org>,
Daniel Borkmann <daniel@...earbox.net>,
Network Development <netdev@...r.kernel.org>,
Jonathan Lemon <jonathan.lemon@...il.com>,
"open list:DOCUMENTATION" <linux-doc@...r.kernel.org>,
bpf <bpf@...r.kernel.org>
Subject: Re: [PATCH bpf v2] xsk: improve documentation for AF_XDP
On Sun, Oct 20, 2019 at 7:25 PM Alexei Starovoitov
<alexei.starovoitov@...il.com> wrote:
>
> On Sun, Oct 20, 2019 at 10:13:49AM +0200, Magnus Karlsson wrote:
> > On Sat, Oct 19, 2019 at 11:48 AM Alexei Starovoitov
> > <alexei.starovoitov@...il.com> wrote:
> > >
> > > On Fri, Oct 18, 2019 at 11:33:40AM +0200, Magnus Karlsson wrote:
> > > > +
> > > > + #include <linux/bpf.h>
> > > > + #include "bpf_helpers.h"
> > > > +
> > > > + #define MAX_SOCKS 16
> > > > +
> > > > + struct {
> > > > + __uint(type, BPF_MAP_TYPE_XSKMAP);
> > > > + __uint(max_entries, MAX_SOCKS);
> > > > + __uint(key_size, sizeof(int));
> > > > + __uint(value_size, sizeof(int));
> > > > + } xsks_map SEC(".maps");
> > > > +
> > > > + struct {
> > > > + __uint(type, BPF_MAP_TYPE_PERCPU_ARRAY);
> > > > + __uint(max_entries, 1);
> > > > + __type(key, int);
> > > > + __type(value, unsigned int);
> > > > + } rr_map SEC(".maps");
> > >
> > > hmm. does xsks_map compile?
> >
> > Yes. Actually, I wrote a new sample to demonstrate this feature and to
> > test the code above. I will send that patch set (contains some small
> > additions to libbpf also to be able to support this) to bpf-next.
> > Though, if I used the __type declarations of the rr_map PERCPU_ARRAY I
> > got this warning: "pr_warning("Error in
> > bpf_create_map_xattr(%s):%s(%d). Retrying without BTF.\n")", so I had
> > to change it to the type above that is also used for SOCKMAP. Some
> > enablement that is missing for XSKMAP? Have not dug into it.
>
> Ahh. Right. xskmap explicitly prohibits BTF for key/value.
> const struct bpf_map_ops xsk_map_ops = {
> ...
> .map_check_btf = map_check_no_btf,
> };
> I guess it's time to add support for it.
Agreed. I will implement that in a separate patch set for bpf-next and
include a patch to update the documentation too in that patch set.
>
Powered by blists - more mailing lists