From patchwork Thu Sep 30 21:20:50 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacob Keller X-Patchwork-Id: 12529347 X-Patchwork-Delegate: dsahern@gmail.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4753AC433EF for ; Thu, 30 Sep 2021 21:21:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3370861A59 for ; Thu, 30 Sep 2021 21:21:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349387AbhI3VWq (ORCPT ); Thu, 30 Sep 2021 17:22:46 -0400 Received: from mga04.intel.com ([192.55.52.120]:24274 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348770AbhI3VWp (ORCPT ); Thu, 30 Sep 2021 17:22:45 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10123"; a="223401442" X-IronPort-AV: E=Sophos;i="5.85,336,1624345200"; d="scan'208";a="223401442" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Sep 2021 14:21:01 -0700 X-IronPort-AV: E=Sophos;i="5.85,336,1624345200"; d="scan'208";a="520621727" Received: from jekeller-desk.amr.corp.intel.com ([10.166.241.1]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Sep 2021 14:21:01 -0700 From: Jacob Keller To: netdev@vger.kernel.org Cc: Jakub Kicinski , Jiri Pirko , Jacob Keller Subject: [iproute2-next] devlink: print maximum number of snapshots if available Date: Thu, 30 Sep 2021 14:20:50 -0700 Message-Id: <20210930212050.1673896-1-jacob.e.keller@intel.com> X-Mailer: git-send-email 2.31.1.331.gb0c09ab8796f MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: dsahern@gmail.com 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 --- 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 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); }