1. 06 1月, 2017 2 次提交
  2. 23 10月, 2016 1 次提交
    • D
      reuseport, bpf: add test case for bpf_get_numa_node_id · 3c2c3c16
      Daniel Borkmann 提交于
      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: NDaniel Borkmann <daniel@iogearbox.net>
      Acked-by: NAlexei Starovoitov <ast@kernel.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      3c2c3c16
  3. 15 4月, 2016 1 次提交
  4. 11 2月, 2016 1 次提交
  5. 05 1月, 2016 1 次提交
  6. 20 3月, 2015 1 次提交
  7. 14 3月, 2015 2 次提交
    • M
      selftests: Add install target · 32dcfba6
      Michael Ellerman 提交于
      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: NMichael Ellerman <mpe@ellerman.id.au>
      Signed-off-by: NShuah Khan <shuahkh@osg.samsung.com>
      32dcfba6
    • M
      selftests: Introduce minimal shared logic for running tests · 5e29a910
      Michael Ellerman 提交于
      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: NMichael Ellerman <mpe@ellerman.id.au>
      Signed-off-by: NShuah Khan <shuahkh@osg.samsung.com>
      5e29a910
  8. 05 11月, 2014 1 次提交
  9. 12 5月, 2014 1 次提交
  10. 08 4月, 2013 1 次提交
    • D
      selftests: net: add PF_PACKET TPACKET v1/v2/v3 selftests · 23a95442
      Daniel Borkmann 提交于
      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: NDaniel Borkmann <dborkman@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      23a95442
  11. 21 3月, 2013 1 次提交
  12. 20 3月, 2013 1 次提交
    • W
      packet: packet fanout rollover during socket overload · 77f65ebd
      Willem de Bruijn 提交于
      Changes:
        v3->v2: rebase (no other changes)
                passes selftest
        v2->v1: read f->num_members only once
                fix bug: test rollover mode + flag
      
      Minimize packet drop in a fanout group. If one socket is full,
      roll over packets to another from the group. Maintain flow
      affinity during normal load using an rxhash fanout policy, while
      dispersing unexpected traffic storms that hit a single cpu, such
      as spoofed-source DoS flows. Rollover breaks affinity for flows
      arriving at saturated sockets during those conditions.
      
      The patch adds a fanout policy ROLLOVER that rotates between sockets,
      filling each socket before moving to the next. It also adds a fanout
      flag ROLLOVER. If passed along with any other fanout policy, the
      primary policy is applied until the chosen socket is full. Then,
      rollover selects another socket, to delay packet drop until the
      entire system is saturated.
      
      Probing sockets is not free. Selecting the last used socket, as
      rollover does, is a greedy approach that maximizes chance of
      success, at the cost of extreme load imbalance. In practice, with
      sufficiently long queues to absorb bursts, sockets are drained in
      parallel and load balance looks uniform in `top`.
      
      To avoid contention, scales counters with number of sockets and
      accesses them lockfree. Values are bounds checked to ensure
      correctness.
      
      Tested using an application with 9 threads pinned to CPUs, one socket
      per thread and sufficient busywork per packet operation to limits each
      thread to handling 32 Kpps. When sent 500 Kpps single UDP stream
      packets, a FANOUT_CPU setup processes 32 Kpps in total without this
      patch, 270 Kpps with the patch. Tested with read() and with a packet
      ring (V1).
      
      Also, passes psock_fanout.c unit test added to selftests.
      Signed-off-by: NWillem de Bruijn <willemb@google.com>
      Reviewed-by: NEric Dumazet <edumazet@google.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      77f65ebd