Skip to content

libbpf: support non-mmap()'able data sections

Andrii Nakryiko bpf 2 versions – Applied

Status from this message: This series was applied to bpf/bpf-next.git (master)

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest3 patches 2 repliesApplied 3/3
  2. v13 patches 8 repliesSuperseded

Changes in v2 from the cover letter

- address Stanislav's feedback, adds acks.

Patches in v2 All 3 applied

#Subject and filesSizeRepliesApplied
1/3libbpf: clean up and refactor BTF fixup steptools/lib/bpf/libbpf.c+42 -540 repliesApplied
2/3libbpf: only add BPF_F_MMAPABLE flag for data maps with global varstools/lib/bpf/libbpf.c+78 -191 replyApplied
3/3libbpf: add non-mmapable data section selftesttools/testing/selftests/bpf/prog_tests/skeleton.c tools/testing/selftests/bpf/progs/test_skeleton.c+27 -10 repliesApplied

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.

PatchStanislav FomichevDave MarchevskyKumar Kartikeya Dwivedi
SeriesA-b
1/3A-b
2/3A-b A-b
3/3A-b A-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] libbpf: support non-mmap()'able data sections

Make libbpf more conservative in using BPF_F_MMAPABLE flag with internal BPF array maps that are backing global data sections. See patch #2 for full description and justification.

Changes in this dataset support having bpf_spinlock, kptr, rb_tree nodes and other "special" variables as global variables. Combining this with libbpf's existing support for multiple custom .data.* sections allows BPF programs to utilize multiple spinlock/rbtree_node/kptr variables in a pretty natural way by just putting all such variables into separate data sections (and thus ARRAY maps).

v1->v2:
- address Stanislav's feedback, adds acks.

Andrii Nakryiko (3):
libbpf: clean up and refactor BTF fixup step
libbpf: only add BPF_F_MMAPABLE flag for data maps with global vars
libbpf: add non-mmapable data section selftest

 tools/lib/bpf/libbpf.c                        | 177 +++++++++++-------
 .../selftests/bpf/prog_tests/skeleton.c       |  11 +-
 .../selftests/bpf/progs/test_skeleton.c       |  17 ++
 3 files changed, 139 insertions(+), 66 deletions(-)
Signature · 1 line
2.30.2