Linux RDMA and InfiniBand development
 help / color / mirror / Atom feed
From: Tao Cui <cuitao@kylinos.cn>
To: Leon Romanovsky <leon@kernel.org>
Cc: jgg@ziepe.ca, linux-rdma@vger.kernel.org
Subject: Re: [PATCH 1/2] RDMA/nldev: add resource summary max values for usage rate display
Date: Tue, 28 Apr 2026 16:20:25 +0800	[thread overview]
Message-ID: <9722fa3e-aee1-4fce-869f-8b2f9591539b@kylinos.cn> (raw)
In-Reply-To: <20260426124223.GF440345@unreal>



在 2026/4/26 20:42, Leon Romanovsky 写道:
> On Thu, Apr 23, 2026 at 02:13:51PM +0800, Tao Cui wrote:
>> Add RDMA_NLDEV_ATTR_RES_SUMMARY_ENTRY_MAX netlink attribute to expose
>> device resource limits (max_qp, max_cq, max_mr, max_pd, max_srq) in
>> the resource summary alongside the existing current count. This allows
>> userspace tools like iproute2's rdma to display resource usage rates.
> 
> Historically, we try to avoid duplicating functionality, and this already
> exists in ibv_devinfo. What is the reason for adding it to rdmatool as well?
> 
Thanks for your review.

You're right that ibv_devinfo exposes these limits via the verbs API.
The motivation here is not to duplicate ibv_devinfo, but to make the
existing `rdma resource show` output more self-contained.

Currently `rdma resource show` displays current resource counts (curr),
but not the maximum limits. To compute usage rates, a user must
cross-reference two separate tools using different interfaces
(ibv_devinfo via verbs vs. rdma via netlink). This is especially
inconvenient for monitoring and automation use cases that rely on
netlink + JSON output.

By adding max alongside curr in the same resource summary entry, the
rdma tool can present a complete picture in one query, and userspace
can compute usage rates without querying two different interfaces.

That said, if you feel this doesn't justify the addition, I'm happy
to withdraw or adjust the approach. For example, an alternative would
be to not add a new netlink attribute and instead let userspace tools
do the cross-referencing, though I think the single-query approach
provides better usability.

>>
>> The new attribute is optional and backward compatible - old userspace
>> tools will simply ignore it.
>>
>> Signed-off-by: Tao Cui <cuitao@kylinos.cn>


  parent reply	other threads:[~2026-04-28  8:20 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-23  6:13 [PATCH 1/2] RDMA/nldev: add resource summary max values for usage rate display Tao Cui
2026-04-23  6:13 ` [PATCH 2/2] selftests/rdma: add resource usage rate display test Tao Cui
2026-04-26 12:42 ` [PATCH 1/2] RDMA/nldev: add resource summary max values for usage rate display Leon Romanovsky
2026-04-26 12:47   ` Leon Romanovsky
2026-04-28  8:20   ` Tao Cui [this message]
2026-05-11 10:12 ` Leon Romanovsky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9722fa3e-aee1-4fce-869f-8b2f9591539b@kylinos.cn \
    --to=cuitao@kylinos.cn \
    --cc=jgg@ziepe.ca \
    --cc=leon@kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox