diff options
author | Ido Schimmel <idosch@mellanox.com> | 2020-07-15 11:27:32 +0300 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2020-07-15 18:10:00 -0700 |
commit | 5061e773264b11fdc51c61d6619aca76efd3424f (patch) | |
tree | 4bec9f85c72c37658c0a596b9fe3fbe9d75ce89d /tools/testing/selftests/drivers/net/mlxsw/spectrum | |
parent | cb12d176326722e2f4ede4e459e86ea36607c555 (diff) |
selftests: mlxsw: Add scale test for tc-police
Query the maximum number of supported policers using devlink-resource
and test that this number can be reached by configuring tc filters with
police action. Test that an error is returned in case the maximum number
is exceeded.
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Reviewed-by: Petr Machata <petrm@mellanox.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'tools/testing/selftests/drivers/net/mlxsw/spectrum')
-rwxr-xr-x | tools/testing/selftests/drivers/net/mlxsw/spectrum/resource_scale.sh | 2 | ||||
-rw-r--r-- | tools/testing/selftests/drivers/net/mlxsw/spectrum/tc_police_scale.sh | 16 |
2 files changed, 17 insertions, 1 deletions
diff --git a/tools/testing/selftests/drivers/net/mlxsw/spectrum/resource_scale.sh b/tools/testing/selftests/drivers/net/mlxsw/spectrum/resource_scale.sh index 43ba1b438f6d..43f662401bc3 100755 --- a/tools/testing/selftests/drivers/net/mlxsw/spectrum/resource_scale.sh +++ b/tools/testing/selftests/drivers/net/mlxsw/spectrum/resource_scale.sh @@ -22,7 +22,7 @@ cleanup() devlink_sp_read_kvd_defaults trap cleanup EXIT -ALL_TESTS="router tc_flower mirror_gre" +ALL_TESTS="router tc_flower mirror_gre tc_police" for current_test in ${TESTS:-$ALL_TESTS}; do source ${current_test}_scale.sh diff --git a/tools/testing/selftests/drivers/net/mlxsw/spectrum/tc_police_scale.sh b/tools/testing/selftests/drivers/net/mlxsw/spectrum/tc_police_scale.sh new file mode 100644 index 000000000000..e79ac0dad1f4 --- /dev/null +++ b/tools/testing/selftests/drivers/net/mlxsw/spectrum/tc_police_scale.sh @@ -0,0 +1,16 @@ +# SPDX-License-Identifier: GPL-2.0 +source ../tc_police_scale.sh + +tc_police_get_target() +{ + local should_fail=$1; shift + local target + + target=$(devlink_resource_size_get global_policers single_rate_policers) + + if ((! should_fail)); then + echo $target + else + echo $((target + 1)) + fi +} |