aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/net (follow)
AgeCommit message (Collapse)AuthorFilesLines
2014-11-05selftests/net: move test out of Makefile into a shell scriptShuah Khan2-7/+11
Currently bpf test run from the Makefile. Move it out of the Makefile to be run from a shell script to allow the test to be run as stand-alone test, in addition to allowing the test run from a make target. Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com> Acked-by: David S. Miller <davem@davemloft.net>
2014-05-12net: filter: BPF testsuiteAlexei Starovoitov1-1/+7
The testsuite covers classic and internal BPF instructions. It is particularly useful for JIT compiler developers. Adds to "net" selftest target. The testsuite can be used as a set of micro-benchmarks. It measures execution time of each BPF program in nsec. This patch adds core framework. Signed-off-by: Alexei Starovoitov <ast@plumgrid.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-07-02tools: selftests: psock_tpacket: get rid of macro wrappersDaniel Borkmann1-39/+20
The TPACKET_V3 test code consists of a lot of unecessary macro wrappers that rather obfuscate what members are accessed in what way. So get rid of them and make the code more readable. Also credit Chetan for providing tpacket_v3 example code. Furthermore, get rid of private offset usage, as we do not need it here. Signed-off-by: Daniel Borkmann <dborkman@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-04-29selftests: psock_tpacket: fix status checkDaniel Borkmann1-2/+2
Testing like this for TP_STATUS_AVAILABLE clearly is a stupid bug since it always returns true. Fix this by only checking for flags where the kernel owns the packet and negate this result, since we also could run into the non-zero status TP_STATUS_WRONG_FORMAT and need to reclaim frames. Signed-off-by: Daniel Borkmann <dborkman@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-04-19net: Add .gitignore to networking selftests directory.David S. Miller1-0/+3
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-04-07selftests: net: add PF_PACKET TPACKET v1/v2/v3 selftestsDaniel Borkmann5-87/+966
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: Daniel Borkmann <dborkman@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-03-21net: fix psock_fanout on sparc64Willem de Bruijn1-1/+7
The packetsocket fanout test uses a packet ring. Use TPACKET_V2 instead of TPACKET_V1 to work around a known 32/64 bit issue in the older ring that manifests on sparc64. Signed-off-by: Willem de Bruijn <willemb@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2013-03-20net: Move selftests to common net/ subdirectory.David S. Miller5-0/+527
Suggested-by: Daniel Baluta <daniel.baluta@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>