selftests: devlink_lib: Add function for querying maximum pool size
authorAmit Cohen <amcohen@nvidia.com>
Wed, 14 Sep 2022 11:21:50 +0000 (13:21 +0200)
committerJakub Kicinski <kuba@kernel.org>
Tue, 20 Sep 2022 01:07:59 +0000 (18:07 -0700)
The maximum pool size is exposed via 'devlink sb' command. The next
patch will add a test which increases some pools to the maximum size.

Add a function to query the value.

Signed-off-by: Amit Cohen <amcohen@nvidia.com>
Reviewed-by: Petr Machata <petrm@nvidia.com>
Signed-off-by: Petr Machata <petrm@nvidia.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
tools/testing/selftests/net/forwarding/devlink_lib.sh

index de9944d..601990c 100644 (file)
@@ -584,3 +584,8 @@ devlink_cell_size_get()
        devlink sb pool show "$DEVLINK_DEV" pool 0 -j \
            | jq '.pool[][].cell_size'
 }
+
+devlink_pool_size_get()
+{
+       devlink sb show "$DEVLINK_DEV" -j | jq '.[][][]["size"]'
+}