bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alexei Starovoitov <alexei.starovoitov@gmail.com>
To: Andrii Nakryiko <andriin@fb.com>
Cc: bpf <bpf@vger.kernel.org>,
	Network Development <netdev@vger.kernel.org>,
	Alexei Starovoitov <ast@fb.com>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Andrii Nakryiko <andrii.nakryiko@gmail.com>,
	Kernel Team <kernel-team@fb.com>
Subject: Re: [PATCH v2 bpf-next 0/5] Add CO-RE support for field existence relos
Date: Tue, 15 Oct 2019 16:14:21 -0700	[thread overview]
Message-ID: <CAADnVQ+m_TAbo27QSEk1MeUsprtUE9HLzF0QwSFGxVfNrjRd0w@mail.gmail.com> (raw)
In-Reply-To: <20191015182849.3922287-1-andriin@fb.com>

On Tue, Oct 15, 2019 at 2:26 PM Andrii Nakryiko <andriin@fb.com> wrote:
>
> This patch set generalizes libbpf's CO-RE relocation support. In addition to
> existing field's byte offset relocation, libbpf now supports field existence
> relocations, which are emitted by Clang when using
> __builtin_preserve_field_info(<field>, BPF_FIELD_EXISTS). A convenience
> bpf_core_field_exists() macro is added to bpf_core_read.h BPF-side header,
> along the bpf_field_info_kind enum containing currently supported types of
> field information libbpf supports. This list will grow as libbpf gains support
> for other relo kinds.
>
> This patch set upgrades the format of .BTF.ext's relocation record to match
> latest Clang's format (12 -> 16 bytes). This is not a breaking change, as the
> previous format hasn't been released yet as part of official Clang version
> release.
>
> v1->v2:
> - unify bpf_field_info_kind enum and naming changes (Alexei);
> - added bpf_core_field_exists() to bpf_core_read.h.

I'm not excited about duplicated enum definition for libbpf internal
and bpf prog purpose, but it's a lesser evil.
If we do new .h now to be shared between bpf progs and libbpf
it could be too early in release cycle. Both libbpf and llvm side
may still change. So let's make a note to clean it up later when
we're sure on numbers and whether numbers will indeed be
the same in .btf.ext and in what bpf prog passes to llvm.
Applied to bpf-next. Thanks

      parent reply	other threads:[~2019-10-15 23:14 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-15 18:28 [PATCH v2 bpf-next 0/5] Add CO-RE support for field existence relos Andrii Nakryiko
2019-10-15 18:28 ` [PATCH v2 bpf-next 1/5] libbpf: update BTF reloc support to latest Clang format Andrii Nakryiko
2019-10-15 18:28 ` [PATCH v2 bpf-next 2/5] libbpf: refactor bpf_object__open APIs to use common opts Andrii Nakryiko
2019-10-15 18:28 ` [PATCH v2 bpf-next 3/5] libbpf: add support for field existance CO-RE relocation Andrii Nakryiko
2019-10-15 18:28 ` [PATCH v2 bpf-next 4/5] libbpf: add BPF-side definitions of supported field relocation kinds Andrii Nakryiko
2019-10-15 18:28 ` [PATCH v2 bpf-next 5/5] selftests/bpf: add field existence CO-RE relocs tests Andrii Nakryiko
2019-10-15 23:14 ` Alexei Starovoitov [this message]

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+m_TAbo27QSEk1MeUsprtUE9HLzF0QwSFGxVfNrjRd0w@mail.gmail.com \
    --to=alexei.starovoitov@gmail.com \
    --cc=andrii.nakryiko@gmail.com \
    --cc=andriin@fb.com \
    --cc=ast@fb.com \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=kernel-team@fb.com \
    --cc=netdev@vger.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;
as well as URLs for NNTP newsgroup(s).