From: Jiri Pirko Date: Wed, 28 Feb 2018 10:25:13 +0000 (+0200) Subject: selftests: forwarding: Add tc offload check helper X-Git-Tag: v5.15~9146^2~331^2~6 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2f19f2125d824fc607359f6d9248bd765edf7183;p=platform%2Fkernel%2Flinux-starfive.git selftests: forwarding: Add tc offload check helper Signed-off-by: Jiri Pirko Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller --- diff --git a/tools/testing/selftests/net/forwarding/lib.sh b/tools/testing/selftests/net/forwarding/lib.sh index 6866f4a4bc4e..92e46426bd1d 100644 --- a/tools/testing/selftests/net/forwarding/lib.sh +++ b/tools/testing/selftests/net/forwarding/lib.sh @@ -296,6 +296,19 @@ forwarding_restore() sysctl -q -w net.ipv4.conf.all.forwarding=$ipv4_fwd } +tc_offload_check() +{ + for i in $(eval echo {1..$NUM_NETIFS}); do + ethtool -k ${NETIFS[p$i]} \ + | grep "hw-tc-offload: on" &> /dev/null + if [[ $? -ne 0 ]]; then + return 1 + fi + done + + return 0 +} + ############################################################################## # Tests