Add ability to turn off default auto-loading of each BPF program by libbpf on
BPF object load. This is the feature that allows BPF applications to have
optional functionality, which is only excercised on kernel that support
necessary features, while falling back to reduced/less performant
functionality, if kernel is outdated.

Andrii Nakryiko (2):
  libbpf: support disabling auto-loading BPF programs
  selftests/bpf: test auto-load disabling logic for BPF programs

 tools/lib/bpf/libbpf.c                        | 48 +++++++++++++++----
 tools/lib/bpf/libbpf.h                        |  2 +
 tools/lib/bpf/libbpf.map                      |  2 +
 .../selftests/bpf/prog_tests/autoload.c       | 41 ++++++++++++++++
 .../selftests/bpf/progs/test_autoload.c       | 40 ++++++++++++++++
 5 files changed, 125 insertions(+), 8 deletions(-)
 create mode 100644 tools/testing/selftests/bpf/prog_tests/autoload.c
 create mode 100644 tools/testing/selftests/bpf/progs/test_autoload.c

-- 
2.24.1

Reply via email to