Skip to content
  1. Apr 25, 2017
  2. Apr 24, 2017
  3. Apr 20, 2017
    • Mike Maloney's avatar
      selftests/net: Fixes psock_fanout CBPF test case · c1f8d0f9
      Mike Maloney authored
      
      
      'psock_fanout' has been failing since commit 4d7b9dc1 ("tools:
      psock_lib: harden socket filter used by psock tests").  That commit
      changed the CBPF filter to examine the full ethernet frame, and was
      tested on 'psock_tpacket' which uses SOCK_RAW.  But 'psock_fanout' was
      also using this same CBPF in two places, for filtering and fanout, on a
      SOCK_DGRAM socket.
      
      Change 'psock_fanout' to use SOCK_RAW so that the CBPF program used with
      SO_ATTACH_FILTER can examine the entire frame.  Create a new CBPF
      program for use with PACKET_FANOUT_DATA which ignores the header, as it
      cannot see the ethernet header.
      
      Tested: Ran tools/testing/selftests/net/psock_{fanout,tpacket} 10 times,
      and they all passed.
      
      Fixes: 4d7b9dc1 ("tools: psock_lib: harden socket filter used by psock tests")
      Signed-off-by: default avatar'Mike Maloney <maloneykernel@gmail.com&gt;'>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c1f8d0f9
  4. Apr 05, 2017
  5. Jan 12, 2017
  6. Jan 05, 2017
  7. Jan 03, 2017
  8. Oct 22, 2016
    • Daniel Borkmann's avatar
      reuseport, bpf: add test case for bpf_get_numa_node_id · 3c2c3c16
      Daniel Borkmann authored
      
      
      The test case is very similar to reuseport_bpf_cpu, only that here
      we select socket members based on current numa node id.
      
        # numactl -H
        available: 2 nodes (0-1)
        node 0 cpus: 0 1 2 3 4 5 12 13 14 15 16 17
        node 0 size: 128867 MB
        node 0 free: 120080 MB
        node 1 cpus: 6 7 8 9 10 11 18 19 20 21 22 23
        node 1 size: 96765 MB
        node 1 free: 87504 MB
        node distances:
        node   0   1
          0:  10  20
          1:  20  10
      
        # ./reuseport_bpf_numa
        ---- IPv4 UDP ----
        send node 0, receive socket 0
        send node 1, receive socket 1
        send node 1, receive socket 1
        send node 0, receive socket 0
        ---- IPv6 UDP ----
        send node 0, receive socket 0
        send node 1, receive socket 1
        send node 1, receive socket 1
        send node 0, receive socket 0
        ---- IPv4 TCP ----
        send node 0, receive socket 0
        send node 1, receive socket 1
        send node 1, receive socket 1
        send node 0, receive socket 0
        ---- IPv6 TCP ----
        send node 0, receive socket 0
        send node 1, receive socket 1
        send node 1, receive socket 1
        send node 0, receive socket 0
        SUCCESS
      
      Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
      Acked-by: default avatarAlexei Starovoitov <ast@kernel.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      3c2c3c16
  9. Jun 06, 2016
  10. Apr 15, 2016
  11. Feb 25, 2016
  12. Feb 11, 2016
  13. Jan 06, 2016
  14. Jan 05, 2016
  15. Aug 17, 2015
  16. May 18, 2015
  17. Mar 19, 2015
  18. Mar 13, 2015
    • Michael Ellerman's avatar
      selftests: Add install target · 32dcfba6
      Michael Ellerman authored
      
      
      This adds make install support to selftests. The basic usage is:
      
      $ cd tools/testing/selftests
      $ make install
      
      That installs into tools/testing/selftests/install, which can then be
      copied where ever necessary.
      
      The install destination is also configurable using eg:
      
      $ INSTALL_PATH=/mnt/selftests make install
      
      The implementation uses two targets in the child makefiles. The first
      "install" is expected to install all files into $(INSTALL_PATH).
      
      The second, "emit_tests", is expected to emit the test instructions (ie.
      bash script) on stdout. Separating this from install means the child
      makefiles need no knowledge of the location of the test script.
      
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      Signed-off-by: default avatarShuah Khan <shuahkh@osg.samsung.com>
      32dcfba6
    • Michael Ellerman's avatar
      selftests: Introduce minimal shared logic for running tests · 5e29a910
      Michael Ellerman authored
      
      
      This adds a Make include file which most selftests can then include to
      get the run_tests logic.
      
      On its own this has the advantage of some reduction in repetition, and
      also means the pass/fail message is defined in fewer places.
      
      However the key advantage is it will allow us to implement install very
      simply in a subsequent patch.
      
      The default implementation just executes each program in $(TEST_PROGS).
      
      We use a variable to hold the default implementation of $(RUN_TESTS)
      because that gives us a clean way to override it if necessary, ie. using
      override. The mount, memory-hotplug and mqueue tests use that to provide
      a different implementation.
      
      Tests are not run via /bin/bash, so if they are scripts they must be
      executable, we add a+x to several.
      
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      Signed-off-by: default avatarShuah Khan <shuahkh@osg.samsung.com>
      5e29a910
  19. Nov 12, 2014
  20. Nov 05, 2014
  21. May 12, 2014
  22. Jul 02, 2013
  23. Apr 29, 2013
  24. Apr 19, 2013
  25. Apr 07, 2013
    • Daniel Borkmann's avatar
      selftests: net: add PF_PACKET TPACKET v1/v2/v3 selftests · 23a95442
      Daniel Borkmann authored
      
      
      This patch adds a simple test case that probes the packet socket's
      TPACKET_V1, TPACKET_V2 and TPACKET_V3 behavior regarding mmap(2)'ed
      I/O for a small burst of 100 packets. The test currently runs for ...
      
        TPACKET_V1: RX_RING, TX_RING
        TPACKET_V2: RX_RING, TX_RING
        TPACKET_V3: RX_RING
      
      ... and will output on success:
      
        test: TPACKET_V1 with PACKET_RX_RING .................... 100 pkts (9600 bytes)
        test: TPACKET_V1 with PACKET_TX_RING .................... 100 pkts (9600 bytes)
        test: TPACKET_V2 with PACKET_RX_RING .................... 100 pkts (9600 bytes)
        test: TPACKET_V2 with PACKET_TX_RING .................... 100 pkts (9600 bytes)
        test: TPACKET_V3 with PACKET_RX_RING .................... 100 pkts (9600 bytes)
        OK. All tests passed
      
      Reusable parts of psock_fanout.c have been put into a psock_lib.h
      file for common usage. Test case successfully tested on x86_64.
      
      Signed-off-by: default avatarDaniel Borkmann <dborkman@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      23a95442
  26. Mar 21, 2013
  27. Mar 20, 2013
Loading