diff options
author | Jiri Pirko <jiri@mellanox.com> | 2018-02-28 11:25:13 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-02-28 18:25:48 +0100 |
commit | 2f19f2125d824fc607359f6d9248bd765edf7183 (patch) | |
tree | 19d6e853b513ff83386326b4fd3b71e1c77adad5 /tools/testing/selftests | |
parent | selftests: forwarding: Test IPv6 weighted nexthops (diff) | |
download | linux-2f19f2125d824fc607359f6d9248bd765edf7183.tar.xz linux-2f19f2125d824fc607359f6d9248bd765edf7183.zip |
selftests: forwarding: Add tc offload check helper
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'tools/testing/selftests')
-rw-r--r-- | tools/testing/selftests/net/forwarding/lib.sh | 13 |
1 files changed, 13 insertions, 0 deletions
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 |