bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alexei Starovoitov <alexei.starovoitov@gmail.com>
To: Andrii Nakryiko <andrii@kernel.org>
Cc: bpf <bpf@vger.kernel.org>,
	Network Development <netdev@vger.kernel.org>,
	Alexei Starovoitov <ast@fb.com>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Kernel Team <kernel-team@fb.com>
Subject: Re: [PATCH v4 bpf-next 00/12] BPF static linking
Date: Thu, 18 Mar 2021 16:29:27 -0700	[thread overview]
Message-ID: <CAADnVQ+scK73Y194eUpRAJ9_gbOPgQ9Peo05F2NAkGv5EJAJ+g@mail.gmail.com> (raw)
In-Reply-To: <20210318194036.3521577-1-andrii@kernel.org>

On Thu, Mar 18, 2021 at 12:42 PM Andrii Nakryiko <andrii@kernel.org> wrote:
> This patch set adds new libbpf APIs and their bpftool integration that allows
> to perform static linking of BPF object files. Currently no extern resolution
> across object files is performed. This is going to be the focus of the follow
> up patches. But, given amount of code and logic necessary to perform just
> basic functionality of linking together mostly independent BPF object files,
> it was decided to land basic BPF linker code and logic first and extend it
> afterwards.
> The motivation for BPF static linking is to provide the functionality that is
> naturally assumed for user-space development process: ability to structure
> application's code without artificial restrictions of having all the code and
> data (variables and maps) inside a single source code file.
> This enables better engineering practices of splitting code into
> well-encapsulated parts. It provides ability to hide internal state from other
> parts of the code base through static variables and maps. It is also a first
> steps towards having generic reusable BPF libraries.
> Please see individual patches (mostly #6 and #7) for more details. Patch #10
> passes all test_progs' individual BPF .o files through BPF static linker,
> which is supposed to be a no-op operation, so is essentially validating that
> BPF static linker doesn't produce corrupted ELF object files. Patch #11 adds
> Makefile infra to be able to specify multi-file BPF object files and adds the
> first multi-file test to validate correctness.
> v3->v4:
>   - fix Makefile copy/paste error of diff'ing invalid object files (Alexei);
>   - fix uninitialized obj_name variable that could lead to bogus object names
>     being used during skeleton generation (kernel-patches CI);


      parent reply	other threads:[~2021-03-18 23:30 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-18 19:40 Andrii Nakryiko
2021-03-18 19:40 ` [PATCH v4 bpf-next 01/12] libbpf: expose btf_type_by_id() internally Andrii Nakryiko
2021-03-18 19:40 ` [PATCH v4 bpf-next 02/12] libbpf: generalize BTF and BTF.ext type ID and strings iteration Andrii Nakryiko
2021-03-18 19:40 ` [PATCH v4 bpf-next 03/12] libbpf: rename internal memory-management helpers Andrii Nakryiko
2021-03-18 19:40 ` [PATCH v4 bpf-next 04/12] libbpf: extract internal set-of-strings datastructure APIs Andrii Nakryiko
2021-03-18 19:40 ` [PATCH v4 bpf-next 05/12] libbpf: add generic BTF type shallow copy API Andrii Nakryiko
2021-03-18 19:40 ` [PATCH v4 bpf-next 06/12] libbpf: add BPF static linker APIs Andrii Nakryiko
2021-03-18 19:40 ` [PATCH v4 bpf-next 07/12] libbpf: add BPF static linker BTF and BTF.ext support Andrii Nakryiko
2021-03-19 16:23   ` Jiri Olsa
2021-03-19 18:39     ` Andrii Nakryiko
2021-03-19 18:58       ` Jiri Olsa
2021-03-28 12:03         ` Jiri Olsa
2021-03-28 18:29           ` Andrii Nakryiko
2021-03-29 11:16             ` Jiri Olsa
2021-03-18 19:40 ` [PATCH v4 bpf-next 08/12] bpftool: add ability to specify custom skeleton object name Andrii Nakryiko
2021-03-18 19:40 ` [PATCH v4 bpf-next 09/12] bpftool: add `gen object` command to perform BPF static linking Andrii Nakryiko
2021-03-18 19:40 ` [PATCH v4 bpf-next 10/12] selftests/bpf: re-generate vmlinux.h and BPF skeletons if bpftool changed Andrii Nakryiko
2021-03-18 19:40 ` [PATCH v4 bpf-next 11/12] selftests/bpf: pass all BPF .o's through BPF static linker Andrii Nakryiko
2021-03-18 19:40 ` [PATCH v4 bpf-next 12/12] selftests/bpf: add multi-file statically linked BPF object file test Andrii Nakryiko
2021-03-18 23:29 ` 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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAADnVQ+scK73Y194eUpRAJ9_gbOPgQ9Peo05F2NAkGv5EJAJ+g@mail.gmail.com \
    --to=alexei.starovoitov@gmail.com \
    --cc=andrii@kernel.org \
    --cc=ast@fb.com \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=kernel-team@fb.com \
    --cc=netdev@vger.kernel.org \
    --subject='Re: [PATCH v4 bpf-next 00/12] BPF static linking' \


* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

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).