From: Jesper Dangaard Brouer <brouer@redhat.com>
To: Yonghong Song <yhs@fb.com>
Cc: "Toke Høiland-Jørgensen" <toke@redhat.com>,
"Daniel Borkmann" <daniel@iogearbox.net>,
"Alexei Starovoitov" <ast@kernel.org>,
"Martin Lau" <kafai@fb.com>, "Song Liu" <songliubraving@fb.com>,
"Andrii Nakryiko" <andrii.nakryiko@gmail.com>,
"David Miller" <davem@davemloft.net>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
"bpf@vger.kernel.org" <bpf@vger.kernel.org>,
brouer@redhat.com, "Anton Protopopov" <aspsk2@gmail.com>
Subject: Re: [PATCH bpf-next v3 4/4] selftests: Add tests for automatic map pinning
Date: Mon, 28 Oct 2019 17:13:03 +0100 [thread overview]
Message-ID: <20191028171303.3e7e4601@carbon> (raw)
In-Reply-To: <483546c6-14b9-e1f1-b4c1-424d6b8d4ace@fb.com>
On Mon, 28 Oct 2019 15:32:26 +0000
Yonghong Song <yhs@fb.com> wrote:
> On 10/28/19 6:15 AM, Toke Høiland-Jørgensen wrote:
> > Jesper Dangaard Brouer <brouer@redhat.com> writes:
> >
> >> On Sun, 27 Oct 2019 21:53:19 +0100
> >> Toke Høiland-Jørgensen <toke@redhat.com> wrote:
> >>
> >>> diff --git a/tools/testing/selftests/bpf/progs/test_pinning.c b/tools/testing/selftests/bpf/progs/test_pinning.c
> >>> new file mode 100644
> >>> index 000000000000..ff2d7447777e
> >>> --- /dev/null
> >>> +++ b/tools/testing/selftests/bpf/progs/test_pinning.c
> >>> @@ -0,0 +1,29 @@
> >>> +// SPDX-License-Identifier: GPL-2.0
> >>> +
> >>> +#include <linux/bpf.h>
> >>> +#include "bpf_helpers.h"
> >>> +
> >>> +int _version SEC("version") = 1;
> >>> +
> >>> +struct {
> >>> + __uint(type, BPF_MAP_TYPE_ARRAY);
> >>> + __uint(max_entries, 1);
> >>> + __type(key, __u32);
> >>> + __type(value, __u64);
> >>> + __uint(pinning, LIBBPF_PIN_BY_NAME);
> >>> +} pinmap SEC(".maps");
> >>
> >> So, this is the new BTF-defined maps syntax.
> >>
> >> Please remind me, what version of LLVM do we need to compile this?
> >
> > No idea what the minimum version is. I'm running LLVM 9.0 :)
>
> LLVM 9.0 starts to support .maps.
> There is no dependency on pahole.
LLVM 9.0.0 is still very new:
- 19 September 2019: LLVM 9.0.0 is now available
For my XDP-tutorial[1], I cannot required people to have this new llvm
version. But I would like to teach people about this new syntax (note,
I can upgrade libbpf version via git-submodule, and update bpf_helpers.h).
To Andrii, any recommendations on how I can do the transition?
I'm thinking, it should be possible to define both ELF-object sections
SEC "maps" and ".maps" at the same time. But how does libbpf handle that?
(Who takes precedence?)
(Alternatively, I can detect the LLVM version, in the Makefile, and have
a #ifdef define in the code)
--
Best regards,
Jesper Dangaard Brouer
MSc.CS, Principal Kernel Engineer at Red Hat
LinkedIn: http://www.linkedin.com/in/brouer
[1] https://github.com/xdp-project/xdp-tutorial
next prev parent reply other threads:[~2019-10-28 16:13 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-27 20:53 [PATCH bpf-next v3 0/4] libbpf: Support automatic pinning of maps using 'pinning' BTF attribute Toke Høiland-Jørgensen
2019-10-27 20:53 ` [PATCH bpf-next v3 1/4] libbpf: Fix error handling in bpf_map__reuse_fd() Toke Høiland-Jørgensen
2019-10-27 20:53 ` [PATCH bpf-next v3 2/4] libbpf: Store map pin path and status in struct bpf_map Toke Høiland-Jørgensen
2019-10-28 18:24 ` Andrii Nakryiko
2019-10-29 9:01 ` Toke Høiland-Jørgensen
2019-10-29 18:02 ` Andrii Nakryiko
2019-10-29 18:36 ` Toke Høiland-Jørgensen
2019-10-27 20:53 ` [PATCH bpf-next v3 3/4] libbpf: Add auto-pinning of maps when loading BPF objects Toke Høiland-Jørgensen
2019-10-28 18:24 ` Andrii Nakryiko
2019-10-29 9:30 ` Toke Høiland-Jørgensen
2019-10-29 18:13 ` Andrii Nakryiko
2019-10-29 18:44 ` Toke Høiland-Jørgensen
2019-10-29 18:56 ` Andrii Nakryiko
2019-10-29 19:07 ` Toke Høiland-Jørgensen
2019-10-27 20:53 ` [PATCH bpf-next v3 4/4] selftests: Add tests for automatic map pinning Toke Høiland-Jørgensen
2019-10-28 13:06 ` Jesper Dangaard Brouer
2019-10-28 13:15 ` Toke Høiland-Jørgensen
2019-10-28 15:32 ` Yonghong Song
2019-10-28 16:13 ` Jesper Dangaard Brouer [this message]
2019-10-28 17:32 ` Alexei Starovoitov
2019-10-28 18:23 ` Andrii Nakryiko
2019-10-28 18:43 ` Andrii Nakryiko
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=20191028171303.3e7e4601@carbon \
--to=brouer@redhat.com \
--cc=andrii.nakryiko@gmail.com \
--cc=aspsk2@gmail.com \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--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).