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>
This commit is contained in:
Jiri Pirko 2018-02-28 12:25:13 +02:00 committed by David S. Miller
parent 4fb20ae137
commit 2f19f2125d

View File

@ -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