diff options
author | Weqaar Janjua <weqaar.janjua@gmail.com> | 2020-12-07 21:53:30 +0000 |
---|---|---|
committer | Daniel Borkmann <daniel@iogearbox.net> | 2020-12-09 16:44:45 +0100 |
commit | facb7cb2e909ad2d21ebbfdc051726d4cd8f1d35 (patch) | |
tree | f8a844bbf22ac944b66b90a3cc65b511611b4961 /tools/testing/selftests/bpf/xsk_prereqs.sh | |
parent | a89052572ebbf4bcee7c39390640e92b60eaa653 (diff) | |
download | lwn-facb7cb2e909ad2d21ebbfdc051726d4cd8f1d35.tar.gz lwn-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/xsk_prereqs.sh')
-rwxr-xr-x | tools/testing/selftests/bpf/xsk_prereqs.sh | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tools/testing/selftests/bpf/xsk_prereqs.sh b/tools/testing/selftests/bpf/xsk_prereqs.sh index 29762739c21b..9d54c4645127 100755 --- a/tools/testing/selftests/bpf/xsk_prereqs.sh +++ b/tools/testing/selftests/bpf/xsk_prereqs.sh @@ -14,6 +14,8 @@ RED='\033[0;31m' NC='\033[0m' STACK_LIM=131072 SPECFILE=veth.spec +XSKOBJ=xdpxceiver +NUMPKTS=10000 validate_root_exec() { @@ -117,3 +119,17 @@ vethXDPnative() ip link set dev $1 xdpgeneric off ip netns exec $3 ip link set dev $2 xdpgeneric off } + +execxdpxceiver() +{ + local -a 'paramkeys=("${!'"$1"'[@]}")' copy + paramkeysstr=${paramkeys[*]} + + for index in $paramkeysstr; + do + current=$1"[$index]" + copy[$index]=${!current} + done + + ./${XSKOBJ} -i ${VETH0} -i ${VETH1},${NS1} ${copy[*]} -C ${NUMPKTS} +} |