1. 31 Jan, 2023 9 commits
  2. 30 Jan, 2023 18 commits
  3. 28 Jan, 2023 11 commits
  4. 27 Jan, 2023 2 commits
    • Stanislav Fomichev's avatar
      selftest/bpf: Make crashes more debuggable in test_progs · 16809afd
      Stanislav Fomichev authored
      Reset stdio before printing verbose log of the SIGSEGV'ed test.
      Otherwise, it's hard to understand what's going on in the cases like [0].
      
      With the following patch applied:
      
      	--- a/tools/testing/selftests/bpf/prog_tests/xdp_metadata.c
      	+++ b/tools/testing/selftests/bpf/prog_tests/xdp_metadata.c
      	@@ -392,6 +392,11 @@ void test_xdp_metadata(void)
      	 		       "generate freplace packet"))
      	 		goto out;
      
      	+
      	+	ASSERT_EQ(1, 2, "oops");
      	+	int *x = 0;
      	+	*x = 1; /* die */
      	+
      	 	while (!retries--) {
      	 		if (bpf_obj2->bss->called)
      	 			break;
      
      Before:
      
       #281     xdp_metadata:FAIL
      Caught signal #11!
      Stack trace:
      ./test_progs(crash_handler+0x1f)[0x55c919d98bcf]
      /lib/x86_64-linux-gnu/libc.so.6(+0x3bf90)[0x7f36aea5df90]
      ./test_progs(test_xdp_metadata+0x1db0)[0x55c919d8c6d0]
      ./test_progs(+0x23b438)[0x55c919d9a438]
      ./test_progs(main+0x534)[0x55c919d99454]
      /lib/x86_64-linux-gnu/libc.so.6(+0x2718a)[0x7f36aea4918a]
      /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0x85)[0x7f36aea49245]
      ./test_progs(_start+0x21)[0x55c919b82ef1]
      
      After:
      
      test_xdp_metadata:PASS:ip netns add xdp_metadata 0 nsec
      open_netns:PASS:malloc token 0 nsec
      open_netns:PASS:open /proc/self/ns/net 0 nsec
      open_netns:PASS:open netns fd 0 nsec
      open_netns:PASS:setns 0 nsec
      ..
      test_xdp_metadata:FAIL:oops unexpected oops: actual 1 != expected 2
       #281     xdp_metadata:FAIL
      Caught signal #11!
      Stack trace:
      ./test_progs(crash_handler+0x1f)[0x562714a76bcf]
      /lib/x86_64-linux-gnu/libc.so.6(+0x3bf90)[0x7fa663f9cf90]
      ./test_progs(test_xdp_metadata+0x1db0)[0x562714a6a6d0]
      ./test_progs(+0x23b438)[0x562714a78438]
      ./test_progs(main+0x534)[0x562714a77454]
      /lib/x86_64-linux-gnu/libc.so.6(+0x2718a)[0x7fa663f8818a]
      /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0x85)[0x7fa663f88245]
      ./test_progs(_start+0x21)[0x562714860ef1]
      
      0: https://github.com/kernel-patches/bpf/actions/runs/4019879316/jobs/6907358876Signed-off-by: default avatarStanislav Fomichev <sdf@google.com>
      Link: https://lore.kernel.org/r/20230127215705.1254316-1-sdf@google.comSigned-off-by: default avatarMartin KaFai Lau <martin.lau@kernel.org>
      16809afd
    • Grant Seltzer's avatar
      libbpf: Add documentation to map pinning API functions · e4ce876f
      Grant Seltzer authored
      This adds documentation for the following API functions:
      
      - bpf_map__set_pin_path()
      - bpf_map__pin_path()
      - bpf_map__is_pinned()
      - bpf_map__pin()
      - bpf_map__unpin()
      - bpf_object__pin_maps()
      - bpf_object__unpin_maps()
      Signed-off-by: default avatarGrant Seltzer <grantseltzer@gmail.com>
      Signed-off-by: default avatarAndrii Nakryiko <andrii@kernel.org>
      Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
      Link: https://lore.kernel.org/bpf/20230126024225.520685-1-grantseltzer@gmail.com
      e4ce876f