bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v4 bpf-next 0/3] Auto-generate list of BPF helpers
@ 2019-10-07  3:07 Andrii Nakryiko
  2019-10-07  3:07 ` [PATCH v4 bpf-next 1/3] uapi/bpf: fix helper docs Andrii Nakryiko
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: Andrii Nakryiko @ 2019-10-07  3:07 UTC (permalink / raw)
  To: bpf, netdev, ast, daniel, quentin.monnet
  Cc: andrii.nakryiko, kernel-team, Andrii Nakryiko

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

-- 
2.17.1


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2019-10-10 23:55 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-07  3:07 [PATCH v4 bpf-next 0/3] Auto-generate list of BPF helpers Andrii Nakryiko
2019-10-07  3:07 ` [PATCH v4 bpf-next 1/3] uapi/bpf: fix helper docs Andrii Nakryiko
2019-10-07  9:43   ` Daniel Borkmann
2019-10-07 17:47     ` Andrii Nakryiko
2019-10-08 21:49       ` Daniel Borkmann
2019-10-08 23:32         ` Andrii Nakryiko
2019-10-10 23:55           ` Daniel Borkmann
2019-10-07  3:07 ` [PATCH v4 bpf-next 2/3] scripts/bpf: teach bpf_helpers_doc.py to dump BPF helper definitions Andrii Nakryiko
2019-10-07  3:07 ` [PATCH v4 bpf-next 3/3] libbpf: auto-generate list of " Andrii Nakryiko
2019-10-07  5:35 ` [PATCH v4 bpf-next 0/3] Auto-generate list of BPF helpers Alexei Starovoitov

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