Skip to content

bpf: Program extensions or dynamic re-linking

Alexei Starovoitov bpf netdev 2 versions – Applied

Status from this message: Applied, thanks!

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest3 patches 13 repliesApplied
  2. v13 patches 4 repliesSuperseded

Changes in v2 from the cover letter

- addressed Andrii's comments
- rebase

Patches in v2 Applied

#Subject and filesSizeRepliesApplied
1/3bpf: Introduce dynamic program extensionsinclude/linux/bpf.h include/linux/bpf_types.h include/linux/btf.h +5 more+283 -286 replies
2/3libbpf: Add support for program extensionstools/include/uapi/linux/bpf.h tools/lib/bpf/bpf.c tools/lib/bpf/libbpf.c +3 more+18 -41 reply
3/3selftests/bpf: Add tests for program extensionstools/testing/selftests/bpf/prog_tests/fexit_bpf2bpf.c tools/testing/selftests/bpf/progs/fexit_bpf2bpf.c tools/testing/selftests/bpf/progs/test_pkt_access.c+83 -21 reply

Reviews trailers per patch

All 3 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchToke Høiland-JørgensenJohn FastabendAndrii Nakryiko
SeriesA-b A-b
1/3A-b
2/3A-b
3/3A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v2 thread

Cover letter [PATCH v2 bpf-next 0/3] bpf: Program extensions or dynamic re-linking

The last few month BPF community has been discussing an approach to call chaining, since exiting bpt_tail_call() mechanism used in production XDP programs has plenty of downsides. The outcome of these discussion was a conclusion to implement dynamic re-linking of BPF programs. Where rootlet XDP program attached to a netdevice can programmatically define a policy of execution of other XDP programs. Such rootlet would be compiled as normal XDP program and provide a number of placeholder global functions which later can be replaced with future XDP programs. BPF trampoline, function by function verification were building blocks towards that goal. The patch 1 is a final building block. It introduces dynamic program extensions. A number of improvements like more flexible function by function verification and better libbpf api will be implemented in future patches.

v1->v2:
- addressed Andrii's comments
- rebase

Alexei Starovoitov (3):
bpf: Introduce dynamic program extensions
libbpf: Add support for program extensions
selftests/bpf: Add tests for program extensions

 include/linux/bpf.h                           |  10 +-
 include/linux/bpf_types.h                     |   2 +
 include/linux/btf.h                           |   5 +
 include/uapi/linux/bpf.h                      |   1 +
 kernel/bpf/btf.c                              | 152 +++++++++++++++++-
 kernel/bpf/syscall.c                          |  15 +-
 kernel/bpf/trampoline.c                       |  41 ++++-
 kernel/bpf/verifier.c                         |  85 +++++++---
 tools/include/uapi/linux/bpf.h                |   1 +
 tools/lib/bpf/bpf.c                           |   3 +-
 tools/lib/bpf/libbpf.c                        |  13 +-
 tools/lib/bpf/libbpf.h                        |   2 +
 tools/lib/bpf/libbpf.map                      |   2 +
 tools/lib/bpf/libbpf_probes.c                 |   1 +
 .../selftests/bpf/prog_tests/fexit_bpf2bpf.c  |  20 ++-
 .../selftests/bpf/progs/fexit_bpf2bpf.c       |  57 +++++++
 .../selftests/bpf/progs/test_pkt_access.c     |   8 +-
 17 files changed, 384 insertions(+), 34 deletions(-)
Signature · 1 line
2.23.0