From: Eduard Zingerman <eddyz87@gmail.com>
To: Song Liu <song@kernel.org>
Cc: bpf <bpf@vger.kernel.org>, Alexei Starovoitov <ast@kernel.org>,
Andrii Nakryiko <andrii@kernel.org>,
Daniel Borkmann <daniel@iogearbox.net>,
Kernel Team <kernel-team@fb.com>,
joannelkoong@gmail.com
Subject: Re: [PATCH bpf-next v4 2/5] selftests/bpf: allow BTF specs and func infos in test_verifier tests
Date: Fri, 10 Jun 2022 22:16:05 +0300 [thread overview]
Message-ID: <d28e28eafdd3f62160aa01f21d75b5c6581aaac2.camel@gmail.com> (raw)
In-Reply-To: <CAPhsuW4+BVYjodLT2tH3emqXzZxv1D7c3Tu5YuYtpB-1Vwtn5w@mail.gmail.com>
> On Fri, 2022-06-10 at 11:09 -0700, Song Liu wrote:
> > +static int load_btf_for_test(struct bpf_test *test)
> > +{
> > + int types_num = 0;
> > +
> > + while (types_num < MAX_BTF_TYPES &&
> > + test->btf_types[types_num] != BTF_END_RAW)
> > + ++types_num;
> > +
> > + int types_len = types_num * sizeof(test->btf_types[0]);
> > +
> > + return load_btf_spec(test->btf_types, types_len,
> > + test->btf_strings, sizeof(test->btf_strings));
>
> IIUC, strings_len is always 256. Is this expected?
Yes, as long as strings are zero terminated the actual buffer size
shouldn't matter. So I decided that it would be better to avoid
strings length specification in the test definition to keep things
simpler.
Thanks,
Eduard
next prev parent reply other threads:[~2022-06-10 19:16 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-08 19:26 [PATCH bpf-next v4 0/5] bpf_loop inlining Eduard Zingerman
2022-06-08 19:26 ` [PATCH bpf-next v4 1/5] selftests/bpf: specify expected instructions in test_verifier tests Eduard Zingerman
2022-06-10 17:56 ` Song Liu
2022-06-08 19:26 ` [PATCH bpf-next v4 2/5] selftests/bpf: allow BTF specs and func infos " Eduard Zingerman
2022-06-10 18:09 ` Song Liu
2022-06-10 19:16 ` Eduard Zingerman [this message]
2022-06-10 20:56 ` Song Liu
2022-06-08 19:26 ` [PATCH bpf-next v4 3/5] bpf: Inline calls to bpf_loop when callback is known Eduard Zingerman
2022-06-09 14:56 ` kernel test robot
2022-06-10 20:54 ` Song Liu
2022-06-10 21:54 ` Eduard Zingerman
2022-06-10 22:40 ` Song Liu
2022-06-10 22:49 ` Eduard Zingerman
2022-06-10 23:01 ` Song Liu
2022-06-10 23:21 ` Eduard Zingerman
2022-06-11 1:46 ` Song Liu
2022-06-08 19:26 ` [PATCH bpf-next v4 4/5] selftests/bpf: BPF test_verifier selftests for bpf_loop inlining Eduard Zingerman
2022-06-10 18:14 ` Song Liu
2022-06-10 19:20 ` Eduard Zingerman
2022-06-10 20:57 ` Song Liu
2022-06-08 19:26 ` [PATCH bpf-next v4 5/5] selftests/bpf: BPF test_prog " Eduard Zingerman
2022-06-10 18:15 ` Song Liu
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=d28e28eafdd3f62160aa01f21d75b5c6581aaac2.camel@gmail.com \
--to=eddyz87@gmail.com \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=joannelkoong@gmail.com \
--cc=kernel-team@fb.com \
--cc=song@kernel.org \
/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