1. 21 Apr, 2023 28 commits
  2. 20 Apr, 2023 9 commits
  3. 19 Apr, 2023 1 commit
  4. 18 Apr, 2023 2 commits
    • Alexei Starovoitov's avatar
      Merge branch 'Provide bpf_for() and bpf_for_each() by libbpf' · 276dcdd1
      Alexei Starovoitov authored
      Andrii Nakryiko says:
      
      ====================
      
      This patch set moves bpf_for(), bpf_for_each(), and bpf_repeat() macros from
      selftests-internal bpf_misc.h header to libbpf-provided bpf_helpers.h header.
      To do this in a way to allow users to feature-detect and guard such
      bpf_for()/bpf_for_each() uses on old kernels we also extend libbpf to improve
      unresolved kfunc calls handling and reporting. This lets us mark
      bpf_iter_num_{new,next,destroy}() declarations as __weak, and thus not fail
      program loading outright if such kfuncs are missing on the host kernel.
      
      Patches #1 and #2 do some simple clean ups and logging improvements. Patch #3
      adds kfunc call poisoning and log fixup logic and is the hear of this patch
      set, effectively. Patch #4 adds selftest for this logic. Patches #4 and #5
      move bpf_for()/bpf_for_each()/bpf_repeat() into bpf_helpers.h header and mark
      kfuncs as __weak to allow users to feature-detect and guard their uses.
      ====================
      Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
      276dcdd1
    • Andrii Nakryiko's avatar
      libbpf: mark bpf_iter_num_{new,next,destroy} as __weak · 94dccba7
      Andrii Nakryiko authored
      Mark bpf_iter_num_{new,next,destroy}() kfuncs declared for
      bpf_for()/bpf_repeat() macros as __weak to allow users to feature-detect
      their presence and guard bpf_for()/bpf_repeat() loops accordingly for
      backwards compatibility with old kernels.
      
      Now that libbpf supports kfunc calls poisoning and better reporting of
      unresolved (but called) kfuncs, declaring number iterator kfuncs in
      bpf_helpers.h won't degrade user experience and won't cause unnecessary
      kernel feature dependencies.
      Signed-off-by: default avatarAndrii Nakryiko <andrii@kernel.org>
      Link: https://lore.kernel.org/r/20230418002148.3255690-7-andrii@kernel.orgSigned-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
      94dccba7