From: Alexei Starovoitov <alexei.starovoitov@gmail.com>
To: Pedro Tammela <pctammela@gmail.com>
Cc: Alexei Starovoitov <ast@kernel.org>,
Daniel Borkmann <daniel@iogearbox.net>,
Andrii Nakryiko <andrii@kernel.org>,
Martin KaFai Lau <kafai@fb.com>, Song Liu <songliubraving@fb.com>,
Yonghong Song <yhs@fb.com>,
John Fastabend <john.fastabend@gmail.com>,
KP Singh <kpsingh@kernel.org>, Shuah Khan <shuah@kernel.org>,
Pedro Tammela <pctammela@mojatatu.com>,
David Verbeiren <david.verbeiren@tessares.net>,
Matthieu Baerts <matthieu.baerts@tessares.net>,
Network Development <netdev@vger.kernel.org>,
bpf <bpf@vger.kernel.org>
Subject: Re: [PATCH bpf-next v4 2/3] bpf: selftests: remove percpu macros from bpf_util.h
Date: Mon, 19 Apr 2021 18:17:18 -0700 [thread overview]
Message-ID: <CAADnVQ+XtLj2vUmfazYu8-k3+bd0bJFJUTZWGRBALV1xy-vqFg@mail.gmail.com> (raw)
In-Reply-To: <20210415174619.51229-3-pctammela@mojatatu.com>
On Thu, Apr 15, 2021 at 10:47 AM Pedro Tammela <pctammela@gmail.com> wrote:
>
> Andrii suggested to remove this abstraction layer and have the percpu
> handling more explicit[1].
>
> This patch also updates the tests that relied on the macros.
>
> [1] https://lore.kernel.org/bpf/CAEf4BzYmj_ZPDq8Zi4dbntboJKRPU2TVopysBNrdd9foHTfLZw@mail.gmail.com/
>
> Suggested-by: Andrii Nakryiko <andrii@kernel.org>
> Signed-off-by: Pedro Tammela <pctammela@mojatatu.com>
> ---
> tools/testing/selftests/bpf/bpf_util.h | 7 --
> .../bpf/map_tests/htab_map_batch_ops.c | 87 +++++++++----------
> .../selftests/bpf/prog_tests/map_init.c | 9 +-
> tools/testing/selftests/bpf/test_maps.c | 84 +++++++++++-------
> 4 files changed, 96 insertions(+), 91 deletions(-)
>
> diff --git a/tools/testing/selftests/bpf/bpf_util.h b/tools/testing/selftests/bpf/bpf_util.h
> index a3352a64c067..105db3120ab4 100644
> --- a/tools/testing/selftests/bpf/bpf_util.h
> +++ b/tools/testing/selftests/bpf/bpf_util.h
> @@ -20,13 +20,6 @@ static inline unsigned int bpf_num_possible_cpus(void)
> return possible_cpus;
> }
>
> -#define __bpf_percpu_val_align __attribute__((__aligned__(8)))
> -
> -#define BPF_DECLARE_PERCPU(type, name) \
> - struct { type v; /* padding */ } __bpf_percpu_val_align \
> - name[bpf_num_possible_cpus()]
> -#define bpf_percpu(name, cpu) name[(cpu)].v
> -
Hmm. I wonder what Daniel has to say about it, since he
introduced it in commit f3515b5d0b71 ("bpf: provide a generic macro
for percpu values for selftests")
to address a class of bugs.
next prev parent reply other threads:[~2021-04-20 1:17 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-15 17:46 [PATCH bpf-next v4 0/3] add batched ops for percpu array Pedro Tammela
2021-04-15 17:46 ` [PATCH bpf-next v4 1/3] bpf: add batched ops support " Pedro Tammela
2021-04-15 17:46 ` [PATCH bpf-next v4 2/3] bpf: selftests: remove percpu macros from bpf_util.h Pedro Tammela
2021-04-20 1:17 ` Alexei Starovoitov [this message]
2021-04-20 15:58 ` Daniel Borkmann
2021-04-20 16:42 ` Andrii Nakryiko
2021-04-22 19:27 ` Pedro Tammela
2021-04-15 17:46 ` [PATCH bpf-next v4 3/3] bpf: selftests: update array map tests for per-cpu batched ops Pedro Tammela
2021-04-16 21:35 ` [PATCH bpf-next v4 0/3] add batched ops for percpu array Martin KaFai Lau
2021-04-19 17:25 ` Brian Vazquez
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=CAADnVQ+XtLj2vUmfazYu8-k3+bd0bJFJUTZWGRBALV1xy-vqFg@mail.gmail.com \
--to=alexei.starovoitov@gmail.com \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=david.verbeiren@tessares.net \
--cc=john.fastabend@gmail.com \
--cc=kafai@fb.com \
--cc=kpsingh@kernel.org \
--cc=matthieu.baerts@tessares.net \
--cc=netdev@vger.kernel.org \
--cc=pctammela@gmail.com \
--cc=pctammela@mojatatu.com \
--cc=shuah@kernel.org \
--cc=songliubraving@fb.com \
--cc=yhs@fb.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).