[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAEf4BzbRH-5-1MVtEnfLKOMO4f2sVFrdROBLTBT8GrESs1p1XQ@mail.gmail.com>
Date: Fri, 23 Apr 2021 14:39:34 -0700
From: Andrii Nakryiko <andrii.nakryiko@...il.com>
To: Alexei Starovoitov <alexei.starovoitov@...il.com>
Cc: Yonghong Song <yhs@...com>, Andrii Nakryiko <andrii@...nel.org>,
bpf <bpf@...r.kernel.org>,
Network Development <netdev@...r.kernel.org>,
Alexei Starovoitov <ast@...com>,
Daniel Borkmann <daniel@...earbox.net>,
Kernel Team <kernel-team@...com>
Subject: Re: [PATCH v3 bpf-next 17/18] selftests/bpf: add map linking selftest
On Fri, Apr 23, 2021 at 2:23 PM Alexei Starovoitov
<alexei.starovoitov@...il.com> wrote:
>
> On Fri, Apr 23, 2021 at 11:54 AM Yonghong Song <yhs@...com> wrote:
> >
> >
> >
> > On 4/23/21 11:13 AM, Andrii Nakryiko wrote:
> > > Add selftest validating various aspects of statically linking BTF-defined map
> > > definitions. Legacy map definitions do not support extern resolution between
> > > object files. Some of the aspects validated:
> > > - correct resolution of extern maps against concrete map definitions;
> > > - extern maps can currently only specify map type and key/value size and/or
> > > type information;
> > > - weak concrete map definitions are resolved properly.
> > >
> > > Static map definitions are not yet supported by libbpf, so they are not
> > > explicitly tested, though manual testing showes that BPF linker handles them
> > > properly.
> > >
> > > Acked-by: Yonghong Song <yhs@...com>
> > > Signed-off-by: Andrii Nakryiko <andrii@...nel.org>
> > [...]
> > > +
> > > +SEC("raw_tp/sys_exit")
> > > +int BPF_PROG(handler_exit1)
> > > +{
> > > + /* lookup values with key = 2, set in another file */
> > > + int key = 2, *val;
> > > + struct my_key key_struct = { .x = 2 };
> > > + struct my_value *value_struct;
> > > +
> > > + value_struct = bpf_map_lookup_elem(&map1, &key_struct);
> > > + if (value_struct)
> > > + output_first1 = value_struct->x;
> > > +
> > > + val = bpf_map_lookup_elem(&map2, &key);
> > > + if (val)
> > > + output_second1 = *val;
> > > +
> > > + val = bpf_map_lookup_elem(&map_weak, &key);
> > > + if (val)
> > > + output_weak1 = *val;
> > > +
> >
> > There is an extra tab in the above line. There is no need for new
> > revision just for this. If no new revision is needed, maybe
> > the maintainer can help fix it.
>
> Sorry. I applied without it. Pls fold the fix in some of the future patches.
Ok, no problem, I'll do it in v3 of statics support patch set.
Powered by blists - more mailing lists