From: Andrii Nakryiko <andrii.nakryiko@gmail.com>
To: "Toke Høiland-Jørgensen" <toke@redhat.com>
Cc: Daniel Borkmann <daniel@iogearbox.net>,
Alexei Starovoitov <ast@kernel.org>,
Martin KaFai Lau <kafai@fb.com>, Song Liu <songliubraving@fb.com>,
Yonghong Song <yhs@fb.com>,
Jesper Dangaard Brouer <brouer@redhat.com>,
David Miller <davem@davemloft.net>,
Networking <netdev@vger.kernel.org>, bpf <bpf@vger.kernel.org>
Subject: Re: [PATCH bpf-next v5 5/5] selftests: Add tests for automatic map pinning
Date: Fri, 1 Nov 2019 22:07:58 -0700 [thread overview]
Message-ID: <CAEf4BzYWgnek1QYyQm4U0qakP=Si0vEJ2bLKHeJhambyX7EnCQ@mail.gmail.com> (raw)
In-Reply-To: <157260198209.335202.12139424443191715742.stgit@toke.dk>
On Fri, Nov 1, 2019 at 2:53 AM Toke Høiland-Jørgensen <toke@redhat.com> wrote:
>
> From: Toke Høiland-Jørgensen <toke@redhat.com>
>
> This adds a new BPF selftest to exercise the new automatic map pinning
> code.
>
> Acked-by: Andrii Nakryiko <andriin@fb.com>
I don't believe I acked this patch before, must have been added by
mistake. But either way thanks for improving tests and testing a good
variety of scenarios, I appreciate the work. Please fix bpf_object
leak below and keep my Acked-by :)
> Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
> ---
> tools/testing/selftests/bpf/prog_tests/pinning.c | 208 ++++++++++++++++++++
> tools/testing/selftests/bpf/progs/test_pinning.c | 31 +++
> .../selftests/bpf/progs/test_pinning_invalid.c | 16 ++
> 3 files changed, 255 insertions(+)
> create mode 100644 tools/testing/selftests/bpf/prog_tests/pinning.c
> create mode 100644 tools/testing/selftests/bpf/progs/test_pinning.c
> create mode 100644 tools/testing/selftests/bpf/progs/test_pinning_invalid.c
>
[...]
> + /* should fail because of map parameter mismatch */
> + err = bpf_object__load(obj);
> + if (CHECK(err != -EINVAL, "param mismatch load", "err %d errno %d\n", err, errno))
> + goto out;
> +
You need to close obj here, before overwriting it below?
> + /* test auto-pinning at custom path with open opt */
> + obj = bpf_object__open_file(file, &opts);
> + if (CHECK_FAIL(libbpf_get_error(obj))) {
> + obj = NULL;
> + goto out;
> + }
[...]
next prev parent reply other threads:[~2019-11-02 5:08 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-01 9:52 [PATCH bpf-next v5 0/5] libbpf: Support automatic pinning of maps using 'pinning' BTF attribute Toke Høiland-Jørgensen
2019-11-01 9:52 ` [PATCH bpf-next v5 1/5] libbpf: Fix error handling in bpf_map__reuse_fd() Toke Høiland-Jørgensen
2019-11-01 9:52 ` [PATCH bpf-next v5 2/5] libbpf: Store map pin path and status in struct bpf_map Toke Høiland-Jørgensen
2019-11-02 5:10 ` Andrii Nakryiko
2019-11-02 10:57 ` Toke Høiland-Jørgensen
2019-11-01 9:52 ` [PATCH bpf-next v5 3/5] libbpf: Move directory creation into _pin() functions Toke Høiland-Jørgensen
2019-11-01 9:53 ` [PATCH bpf-next v5 4/5] libbpf: Add auto-pinning of maps when loading BPF objects Toke Høiland-Jørgensen
2019-11-01 9:53 ` [PATCH bpf-next v5 5/5] selftests: Add tests for automatic map pinning Toke Høiland-Jørgensen
2019-11-02 5:07 ` Andrii Nakryiko [this message]
2019-11-02 10:56 ` Toke Høiland-Jørgensen
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='CAEf4BzYWgnek1QYyQm4U0qakP=Si0vEJ2bLKHeJhambyX7EnCQ@mail.gmail.com' \
--to=andrii.nakryiko@gmail.com \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=brouer@redhat.com \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=kafai@fb.com \
--cc=netdev@vger.kernel.org \
--cc=songliubraving@fb.com \
--cc=toke@redhat.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).