1. 09 2月, 2022 1 次提交
  2. 25 1月, 2022 1 次提交
  3. 29 12月, 2021 2 次提交
  4. 02 11月, 2021 1 次提交
  5. 17 6月, 2021 1 次提交
    • L
      libbpf: Fail compilation if target arch is missing · 4a638d58
      Lorenz Bauer 提交于
      bpf2go is the Go equivalent of libbpf skeleton. The convention is that
      the compiled BPF is checked into the repository to facilitate distributing
      BPF as part of Go packages. To make this portable, bpf2go by default
      generates both bpfel and bpfeb variants of the C.
      
      Using bpf_tracing.h is inherently non-portable since the fields of
      struct pt_regs differ between platforms, so CO-RE can't help us here.
      The only way of working around this is to compile for each target
      platform independently. bpf2go can't do this by default since there
      are too many platforms.
      
      Define the various PT_... macros when no target can be determined and
      turn them into compilation failures. This works because bpf2go always
      compiles for bpf targets, so the compiler fallback doesn't kick in.
      Conditionally define __BPF_MISSING_TARGET so that we can inject a
      more appropriate error message at build time. The user can then
      choose which platform to target explicitly.
      Signed-off-by: NLorenz Bauer <lmb@cloudflare.com>
      Signed-off-by: NAndrii Nakryiko <andrii@kernel.org>
      Link: https://lore.kernel.org/bpf/20210616083635.11434-1-lmb@cloudflare.com
      4a638d58
  6. 27 5月, 2021 1 次提交
  7. 20 4月, 2021 2 次提交
  8. 19 8月, 2020 1 次提交
  9. 31 7月, 2020 1 次提交
  10. 15 5月, 2020 1 次提交
  11. 10 5月, 2020 1 次提交
  12. 18 3月, 2020 1 次提交
  13. 14 3月, 2020 1 次提交
  14. 03 3月, 2020 2 次提交
  15. 09 10月, 2019 5 次提交
  16. 07 10月, 2019 1 次提交
  17. 06 10月, 2019 1 次提交
  18. 16 9月, 2019 1 次提交
    • I
      selftests/bpf: add bpf-gcc support · 4ce150b6
      Ilya Leoshkevich 提交于
      Now that binutils and gcc support for BPF is upstream, make use of it in
      BPF selftests using alu32-like approach. Share as much as possible of
      CFLAGS calculation with clang.
      
      Fixes only obvious issues, leaving more complex ones for later:
      - Use gcc-provided bpf-helpers.h instead of manually defining the
        helpers, change bpf_helpers.h include guard to avoid conflict.
      - Include <linux/stddef.h> for __always_inline.
      - Add $(OUTPUT)/../usr/include to include path in order to use local
        kernel headers instead of system kernel headers when building with O=.
      
      In order to activate the bpf-gcc support, one needs to configure
      binutils and gcc with --target=bpf and make them available in $PATH. In
      particular, gcc must be installed as `bpf-gcc`, which is the default.
      
      Right now with binutils 25a2915e8dba and gcc r275589 only a handful of
      tests work:
      
      	# ./test_progs_bpf_gcc
      	# Summary: 7/39 PASSED, 1 SKIPPED, 98 FAILED
      
      The reason for those failures are as follows:
      
      - Build errors:
        - `error: too many function arguments for eBPF` for __always_inline
          functions read_str_var and read_map_var - must be inlining issue,
          and for process_l3_headers_v6, which relies on optimizing away
          function arguments.
        - `error: indirect call in function, which are not supported by eBPF`
          where there are no obvious indirect calls in the source calls, e.g.
          in __encap_ipip_none.
        - `error: field 'lock' has incomplete type` for fields of `struct
          bpf_spin_lock` type - bpf_spin_lock is re#defined by bpf-helpers.h,
          so its usage is sensitive to order of #includes.
        - `error: eBPF stack limit exceeded` in sysctl_tcp_mem.
      - Load errors:
        - Missing object files due to above build errors.
        - `libbpf: failed to create map (name: 'test_ver.bss')`.
        - `libbpf: object file doesn't contain bpf program`.
        - `libbpf: Program '.text' contains unrecognized relo data pointing to
          section 0`.
        - `libbpf: BTF is required, but is missing or corrupted` - no BTF
          support in gcc yet.
      Signed-off-by: NIlya Leoshkevich <iii@linux.ibm.com>
      Cc: Jose E. Marchesi <jose.marchesi@oracle.com>
      Signed-off-by: NDaniel Borkmann <daniel@iogearbox.net>
      4ce150b6
  19. 18 8月, 2019 1 次提交
  20. 08 8月, 2019 1 次提交
  21. 31 7月, 2019 1 次提交
  22. 12 7月, 2019 3 次提交
  23. 06 7月, 2019 1 次提交
  24. 11 6月, 2019 1 次提交
  25. 25 5月, 2019 2 次提交
  26. 17 5月, 2019 1 次提交
  27. 28 4月, 2019 1 次提交
  28. 13 4月, 2019 1 次提交
  29. 10 4月, 2019 1 次提交
    • J
      bpf, selftest: test global data/bss/rodata sections · b915ebe6
      Joe Stringer 提交于
      Add tests for libbpf relocation of static variable references
      into the .data, .rodata and .bss sections of the ELF, also add
      read-only test for .rodata. All passing:
      
        # ./test_progs
        [...]
        test_global_data:PASS:load program 0 nsec
        test_global_data:PASS:pass global data run 925 nsec
        test_global_data_number:PASS:relocate .bss reference 925 nsec
        test_global_data_number:PASS:relocate .data reference 925 nsec
        test_global_data_number:PASS:relocate .rodata reference 925 nsec
        test_global_data_number:PASS:relocate .bss reference 925 nsec
        test_global_data_number:PASS:relocate .data reference 925 nsec
        test_global_data_number:PASS:relocate .rodata reference 925 nsec
        test_global_data_number:PASS:relocate .bss reference 925 nsec
        test_global_data_number:PASS:relocate .bss reference 925 nsec
        test_global_data_number:PASS:relocate .rodata reference 925 nsec
        test_global_data_number:PASS:relocate .rodata reference 925 nsec
        test_global_data_number:PASS:relocate .rodata reference 925 nsec
        test_global_data_string:PASS:relocate .rodata reference 925 nsec
        test_global_data_string:PASS:relocate .data reference 925 nsec
        test_global_data_string:PASS:relocate .bss reference 925 nsec
        test_global_data_string:PASS:relocate .data reference 925 nsec
        test_global_data_string:PASS:relocate .bss reference 925 nsec
        test_global_data_struct:PASS:relocate .rodata reference 925 nsec
        test_global_data_struct:PASS:relocate .bss reference 925 nsec
        test_global_data_struct:PASS:relocate .rodata reference 925 nsec
        test_global_data_struct:PASS:relocate .data reference 925 nsec
        test_global_data_rdonly:PASS:test .rodata read-only map 925 nsec
        [...]
        Summary: 229 PASSED, 0 FAILED
      
      Note map helper signatures have been changed to avoid warnings
      when passing in const data.
      
      Joint work with Daniel Borkmann.
      Signed-off-by: NJoe Stringer <joe@wand.net.nz>
      Signed-off-by: NDaniel Borkmann <daniel@iogearbox.net>
      Acked-by: NAndrii Nakryiko <andriin@fb.com>
      Acked-by: NMartin KaFai Lau <kafai@fb.com>
      Signed-off-by: NAlexei Starovoitov <ast@kernel.org>
      b915ebe6
  30. 22 3月, 2019 1 次提交