summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/net
diff options
context:
space:
mode:
authorIdo Schimmel <idosch@mellanox.com>2020-07-15 11:27:33 +0300
committerJakub Kicinski <kuba@kernel.org>2020-07-15 18:10:00 -0700
commit46b171d7d73aedfae8070622f1798ac4b124284c (patch)
tree2be3e396469bd2376f5b6a981c306a7ef9665084 /tools/testing/selftests/net
parent5061e773264b11fdc51c61d6619aca76efd3424f (diff)
selftests: mlxsw: Test policers' occupancy
Test that policers shared by different tc filters are correctly reference counted by observing policers' occupancy via devlink-resource. 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/net')
-rw-r--r--tools/testing/selftests/net/forwarding/devlink_lib.sh5
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/testing/selftests/net/forwarding/devlink_lib.sh b/tools/testing/selftests/net/forwarding/devlink_lib.sh
index f0e6be4c09e9..75fe24bcb9cd 100644
--- a/tools/testing/selftests/net/forwarding/devlink_lib.sh
+++ b/tools/testing/selftests/net/forwarding/devlink_lib.sh
@@ -98,6 +98,11 @@ devlink_resource_size_set()
check_err $? "Failed setting path $path to size $size"
}
+devlink_resource_occ_get()
+{
+ devlink_resource_get "$@" | jq '.["occ"]'
+}
+
devlink_reload()
{
local still_pending