1. 04 5月, 2018 5 次提交
  2. 03 5月, 2018 1 次提交
  3. 02 5月, 2018 1 次提交
  4. 30 4月, 2018 1 次提交
    • E
      selftests: net: tcp_mmap must use TCP_ZEROCOPY_RECEIVE · aacb0c2e
      Eric Dumazet 提交于
      After prior kernel change, mmap() on TCP socket only reserves VMA.
      
      We have to use getsockopt(fd, IPPROTO_TCP, TCP_ZEROCOPY_RECEIVE, ...)
      to perform the transfert of pages from skbs in TCP receive queue into such VMA.
      
      struct tcp_zerocopy_receive {
      	__u64 address;		/* in: address of mapping */
      	__u32 length;		/* in/out: number of bytes to map/mapped */
      	__u32 recv_skip_hint;	/* out: amount of bytes to skip */
      };
      
      After a successful getsockopt(...TCP_ZEROCOPY_RECEIVE...), @length contains
      number of bytes that were mapped, and @recv_skip_hint contains number of bytes
      that should be read using conventional read()/recv()/recvmsg() system calls,
      to skip a sequence of bytes that can not be mapped, because not properly page
      aligned.
      Signed-off-by: NEric Dumazet <edumazet@google.com>
      Cc: Andy Lutomirski <luto@kernel.org>
      Acked-by: NSoheil Hassas Yeganeh <soheil@google.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      aacb0c2e
  5. 28 4月, 2018 8 次提交
  6. 27 4月, 2018 5 次提交
  7. 25 4月, 2018 6 次提交
  8. 24 4月, 2018 1 次提交
  9. 23 4月, 2018 1 次提交
  10. 20 4月, 2018 1 次提交
    • M
      bpf: btf: Add BTF tests · c0fa1b6c
      Martin KaFai Lau 提交于
      This patch tests the BTF loading, map_create with BTF
      and the changes in libbpf.
      
      -r: Raw tests that test raw crafted BTF data
      -f: Test LLVM compiled bpf prog with BTF data
      -g: Test BPF_OBJ_GET_INFO_BY_FD for btf_fd
      -p: Test pretty print
      
      The tools/testing/selftests/bpf/Makefile will probe
      for BTF support in llc and pahole before generating
      debug info (-g) and convert them to BTF.  You can supply
      the BTF supported binary through the following make variables:
      LLC, BTF_PAHOLE and LLVM_OBJCOPY.
      
      LLC: The lastest llc with -mattr=dwarfris support for the bpf target.
           It is only in the master of the llvm repo for now.
      BTF_PAHOLE: The modified pahole with BTF support:
      	    https://github.com/iamkafai/pahole/tree/btf
      	    To add a BTF section: "pahole -J bpf_prog.o"
      LLVM_OBJCOPY: Any llvm-objcopy should do
      Signed-off-by: NMartin KaFai Lau <kafai@fb.com>
      Acked-by: NAlexei Starovoitov <ast@fb.com>
      Signed-off-by: NDaniel Borkmann <daniel@iogearbox.net>
      c0fa1b6c
  11. 19 4月, 2018 3 次提交
    • Y
      tools/bpf: fix test_sock and test_sock_addr.sh failure · 0a0a7e00
      Yonghong Song 提交于
      The bpf selftests test_sock and test_sock_addr.sh failed
      in my test machine. The failure looks like:
          $ ./test_sock
          Test case: bind4 load with invalid access: src_ip6 .. [PASS]
          Test case: bind4 load with invalid access: mark .. [PASS]
          Test case: bind6 load with invalid access: src_ip4 .. [PASS]
          Test case: sock_create load with invalid access: src_port .. [PASS]
          Test case: sock_create load w/o expected_attach_type (compat mode) .. [FAIL]
          Test case: sock_create load w/ expected_attach_type .. [FAIL]
          Test case: attach type mismatch bind4 vs bind6 .. [FAIL]
          ...
          Summary: 4 PASSED, 12 FAILED
          $ ./test_sock_addr.sh
          Wait for testing IPv4/IPv6 to become available .....
          ERROR: Timeout waiting for test IP to become available.
      
      In test_sock, bpf program loads failed due to hitting memlock limits.
      In test_sock_addr.sh, my test machine is a ipv6 only test box and using
      "ping" without specifying address family for an ipv6 address does not work.
      
      This patch fixed the issue by including header bpf_rlimit.h in test_sock.c
      and test_sock_addr.c, and specifying address family for ping command.
      
      Cc: Andrey Ignatov <rdna@fb.com>
      Signed-off-by: NYonghong Song <yhs@fb.com>
      Acked-by: NAndrey Ignatov <rdna@fb.com>
      Signed-off-by: NDaniel Borkmann <daniel@iogearbox.net>
      0a0a7e00
    • N
      bpf: add bpf_xdp_adjust_tail sample prog · c6ffd1ff
      Nikita V. Shirokov 提交于
      adding bpf's sample program which is using bpf_xdp_adjust_tail helper
      by generating ICMPv4 "packet to big" message if ingress packet's size is
      bigger then 600 bytes
      Signed-off-by: NNikita V. Shirokov <tehnerd@tehnerd.com>
      Signed-off-by: NDaniel Borkmann <daniel@iogearbox.net>
      c6ffd1ff
    • N
      bpf: adding tests for bpf_xdp_adjust_tail · 0367d0a2
      Nikita V. Shirokov 提交于
      adding selftests for bpf_xdp_adjust_tail helper. in this synthetic test
      we are testing that 1) if data_end < data helper will return EINVAL
      2) for normal use case packet's length would be reduced.
      Signed-off-by: NNikita V. Shirokov <tehnerd@tehnerd.com>
      Signed-off-by: NDaniel Borkmann <daniel@iogearbox.net>
      0367d0a2
  12. 18 4月, 2018 2 次提交
  13. 17 4月, 2018 2 次提交
  14. 16 4月, 2018 3 次提交