1. 03 11月, 2020 1 次提交
  2. 15 10月, 2020 1 次提交
    • M
      selftests: Add VRF route leaking tests · 1a017276
      Michael Jeanson 提交于
      The objective of the tests is to check that ICMP errors generated while
      crossing between VRFs are properly routed back to the source host.
      
      The first ttl test sends a ping with a ttl of 1 from h1 to h2 and parses the
      output of the command to check that a ttl expired error is received.
      
      The second ttl test runs traceroute from h1 to h2 and parses the output to
      check for a hop on r1.
      
      The mtu test sends a ping with a payload of 1450 from h1 to h2, through
      r1 which has an interface with a mtu of 1400 and parses the output of the
      command to check that a fragmentation needed error is received.
      
      [ The IPv6 MTU test still fails with the symmetric routing setup. It
        appears to be caused by source address selection picking ::1.  Fixing
        this is beyond the scope of this series. ]
      Signed-off-by: NMichael Jeanson <mjeanson@efficios.com>
      Reviewed-by: NDavid Ahern <dsahern@gmail.com>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      1a017276
  3. 01 10月, 2020 1 次提交
  4. 24 9月, 2020 1 次提交
    • D
      selftest/net/xfrm: Add test for ipsec tunnel · bc2652b7
      Dmitry Safonov 提交于
      It's an exhaustive testing for ipsec: covering all encryption/
      authentication/compression algorithms. The tests are run in two
      network namespaces, connected by veth interfaces. To make exhaustive
      testing less time-consuming, the tests are run in parallel tasks,
      specified by parameter to the selftest.
      
      As the patches set adds support for xfrm in compatible tasks, there are
      tests to check structures that differ in size between 64-bit and 32-bit
      applications.
      The selftest doesn't use libnl so that it can be easily compiled as
      compatible application and don't require compatible .so.
      
      Here is a diagram of the selftest:
      
                                 ---------------
                                 |  selftest   |
                                 |  (parent)   |
                                 ---------------
                                    |        |
                                    | (pipe) |
                                    ----------
                                   /   |  |   \
                     /-------------   /    \   -------------\
                     |          /-----      -----\          |
            ---------|----------|----------------|----------|---------
            |   ---------   ---------        ---------   ---------   |
            |   | child |   | child |  NS A  | child |   | child |   |
            |   ---------   ---------        ---------   ---------   |
            -------|------------|----------------|-------------|------
                 veth0        veth1            veth2         vethN
          ---------|------------|----------------|-------------|----------
          | ------------  ------------       ------------   ------------ |
          | | gr.child |  | gr.child | NS B  | gr.child |   | gr.child | |
          | ------------  ------------       ------------   ------------ |
          ----------------------------------------------------------------
      
      The parent sends the description of a test (xfrm parameters) to the
      child, the child and grand child setup a tunnel over veth interface and
      test it by sending udp packets.
      
      Cc: Shuah Khan <shuah@kernel.org>
      Cc: linux-kselftest@vger.kernel.org
      Signed-off-by: NDmitry Safonov <dima@arista.com>
      Signed-off-by: NSteffen Klassert <steffen.klassert@secunet.com>
      bc2652b7
  5. 10 7月, 2020 1 次提交
  6. 24 6月, 2020 1 次提交
    • T
      selftests/net: plug rxtimestamp test into kselftest framework · 0558c396
      tannerlove 提交于
      Run rxtimestamp as part of TEST_PROGS. Analogous to other tests, add
      new rxtimestamp.sh wrapper script, so that the test runs isolated
      from background traffic in a private network namespace.
      
      Also ignore failures of test case #6 by default. This case verifies
      that a receive timestamp is not reported if timestamp reporting is
      enabled for a socket, but generation is disabled. Receive timestamp
      generation has to be enabled globally, as no associated socket is
      known yet. A background process that enables rx timestamp generation
      therefore causes a false positive. Ntpd is one example that does.
      
      Add a "--strict" option to cause failure in the event that any test
      case fails, including test #6. This is useful for environments that
      are known to not have such background processes.
      
      Tested:
      make -C tools/testing/selftests TARGETS="net" run_tests
      Signed-off-by: NTanner Love <tannerlove@google.com>
      Acked-by: NWillem de Bruijn <willemb@google.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      0558c396
  7. 23 4月, 2020 1 次提交
  8. 30 3月, 2020 1 次提交
  9. 26 3月, 2020 1 次提交
  10. 13 3月, 2020 1 次提交
  11. 14 2月, 2020 1 次提交
    • D
      selftests: use LDLIBS for libraries instead of LDFLAGS · 3e839363
      Dmitry Safonov 提交于
      While building selftests, the following errors were observed:
      > tools/testing/selftests/timens'
      > gcc -Wall -Werror -pthread  -lrt -ldl  timens.c  -o tools/testing/selftests/timens/timens
      > /usr/bin/ld: /tmp/ccGy5CST.o: in function `check_config_posix_timers':
      > timens.c:(.text+0x65a): undefined reference to `timer_create'
      > collect2: error: ld returned 1 exit status
      
      Quoting commit 870f193d ("selftests: net: use LDLIBS instead of
      LDFLAGS"):
      
      The default Makefile rule looks like:
      
      $(CC) $(CFLAGS) $(LDFLAGS) $@ $^ $(LDLIBS)
      
      When linking is done by gcc itself, no issue, but when it needs to be passed
      to proper ld, only LDLIBS follows and then ld cannot know what libs to link
      with.
      
      More detail:
      https://www.gnu.org/software/make/manual/html_node/Implicit-Variables.html
      
      LDFLAGS
      Extra flags to give to compilers when they are supposed to invoke the linker,
      ‘ld’, such as -L. Libraries (-lfoo) should be added to the LDLIBS variable
      instead.
      
      LDLIBS
      Library flags or names given to compilers when they are supposed to invoke the
      linker, ‘ld’. LOADLIBES is a deprecated (but still supported) alternative to
      LDLIBS. Non-library linker flags, such as -L, should go in the LDFLAGS
      variable.
      
      While at here, correct other selftests, not only timens ones.
      Reported-by: NShuah Khan <skhan@linuxfoundation.org>
      Signed-off-by: NDmitry Safonov <dima@arista.com>
      Tested-by: NShuah Khan <skhan@linuxfoundation.org>
      Signed-off-by: NShuah Khan <skhan@linuxfoundation.org>
      3e839363
  12. 03 2月, 2020 1 次提交
    • S
      selftests: net: Add FIN_ACK processing order related latency spike test · af8c8a45
      SeongJae Park 提交于
      This commit adds a test for FIN_ACK process races related reconnection
      latency spike issues.  The issue has described and solved by the
      previous commit ("tcp: Reduce SYN resend delay if a suspicous ACK is
      received").
      
      The test program is configured with a server and a client process.  The
      server creates and binds a socket to a port that dynamically allocated,
      listen on it, and start a infinite loop.  Inside the loop, it accepts
      connection, reads 4 bytes from the socket, and closes the connection.
      The client is constructed as an infinite loop.  Inside the loop, it
      creates a socket with LINGER and NODELAY option, connect to the server,
      send 4 bytes data, try read some data from server.  After the read()
      returns, it measure the latency from the beginning of this loop to this
      point and if the latency is larger than 1 second (spike), print a
      message.
      Reviewed-by: NEric Dumazet <edumazet@google.com>
      Signed-off-by: NSeongJae Park <sjpark@amazon.de>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      af8c8a45
  13. 07 11月, 2019 1 次提交
    • F
      selftest: net: add some traceroute tests · 3c28d99f
      Francesco Ruggeri 提交于
      Added the following traceroute tests.
      
      IPV6:
      Verify that in this scenario
      
             ------------------------ N2
              |                    |
            ------              ------  N3  ----
            | R1 |              | R2 |------|H2|
            ------              ------      ----
              |                    |
             ------------------------ N1
                       |
                      ----
                      |H1|
                      ----
      
      where H1's default route goes through R1 and R1's default route goes
      through R2 over N2, traceroute6 from H1 to H2 reports R2's address
      on N2 and not N1.
      
      IPV4:
      Verify that traceroute from H1 to H2 shows 1.0.1.1 in this scenario
      
                         1.0.3.1/24
      ---- 1.0.1.3/24    1.0.1.1/24 ---- 1.0.2.1/24    1.0.2.4/24 ----
      |H1|--------------------------|R1|--------------------------|H2|
      ----            N1            ----            N2            ----
      
      where net.ipv4.icmp_errors_use_inbound_ifaddr is set on R1 and
      1.0.3.1/24 and 1.0.1.1/24 are respectively R1's primary and secondary
      address on N1.
      
      v2: fixed some typos, and have bridge in R1 instead of R2 in IPV6 test.
      Signed-off-by: NFrancesco Ruggeri <fruggeri@arista.com>
      Reviewed-by: NDavid Ahern <dsahern@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      3c28d99f
  14. 09 8月, 2019 1 次提交
  15. 04 8月, 2019 2 次提交
  16. 02 7月, 2019 1 次提交
  17. 31 5月, 2019 1 次提交
  18. 29 5月, 2019 1 次提交
  19. 25 5月, 2019 1 次提交
    • W
      selftests/net: SO_TXTIME with ETF and FQ · af5136f9
      Willem de Bruijn 提交于
      The SO_TXTIME API enables packet tranmission with delayed delivery.
      This is currently supported by the ETF and FQ packet schedulers.
      
      Evaluate the interface with both schedulers. Install the scheduler
      and send a variety of packets streams: without delay, with one
      delayed packet, with multiple ordered delays and with reordering.
      Verify that packets are released by the scheduler in expected order.
      
      The ETF qdisc requires a timestamp in the future on every packet. It
      needs a delay on the qdisc else the packet is dropped on dequeue for
      having a delivery time in the past. The test value is experimentally
      derived. ETF requires clock_id CLOCK_TAI. It checks this base and
      drops for non-conformance.
      
      The FQ qdisc expects clock_id CLOCK_MONOTONIC, the base used by TCP
      as of commit fb420d5d ("tcp/fq: move back to CLOCK_MONOTONIC").
      Within a flow there is an expecation of ordered delivery, as shown by
      delivery times of test 4. The FQ qdisc does not require all packets to
      have timestamps and does not drop for non-conformance.
      
      The large (msec) delays are chosen to avoid flakiness.
      
      	Output:
      
      	SO_TXTIME ipv6 clock monotonic
      	payload:a delay:28 expected:0 (us)
      
      	SO_TXTIME ipv4 clock monotonic
      	payload:a delay:38 expected:0 (us)
      
      	SO_TXTIME ipv6 clock monotonic
      	payload:a delay:40 expected:0 (us)
      
      	SO_TXTIME ipv4 clock monotonic
      	payload:a delay:33 expected:0 (us)
      
      	SO_TXTIME ipv6 clock monotonic
      	payload:a delay:10120 expected:10000 (us)
      
      	SO_TXTIME ipv4 clock monotonic
      	payload:a delay:10102 expected:10000 (us)
      
      	[.. etc ..]
      
      	OK. All tests passed
      
      Changes v1->v2: update commit message output
      Signed-off-by: NWillem de Bruijn <willemb@google.com>
      Acked-by: NEric Dumazet <edumazet@google.com>
      Acked-by: NVinicius Costa Gomes <vinicius.gomes@intel.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      af5136f9
  20. 28 1月, 2019 1 次提交
    • F
      selftests: net: use LDLIBS instead of LDFLAGS · 870f193d
      Fathi Boudra 提交于
      reuseport_bpf_numa fails to build due to undefined reference errors:
      
       aarch64-linaro-linux-gcc
       --sysroot=/build/tmp-rpb-glibc/sysroots/hikey -Wall
       -Wl,--no-as-needed -O2 -g -I../../../../usr/include/  -Wl,-O1
       -Wl,--hash-style=gnu -Wl,--as-needed -lnuma  reuseport_bpf_numa.c
       -o
       /build/tmp-rpb-glibc/work/hikey-linaro-linux/kselftests/4.12-r0/linux-4.12-rc7/tools/testing/selftests/net/reuseport_bpf_numa
       /tmp/ccfUuExT.o: In function `send_from_node':
       /build/tmp-rpb-glibc/work/hikey-linaro-linux/kselftests/4.12-r0/linux-4.12-rc7/tools/testing/selftests/net/reuseport_bpf_numa.c:138:
       undefined reference to `numa_run_on_node'
       /tmp/ccfUuExT.o: In function `main':
       /build/tmp-rpb-glibc/work/hikey-linaro-linux/kselftests/4.12-r0/linux-4.12-rc7/tools/testing/selftests/net/reuseport_bpf_numa.c:230:
       undefined reference to `numa_available'
       /build/tmp-rpb-glibc/work/hikey-linaro-linux/kselftests/4.12-r0/linux-4.12-rc7/tools/testing/selftests/net/reuseport_bpf_numa.c:233:
       undefined reference to `numa_max_node'
      
      It's GNU Make and linker specific.
      
      The default Makefile rule looks like:
      
      $(CC) $(CFLAGS) $(LDFLAGS) $@ $^ $(LDLIBS)
      
      When linking is done by gcc itself, no issue, but when it needs to be passed
      to proper ld, only LDLIBS follows and then ld cannot know what libs to link
      with.
      
      More detail:
      https://www.gnu.org/software/make/manual/html_node/Implicit-Variables.html
      
      LDFLAGS
      Extra flags to give to compilers when they are supposed to invoke the linker,
      ‘ld’, such as -L. Libraries (-lfoo) should be added to the LDLIBS variable
      instead.
      
      LDLIBS
      Library flags or names given to compilers when they are supposed to invoke the
      linker, ‘ld’. LOADLIBES is a deprecated (but still supported) alternative to
      LDLIBS. Non-library linker flags, such as -L, should go in the LDFLAGS
      variable.
      
      https://lkml.org/lkml/2010/2/10/362
      
      tools/perf: libraries must come after objects
      
      Link order matters, use LDLIBS instead of LDFLAGS to properly link against
      libnuma.
      Signed-off-by: NFathi Boudra <fathi.boudra@linaro.org>
      Signed-off-by: NShuah Khan <shuah@kernel.org>
      870f193d
  21. 19 12月, 2018 1 次提交
  22. 15 12月, 2018 1 次提交
  23. 04 12月, 2018 1 次提交
  24. 25 11月, 2018 1 次提交
    • W
      selftests/net: add txring_overwrite · 358be656
      Willem de Bruijn 提交于
      Packet sockets with PACKET_TX_RING send skbs with user data in frags.
      
      Before commit 5cd8d46e ("packet: copy user buffers before orphan
      or clone") ring slots could be released prematurely, possibly allowing
      a process to overwrite data still in flight.
      
      This test opens two packet sockets, one to send and one to read.
      The sender has a tx ring of one slot. It sends two packets with
      different payload, then reads both and verifies their payload.
      
      Before the above commit, both receive calls return the same data as
      the send calls use the same buffer. From the commit, the clone
      needed for looping onto a packet socket triggers an skb_copy_ubufs
      to create a private copy. The separate sends each arrive correctly.
      Signed-off-by: NWillem de Bruijn <willemb@google.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      358be656
  25. 09 11月, 2018 1 次提交
  26. 08 11月, 2018 2 次提交
  27. 05 9月, 2018 1 次提交
  28. 30 8月, 2018 1 次提交
  29. 17 7月, 2018 1 次提交
  30. 04 6月, 2018 2 次提交
    • W
      selftests/net: add packet socket packet_snd test · 75f0139f
      Willem de Bruijn 提交于
      Add regression tests for PF_PACKET transmission using packet_snd.
      
      The TPACKET ring interface has tests for transmission and reception.
      This is an initial stab at the same for the send call based interface.
      
      Packets are sent over loopback, then read twice. The entire packet is
      read from another packet socket and compared. The packet is also
      verified to arrive at a UDP socket for protocol conformance.
      
      The test sends a packet over loopback, testing the following options
      (not the full cross-product):
      
      - SOCK_DGRAM
      - SOCK_RAW
      - vlan tag
      - qdisc bypass
      - bind() and sendto()
      - virtio_net_hdr
      - csum offload (NOT actual csum feature, ignored on loopback)
      - gso
      
      Besides these basic functionality tests, the test runs from a set
      of bounds checks, positive and negative. Running over loopback, which
      has dev->min_header_len, it cannot generate variable length hhlen.
      Signed-off-by: NWillem de Bruijn <willemb@google.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      75f0139f
    • W
      selftests/net: enable msg_zerocopy test · 830669e6
      Willem de Bruijn 提交于
      The existing msg_zerocopy test takes additional protocol arguments.
      Add a variant that takes no arguments and runs all supported variants.
      Call this from kselftest.
      Signed-off-by: NWillem de Bruijn <willemb@google.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      830669e6
  31. 24 5月, 2018 1 次提交
  32. 08 5月, 2018 2 次提交
  33. 02 5月, 2018 1 次提交
  34. 28 4月, 2018 1 次提交
  35. 27 4月, 2018 2 次提交