diff mbox series

[iproute2-next] devlink: print maximum number of snapshots if available

Message ID 20210930212050.1673896-1-jacob.e.keller@intel.com (mailing list archive)
State Accepted
Delegated to: David Ahern
Headers show
Series [iproute2-next] devlink: print maximum number of snapshots if available | expand

Checks

Context Check Description
netdev/tree_selection success Not a local patch

Commit Message

Jacob Keller Sept. 30, 2021, 9:20 p.m. UTC
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>
---

This requires updating the UAPI headers to the commit which includes the
DEVLINK_ATTR_REGION_MAX_SNAPSHOTS attribute.

 devlink/devlink.c | 4 ++++
 1 file changed, 4 insertions(+)


base-commit: 2f5825cb38028a14961a79844a069be4e3057eca

Comments

David Ahern Oct. 5, 2021, 2:39 p.m. UTC | #1
On 9/30/21 3:20 PM, Jacob Keller wrote:
> 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>
> ---
> 
> This requires updating the UAPI headers to the commit which includes the
> DEVLINK_ATTR_REGION_MAX_SNAPSHOTS attribute.
> 
>  devlink/devlink.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 

applied to iproute2-next
diff mbox series

Patch

diff --git a/devlink/devlink.c b/devlink/devlink.c
index 2f2142ed3856..07c4e08ab9d8 100644
--- a/devlink/devlink.c
+++ b/devlink/devlink.c
@@ -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);
 }