[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAEf4BzZYLhimf+7s6oTorwFHS=+=-0OYt6Me14PQqz3_MbJRbw@mail.gmail.com>
Date: Tue, 1 Oct 2019 14:31:02 -0700
From: Andrii Nakryiko <andrii.nakryiko@...il.com>
To: John Fastabend <john.fastabend@...il.com>
Cc: Andrii Nakryiko <andriin@...com>, bpf <bpf@...r.kernel.org>,
Networking <netdev@...r.kernel.org>,
Alexei Starovoitov <ast@...com>,
Daniel Borkmann <daniel@...earbox.net>,
Kernel Team <kernel-team@...com>
Subject: Re: [PATCH bpf-next 5/6] selftests/bpf: adjust CO-RE reloc tests for
new BPF_CORE_READ macro
On Tue, Oct 1, 2019 at 12:14 PM John Fastabend <john.fastabend@...il.com> wrote:
>
> Andrii Nakryiko wrote:
> > Given introduction of variadic BPF_CORE_READ with slightly different
> > syntax and semantics, define CORE_READ, which is a thin wrapper around
> > low-level bpf_core_read() macro, which in turn is just a wrapper around
> > bpf_probe_read(). BPF_CORE_READ is higher-level variadic macro
> > supporting multi-pointer reads and are tested separately.
> >
> > Signed-off-by: Andrii Nakryiko <andriin@...com>
> > ---
> > .../bpf/progs/test_core_reloc_arrays.c | 10 ++++++----
> > .../bpf/progs/test_core_reloc_flavors.c | 8 +++++---
> > .../selftests/bpf/progs/test_core_reloc_ints.c | 18 ++++++++++--------
> > .../bpf/progs/test_core_reloc_kernel.c | 6 ++++--
> > .../selftests/bpf/progs/test_core_reloc_misc.c | 8 +++++---
> > .../selftests/bpf/progs/test_core_reloc_mods.c | 18 ++++++++++--------
> > .../bpf/progs/test_core_reloc_nesting.c | 6 ++++--
> > .../bpf/progs/test_core_reloc_primitives.c | 12 +++++++-----
> > .../bpf/progs/test_core_reloc_ptr_as_arr.c | 4 +++-
> > 9 files changed, 54 insertions(+), 36 deletions(-)
> >
>
> Starting to get many layers of macros here but makes sense here.
Yeah, a bit. I was considering to either switch to bpf_core_read()
with explicit sizeof or making bpf_core_read() deriving sizeof(), but
didn't because:
1. wanted to keep bpf_core_read() a direct "substitute" for bpf_probe_read()
2. figured one copy-pasted #define for each of few files is small
enough price for much more readable tests
>
> Acked-by: John Fastabend <john.fastabend@...il.com>
Thanks for review!
Powered by blists - more mailing lists