]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
devlink: print maximum number of snapshots if available
authorJacob Keller <jacob.e.keller@intel.com>
Thu, 30 Sep 2021 21:20:50 +0000 (14:20 -0700)
committerDavid Ahern <dsahern@kernel.org>
Tue, 5 Oct 2021 14:31:30 +0000 (08:31 -0600)
Recently the kernel gained ability to report the maximum number of
snapshots a region can have. Print this value out if it was reported.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Signed-off-by: David Ahern <dsahern@kernel.org>
devlink/devlink.c

index 2f2142ed385666cde1d280fd0c792a35917853a1..07c4e08ab9d8b121ec2d4feeb69c7404f50f17a4 100644 (file)
@@ -7845,6 +7845,10 @@ static void pr_out_region(struct dl *dl, struct nlattr **tb)
        if (tb[DEVLINK_ATTR_REGION_SNAPSHOT_ID])
                pr_out_snapshot(dl, tb);
 
+       if (tb[DEVLINK_ATTR_REGION_MAX_SNAPSHOTS])
+               pr_out_u64(dl, "max",
+                          mnl_attr_get_u32(tb[DEVLINK_ATTR_REGION_MAX_SNAPSHOTS]));
+
        pr_out_region_handle_end(dl);
 }