Skip to content

Auto-generate list of BPF helpers

Andrii Nakryiko bpf netdev 4 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. v4 Latest3 patches 6 repliesApplied
  2. v33 patches 5 repliesSuperseded
  3. v23 patches 2 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v13 patches4 repliesSuperseded

Changes in v4 from the cover letter

- instead of libbpf's Makefile, integrate with selftest/bpf's Makefile (Alexei);

Patches in v4 Applied

#Subject and filesSizeRepliesApplied
1/3uapi/bpf: fix helper docsinclude/uapi/linux/bpf.h tools/include/uapi/linux/bpf.h+32 -325 replies
2/3scripts/bpf: teach bpf_helpers_doc.py to dump BPF helper definitionsscripts/bpf_helpers_doc.py+154 -10 replies
3/3libbpf: auto-generate list of BPF helper definitionstools/testing/selftests/bpf/.gitignore tools/testing/selftests/bpf/Makefile tools/testing/selftests/bpf/bpf_helpers.h+9 -2640 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v4 yet.

Read the v4 thread

Cover letter [PATCH v4 bpf-next 0/3] Auto-generate list of BPF helpers

This patch set adds ability to auto-generate list of BPF helper definitions. It relies on existing scripts/bpf_helpers_doc.py and include/uapi/linux/bpf.h having a well-defined set of comments. bpf_helper_defs.h contains all BPF helper signatures which stay in sync with latest bpf.h UAPI. This auto-generated header is included from bpf_helpers.h, while all previously hand-written BPF helper definitions are simultaneously removed in patch #3. The end result is less manually maintained and redundant boilerplate code, while also more consistent and well-documented set of BPF helpers. Generated helper definitions are completely independent from a specific bpf.h on a target system, because it doesn't use BPF_FUNC_xxx enums.

v3->v4:
- instead of libbpf's Makefile, integrate with selftest/bpf's Makefile (Alexei);

v2->v3:
- delete bpf_helper_defs.h properly (Alexei);

v1->v2:
- add bpf_helper_defs.h to .gitignore and make clean (Alexei).

Andrii Nakryiko (3):
uapi/bpf: fix helper docs
scripts/bpf: teach bpf_helpers_doc.py to dump BPF helper definitions
libbpf: auto-generate list of BPF helper definitions

 include/uapi/linux/bpf.h                  |  32 +--
 scripts/bpf_helpers_doc.py                | 155 ++++++++++++-
 tools/include/uapi/linux/bpf.h            |  32 +--
 tools/testing/selftests/bpf/.gitignore    |   1 +
 tools/testing/selftests/bpf/Makefile      |   8 +-
 tools/testing/selftests/bpf/bpf_helpers.h | 264 +---------------------
 6 files changed, 195 insertions(+), 297 deletions(-)
Signature · 1 line
2.17.1