Skip to content

Commit 2f19f21

Browse files
jpirkodavem330
authored andcommitted
selftests: forwarding: Add tc offload check helper
Signed-off-by: Jiri Pirko <[email protected]> Signed-off-by: Ido Schimmel <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 4fb20ae commit 2f19f21

File tree

1 file changed

+13
-0
lines changed
  • tools/testing/selftests/net/forwarding

1 file changed

+13
-0
lines changed

tools/testing/selftests/net/forwarding/lib.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,19 @@ forwarding_restore()
296296
sysctl -q -w net.ipv4.conf.all.forwarding=$ipv4_fwd
297297
}
298298

299+
tc_offload_check()
300+
{
301+
for i in $(eval echo {1..$NUM_NETIFS}); do
302+
ethtool -k ${NETIFS[p$i]} \
303+
| grep "hw-tc-offload: on" &> /dev/null
304+
if [[ $? -ne 0 ]]; then
305+
return 1
306+
fi
307+
done
308+
309+
return 0
310+
}
311+
299312
##############################################################################
300313
# Tests
301314

0 commit comments

Comments
 (0)