From: William Tu Date: Fri, 11 Aug 2017 13:46:39 +0000 (-0700) Subject: selftests: bpf: add check for ip XDP redirect X-Git-Tag: v4.14-rc1~130^2~273 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=047dbb27ff470782c4bd3d574942e571e747463f;p=thirdparty%2Fkernel%2Flinux.git selftests: bpf: add check for ip XDP redirect 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 Acked-by: Daniel Borkmann Cc: John Fastabend Signed-off-by: David S. Miller --- diff --git a/tools/testing/selftests/bpf/test_xdp_redirect.sh b/tools/testing/selftests/bpf/test_xdp_redirect.sh index d8c73ed6e040b..344a3656dea6d 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