selftests: mlxsw: Add tc action hw_stats tests

Add tests for mlxsw hw_stats types.

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
2020-03-18 15:48:57 +02:00
committed by David S. Miller
parent 4e145fc6eb
commit ee4848ac1a
2 changed files with 139 additions and 0 deletions

View File

@@ -60,6 +60,15 @@ check_tc_chain_support()
fi
}
check_tc_action_hw_stats_support()
{
tc actions help 2>&1 | grep -q hw_stats
if [[ $? -ne 0 ]]; then
echo "SKIP: iproute2 too old; tc is missing action hw_stats support"
exit 1
fi
}
if [[ "$(id -u)" -ne 0 ]]; then
echo "SKIP: need root privileges"
exit 0