BPF static linker: support static vars and maps
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v2 Latest6 patches 40 repliesIn review
- v16 patches 0 repliesSuperseded
Changes in v2 from the cover letter
- rebased on top of v3 of BPF static linker extern support patch set;
- dropped selftests doc update, which went into mentioned patch set;
- added skip modifiers for .data/.bss which was missed on initial submission.
Patches in v2 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/6 | bpftool: strip const/volatile/restrict modifiers from .bss and .data varstools/ | +2 | 1 reply | |
| 2/6 | libbpf: rename static variables during linkingtools/ tools/ tools/ +9 more | +151 | 34 replies | |
| 3/6 | libbpf: support static map definitionstools/ | +5 | 1 reply | |
| 4/6 | bpftool: handle transformed static map names in BPF skeletontools/ | +22 | 1 reply | |
| 5/6 | selftests/bpf: extend linked_vars selftests with static variablestools/ tools/ tools/ | +14 | 2 replies | |
| 6/6 | selftests/bpf: extend linked_maps selftests with static mapstools/ tools/ tools/ | +50 | 1 reply |
Reviews trailers per patch
5 of 6 patches have a Reviewed-by or Acked-by.
| Patch | Yonghong Song |
|---|---|
| 1/6 | A-b |
| 2/6 | |
| 3/6 | A-b |
| 4/6 | A-b |
| 5/6 | A-b A-b |
| 6/6 | A-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v2 bpf-next 0/6] BPF static linker: support static vars and maps
Deal with static variables and maps better to make them work with BPF skeleton well. All static variables and maps are renamed in corresponding BTF information so as to have an "<obj_name>.." prefix, which allows to distinguish name-conflicting static entities between multiple linked files.
Also make libbpf support static maps properly. Previously static map reference resulted in the most probably erroneous use of the very *first* defined map, because it was the one with offset 0. Now static map references are resolved properly and thus static maps are finally usable. BPF static linker already supports static maps and no further changes are required, beyond variable renaming.
Patch #1 adds missed documentation of the latest Clang dependency.
N.B. This patch set is based on top of patch set [0].
[0] https://patchwork.kernel.org/project/netdevbpf/list/?series=472405&state=*
v1->v2:
- rebased on top of v3 of BPF static linker extern support patch set;
- dropped selftests doc update, which went into mentioned patch set;
- added skip modifiers for .data/.bss which was missed on initial submission.
Andrii Nakryiko (6):
bpftool: strip const/volatile/restrict modifiers from .bss and .data
vars
libbpf: rename static variables during linking
libbpf: support static map definitions
bpftool: handle transformed static map names in BPF skeleton selftests/bpf: extend linked_vars selftests with static variables selftests/bpf: extend linked_maps selftests with static maps
tools/bpf/bpftool/gen.c | 40 +++--- tools/lib/bpf/libbpf.c | 7 +- tools/lib/bpf/libbpf.h | 12 +- tools/lib/bpf/linker.c | 121 +++++++++++++++++- .../selftests/bpf/prog_tests/linked_maps.c | 20 ++- .../selftests/bpf/prog_tests/linked_vars.c | 12 +- .../selftests/bpf/prog_tests/skeleton.c | 8 +- .../selftests/bpf/prog_tests/static_linked.c | 8 +- .../selftests/bpf/progs/bpf_iter_test_kern4.c | 4 +- .../selftests/bpf/progs/linked_maps1.c | 13 ++ .../selftests/bpf/progs/linked_maps2.c | 18 +++ .../selftests/bpf/progs/linked_vars1.c | 4 +- .../selftests/bpf/progs/linked_vars2.c | 4 +- .../selftests/bpf/progs/test_check_mtu.c | 4 +- .../selftests/bpf/progs/test_cls_redirect.c | 4 +- .../bpf/progs/test_snprintf_single.c | 2 +- .../selftests/bpf/progs/test_sockmap_listen.c | 4 +- .../selftests/bpf/progs/test_static_linked1.c | 6 +- .../selftests/bpf/progs/test_static_linked2.c | 4 +- 19 files changed, 244 insertions(+), 51 deletions(-)
Signature · 1 line
2.30.2