]> git.baikalelectronics.ru Git - kernel.git/commit
selftests/net: add packet socket packet_snd test
authorWillem de Bruijn <willemb@google.com>
Thu, 31 May 2018 16:14:40 +0000 (12:14 -0400)
committerDavid S. Miller <davem@davemloft.net>
Mon, 4 Jun 2018 13:50:01 +0000 (09:50 -0400)
commit322966d2aa2febd1ffbe1f2c6e358e53c43f0899
treee7c6968e98ea682ea33c671d1a2e470a24fb5609
parent27f79cdd7b09c8b23cb37f4981b0960b86542b99
selftests/net: add packet socket packet_snd test

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: Willem de Bruijn <willemb@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
tools/testing/selftests/net/.gitignore
tools/testing/selftests/net/Makefile
tools/testing/selftests/net/psock_snd.c [new file with mode: 0644]
tools/testing/selftests/net/psock_snd.sh [new file with mode: 0755]