1. 01 Jul, 2020 12 commits
  2. 30 Jun, 2020 2 commits
  3. 28 Jun, 2020 3 commits
    • Alexei Starovoitov's avatar
      Merge branch 'libbpf_autoload_knob' · afa12644
      Alexei Starovoitov authored
      Andrii Nakryiko says:
      
      ====================
      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.
      ====================
      Acked-by: default avatarMartin KaFai Lau <kafai@fb.com>
      Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
      afa12644
    • Andrii Nakryiko's avatar
      selftests/bpf: Test auto-load disabling logic for BPF programs · 5712174c
      Andrii Nakryiko authored
      Validate that BPF object with broken (in multiple ways) BPF program can still
      be successfully loaded, if that broken BPF program is disabled.
      Signed-off-by: default avatarAndrii Nakryiko <andriin@fb.com>
      Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
      Link: https://lore.kernel.org/bpf/20200625232629.3444003-3-andriin@fb.com
      5712174c
    • Andrii Nakryiko's avatar
      libbpf: Support disabling auto-loading BPF programs · d9297581
      Andrii Nakryiko authored
      Currently, bpf_object__load() (and by induction skeleton's load), will always
      attempt to prepare, relocate, and load into kernel every single BPF program
      found inside the BPF object file. This is often convenient and the right thing
      to do and what users expect.
      
      But there are plenty of cases (especially with BPF development constantly
      picking up the pace), where BPF application is intended to work with old
      kernels, with potentially reduced set of features. But on kernels supporting
      extra features, it would like to take a full advantage of them, by employing
      extra BPF program. This could be a choice of using fentry/fexit over
      kprobe/kretprobe, if kernel is recent enough and is built with BTF. Or BPF
      program might be providing optimized bpf_iter-based solution that user-space
      might want to use, whenever available. And so on.
      
      With libbpf and BPF CO-RE in particular, it's advantageous to not have to
      maintain two separate BPF object files to achieve this. So to enable such use
      cases, this patch adds ability to request not auto-loading chosen BPF
      programs. In such case, libbpf won't attempt to perform relocations (which
      might fail due to old kernel), won't try to resolve BTF types for
      BTF-aware (tp_btf/fentry/fexit/etc) program types, because BTF might not be
      present, and so on. Skeleton will also automatically skip auto-attachment step
      for such not loaded BPF programs.
      
      Overall, this feature allows to simplify development and deployment of
      real-world BPF applications with complicated compatibility requirements.
      Signed-off-by: default avatarAndrii Nakryiko <andriin@fb.com>
      Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
      Link: https://lore.kernel.org/bpf/20200625232629.3444003-2-andriin@fb.com
      d9297581
  4. 25 Jun, 2020 18 commits
  5. 24 Jun, 2020 5 commits