summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/net/run_afpackettests
diff options
context:
space:
mode:
authorDaniel Borkmann <dborkman@redhat.com>2013-04-02 17:00:51 +0400
committerDavid S. Miller <davem@davemloft.net>2013-04-08 01:02:24 +0400
commit23a9544206dd91dfe048fcf67abec3f3104c42b9 (patch)
tree144beb514dd0a62c106732a403061f8dc7791508 /tools/testing/selftests/net/run_afpackettests
parent9dcc71e1fdbb7aa10d92a3d35e8a201adc84abd0 (diff)
downloadlinux-23a9544206dd91dfe048fcf67abec3f3104c42b9.tar.xz
selftests: net: add PF_PACKET TPACKET v1/v2/v3 selftests
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>
Diffstat (limited to 'tools/testing/selftests/net/run_afpackettests')
-rw-r--r--tools/testing/selftests/net/run_afpackettests10
1 files changed, 10 insertions, 0 deletions
diff --git a/tools/testing/selftests/net/run_afpackettests b/tools/testing/selftests/net/run_afpackettests
index 7907824c6355..5246e782d6e8 100644
--- a/tools/testing/selftests/net/run_afpackettests
+++ b/tools/testing/selftests/net/run_afpackettests
@@ -14,3 +14,13 @@ if [ $? -ne 0 ]; then
else
echo "[PASS]"
fi
+
+echo "--------------------"
+echo "running psock_tpacket test"
+echo "--------------------"
+./psock_tpacket
+if [ $? -ne 0 ]; then
+ echo "[FAIL]"
+else
+ echo "[PASS]"
+fi