[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAEKGpzhDjReJmmWXdtDct3KiuMzk127FdBbz4eM4jNakcsNxQQ@mail.gmail.com>
Date: Thu, 2 Jul 2020 18:58:01 +0900
From: "Daniel T. Lee" <danieltimlee@...il.com>
To: Andrii Nakryiko <andrii.nakryiko@...il.com>
Cc: Daniel Borkmann <daniel@...earbox.net>,
Alexei Starovoitov <ast@...nel.org>,
Yonghong Song <yhs@...com>, Martin KaFai Lau <kafai@...com>,
Andrii Nakryiko <andriin@...com>,
Networking <netdev@...r.kernel.org>, bpf <bpf@...r.kernel.org>
Subject: Re: [PATCH bpf-next 2/4] samples: bpf: refactor BPF map in map test
with libbpf
On Thu, Jul 2, 2020 at 1:26 PM Andrii Nakryiko
<andrii.nakryiko@...il.com> wrote:
>
> On Wed, Jul 1, 2020 at 7:17 PM Daniel T. Lee <danieltimlee@...il.com> wrote:
> >
> > From commit 646f02ffdd49 ("libbpf: Add BTF-defined map-in-map
> > support"), a way to define internal map in BTF-defined map has been
> > added.
> >
> > Instead of using previous 'inner_map_idx' definition, the structure to
> > be used for the inner map can be directly defined using array directive.
> >
> > __array(values, struct inner_map)
> >
> > This commit refactors map in map test program with libbpf by explicitly
> > defining inner map with BTF-defined format.
> >
> > Signed-off-by: Daniel T. Lee <danieltimlee@...il.com>
> > ---
> > samples/bpf/Makefile | 2 +-
> > samples/bpf/test_map_in_map_kern.c | 85 +++++++++++++++---------------
> > samples/bpf/test_map_in_map_user.c | 53 +++++++++++++++++--
> > 3 files changed, 91 insertions(+), 49 deletions(-)
> >
>
> [...]
>
> > - if (load_bpf_file(filename)) {
> > - printf("%s", bpf_log_buf);
> > - return 1;
> > + prog = bpf_object__find_program_by_name(obj, "trace_sys_connect");
> > + if (libbpf_get_error(prog)) {
>
> still wrong, just `if (!prog)`
>
Oops, my bad.
Will fix right away.
Thanks for your time and effort for the review.
Daniel.
> > + printf("finding a prog in obj file failed\n");
> > + goto cleanup;
> > + }
> > +
>
> [...]
Powered by blists - more mailing lists