Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2f19f212 authored by Jiri Pirko's avatar Jiri Pirko Committed by David S. Miller
Browse files

selftests: forwarding: Add tc offload check helper

parent 4fb20ae1
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -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