[PATCHv2 net-next] selftests: bpf: add check for ip XDP redirect

Subsystems: bpf [general] (safe dynamic programs and tools), bpf [selftests] (test runners & infrastructure), kernel selftest framework, the rest, xdp (express data path)

2 messages, 2 authors, 2017-08-11 · open the first message on its own page

[PATCHv2 net-next] selftests: bpf: add check for ip XDP redirect

From: William Tu <hidden>
Date: 2017-08-11 13:47:00

Kernel test robot reports error when running test_xdp_redirect.sh.
Check if ip tool supports xdpgeneric, if not, skip the test.

Signed-off-by: William Tu <redacted>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Cc: John Fastabend <john.fastabend@gmail.com>
---
 tools/testing/selftests/bpf/test_xdp_redirect.sh | 5 +++++
 1 file changed, 5 insertions(+)
diff --git a/tools/testing/selftests/bpf/test_xdp_redirect.sh b/tools/testing/selftests/bpf/test_xdp_redirect.sh
index d8c73ed6e040..344a3656dea6 100755
--- a/tools/testing/selftests/bpf/test_xdp_redirect.sh
+++ b/tools/testing/selftests/bpf/test_xdp_redirect.sh
@@ -23,6 +23,11 @@ cleanup()
 	ip netns del ns2 2> /dev/null
 }
 
+ip link set dev lo xdpgeneric off 2>/dev/null > /dev/null
+if [ $? -ne 0 ];then
+	echo "selftests: [SKIP] Could not run test without the ip xdpgeneric support"
+	exit 0
+fi
 set -e
 
 ip netns add ns1
-- 
2.7.4

Re: [PATCHv2 net-next] selftests: bpf: add check for ip XDP redirect

From: David Miller <davem@davemloft.net>
Date: 2017-08-11 21:57:45

From: William Tu <redacted>
Date: Fri, 11 Aug 2017 06:46:39 -0700
Kernel test robot reports error when running test_xdp_redirect.sh.
Check if ip tool supports xdpgeneric, if not, skip the test.

Signed-off-by: William Tu <redacted>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Applied, thank you.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help