aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/bpf/test_xsk.sh
diff options
context:
space:
mode:
authorWeqaar Janjua <weqaar.janjua@gmail.com>2020-12-07 21:53:30 +0000
committerDaniel Borkmann <daniel@iogearbox.net>2020-12-09 16:44:45 +0100
commitfacb7cb2e909ad2d21ebbfdc051726d4cd8f1d35 (patch)
treef8a844bbf22ac944b66b90a3cc65b511611b4961 /tools/testing/selftests/bpf/test_xsk.sh
parentselftests/bpf: Xsk selftests framework (diff)
downloadlinux-dev-facb7cb2e909ad2d21ebbfdc051726d4cd8f1d35.tar.xz
linux-dev-facb7cb2e909ad2d21ebbfdc051726d4cd8f1d35.zip
selftests/bpf: Xsk selftests - SKB POLL, NOPOLL
Adds following tests: 1. AF_XDP SKB mode Generic mode XDP is driver independent, used when the driver does not have support for XDP. Works on any netdevice using sockets and generic XDP path. XDP hook from netif_receive_skb(). a. nopoll - soft-irq processing b. poll - using poll() syscall Signed-off-by: Weqaar Janjua <weqaar.a.janjua@intel.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Tested-by: Yonghong Song <yhs@fb.com> Acked-by: Björn Töpel <bjorn.topel@intel.com> Link: https://lore.kernel.org/bpf/20201207215333.11586-3-weqaar.a.janjua@intel.com
Diffstat (limited to 'tools/testing/selftests/bpf/test_xsk.sh')
-rwxr-xr-xtools/testing/selftests/bpf/test_xsk.sh39
1 files changed, 37 insertions, 2 deletions
diff --git a/tools/testing/selftests/bpf/test_xsk.sh b/tools/testing/selftests/bpf/test_xsk.sh
index cae4c5574c4c..0b7bafb65f43 100755
--- a/tools/testing/selftests/bpf/test_xsk.sh
+++ b/tools/testing/selftests/bpf/test_xsk.sh
@@ -8,8 +8,17 @@
#
# Topology:
# ---------
-# ----------- -----------
-# | xskX | --------- | xskY |
+# -----------
+# _ | Process | _
+# / ----------- \
+# / | \
+# / | \
+# ----------- | -----------
+# | Thread1 | | | Thread2 |
+# ----------- | -----------
+# | | |
+# ----------- | -----------
+# | xskX | | | xskY |
# ----------- | -----------
# | | |
# ----------- | ----------
@@ -39,6 +48,8 @@
# conflict with any existing interface
# * tests the veth and xsk layers of the topology
#
+# See the source xdpxceiver.c for information on each test
+#
# Kernel configuration:
# ---------------------
# See "config" file for recommended kernel config options.
@@ -138,6 +149,30 @@ retval=$?
test_status $retval "${TEST_NAME}"
statusList+=($retval)
+### TEST 2
+TEST_NAME="SKB NOPOLL"
+
+vethXDPgeneric ${VETH0} ${VETH1} ${NS1}
+
+params=("-S")
+execxdpxceiver params
+
+retval=$?
+test_status $retval "${TEST_NAME}"
+statusList+=($retval)
+
+### TEST 3
+TEST_NAME="SKB POLL"
+
+vethXDPgeneric ${VETH0} ${VETH1} ${NS1}
+
+params=("-S" "-p")
+execxdpxceiver params
+
+retval=$?
+test_status $retval "${TEST_NAME}"
+statusList+=($retval)
+
## END TESTS
cleanup_exit ${VETH0} ${VETH1} ${NS1}