1. 21 10月, 2019 1 次提交
  2. 18 10月, 2019 1 次提交
    • A
      selftests/bpf: Teach test_progs to cd into subdir · 0b6e71c3
      Andrii Nakryiko 提交于
      We are building a bunch of "flavors" of test_progs, e.g., w/ alu32 flag
      for Clang when building BPF object. test_progs setup is relying on
      having all the BPF object files and extra resources to be available in
      current working directory, though. But we actually build all these files
      into a separate sub-directory. Next set of patches establishes
      convention of naming "flavored" test_progs (and test runner binaries in
      general) as test_progs-flavor (e.g., test_progs-alu32), for each such
      extra flavor. This patch teaches test_progs binary to automatically
      detect its own extra flavor based on its argv[0], and if present, to
      change current directory to a flavor-specific subdirectory.
      Signed-off-by: NAndrii Nakryiko <andriin@fb.com>
      Signed-off-by: NAlexei Starovoitov <ast@kernel.org>
      Link: https://lore.kernel.org/bpf/20191016060051.2024182-2-andriin@fb.com
      0b6e71c3
  3. 07 9月, 2019 1 次提交
  4. 03 9月, 2019 1 次提交
    • S
      selftests/bpf: test_progs: fix verbose mode garbage · d80507d1
      Stanislav Fomichev 提交于
      fseeko(.., 0, SEEK_SET) on a memstream just puts the buffer pointer
      to the beginning so when we call fflush on it we get some garbage
      log data from the previous test. Let's manually set terminating
      byte to zero at the reported buffer size.
      
      To show the issue consider the following snippet:
      
      	stream = open_memstream (&buf, &len);
      
      	fprintf(stream, "aaa");
      	fflush(stream);
      	printf("buf=%s, len=%zu\n", buf, len);
      	fseeko(stream, 0, SEEK_SET);
      
      	fprintf(stream, "b");
      	fflush(stream);
      	printf("buf=%s, len=%zu\n", buf, len);
      
      Output:
      
      	buf=aaa, len=3
      	buf=baa, len=1
      
      Fixes: 946152b3 ("selftests/bpf: test_progs: switch to open_memstream")
      Signed-off-by: NStanislav Fomichev <sdf@google.com>
      Signed-off-by: NDaniel Borkmann <daniel@iogearbox.net>
      d80507d1
  5. 28 8月, 2019 2 次提交
  6. 07 8月, 2019 3 次提交
  7. 31 7月, 2019 1 次提交
  8. 28 7月, 2019 5 次提交
  9. 31 5月, 2019 1 次提交
  10. 04 4月, 2019 1 次提交
    • A
      selftests/bpf: add few verifier scale tests · e5e7a8f2
      Alexei Starovoitov 提交于
      Add 3 basic tests that stress verifier scalability.
      
      test_verif_scale1.c calls non-inlined jhash() function 90 times on
      different position in the packet.
      This test simulates network packet parsing.
      jhash function is ~140 instructions and main program is ~1200 insns.
      
      test_verif_scale2.c force inlines jhash() function 90 times.
      This program is ~15k instructions long.
      
      test_verif_scale3.c calls non-inlined jhash() function 90 times on
      But this time jhash has to process 32-bytes from the packet
      instead of 14-bytes in tests 1 and 2.
      jhash function is ~230 insns and main program is ~1200 insns.
      
      $ test_progs -s
      can be used to see verifier stats.
      Signed-off-by: NAlexei Starovoitov <ast@kernel.org>
      Signed-off-by: NDaniel Borkmann <daniel@iogearbox.net>
      e5e7a8f2
  11. 03 3月, 2019 7 次提交
  12. 01 3月, 2019 1 次提交
  13. 26 2月, 2019 1 次提交
    • S
      selftests/bpf: make sure signal interrupts BPF_PROG_TEST_RUN · 740f8a65
      Stanislav Fomichev 提交于
      Simple test that I used to reproduce the issue in the previous commit:
      Do BPF_PROG_TEST_RUN with max iterations, each program is 4096 simple
      move instructions. File alarm in 0.1 second and check that
      bpf_prog_test_run is interrupted (i.e. test doesn't hang).
      
      Note: reposting this for bpf-next to avoid linux-next conflict. In this
      version I test both BPF_PROG_TYPE_SOCKET_FILTER (which uses generic
      bpf_test_run implementation) and BPF_PROG_TYPE_FLOW_DISSECTOR (which has
      it own loop with preempt handling in bpf_prog_test_run_flow_dissector).
      Signed-off-by: NStanislav Fomichev <sdf@google.com>
      Signed-off-by: NDaniel Borkmann <daniel@iogearbox.net>
      740f8a65
  14. 05 2月, 2019 2 次提交
    • S
      libbpf: fix libbpf_print · a8a1f7d0
      Stanislav Fomichev 提交于
      With the recent print rework we now have the following problem:
      pr_{warning,info,debug} expand to __pr which calls libbpf_print.
      libbpf_print does va_start and calls __libbpf_pr with va_list argument.
      In __base_pr we again do va_start. Because the next argument is a
      va_list, we don't get correct pointer to the argument (and print noting
      in my case, I don't know why it doesn't crash tbh).
      
      Fix this by changing libbpf_print_fn_t signature to accept va_list and
      remove unneeded calls to va_start in the existing users.
      
      Alternatively, this can we solved by exporting __libbpf_pr and
      changing __pr macro to (and killing libbpf_print):
      {
      	if (__libbpf_pr)
      		__libbpf_pr(level, "libbpf: " fmt, ##__VA_ARGS__)
      }
      Signed-off-by: NStanislav Fomichev <sdf@google.com>
      Acked-by: NYonghong Song <yhs@fb.com>
      Signed-off-by: NAlexei Starovoitov <ast@kernel.org>
      a8a1f7d0
    • Y
      tools/bpf: simplify libbpf API function libbpf_set_print() · 6f1ae8b6
      Yonghong Song 提交于
      Currently, the libbpf API function libbpf_set_print()
      takes three function pointer parameters for warning, info
      and debug printout respectively.
      
      This patch changes the API to have just one function pointer
      parameter and the function pointer has one additional
      parameter "debugging level". So if in the future, if
      the debug level is increased, the function signature
      won't change.
      Signed-off-by: NYonghong Song <yhs@fb.com>
      Signed-off-by: NAlexei Starovoitov <ast@kernel.org>
      6f1ae8b6
  15. 02 2月, 2019 2 次提交
  16. 29 1月, 2019 1 次提交
  17. 17 1月, 2019 1 次提交
  18. 13 12月, 2018 1 次提交
  19. 05 12月, 2018 1 次提交
  20. 29 11月, 2018 1 次提交
  21. 17 11月, 2018 1 次提交
  22. 20 10月, 2018 1 次提交
  23. 03 10月, 2018 1 次提交
  24. 07 9月, 2018 1 次提交
  25. 25 5月, 2018 1 次提交