From: David Ahern <dsahern@gmail.com>
To: Chiara Meiohas <cmeiohas@nvidia.com>,
leon@kernel.org, stephen@networkplumber.org
Cc: michaelgur@nvidia.com, jgg@nvidia.com,
linux-rdma@vger.kernel.org, netdev@vger.kernel.org
Subject: Re: [PATCH iproute2-next 0/4] Introduce FRMR pools
Date: Fri, 6 Mar 2026 18:45:38 -0700 [thread overview]
Message-ID: <2a638f50-6d22-4abe-9f20-74367a0f3295@gmail.com> (raw)
In-Reply-To: <20260302155200.2611098-1-cmeiohas@nvidia.com>
On 3/2/26 8:51 AM, Chiara Meiohas wrote:
> From Michael:
>
> This series adds support for managing Fast Registration Memory Region
> (FRMR) pools in rdma tool, enabling users to monitor and configure FRMR
> pool behavior.
>
Claude has some quibbles with the patches:
1. Type mismatch: RDMA_NLDEV_ATTR_RES_FRMR_POOL_AGING_PERIOD
In rdma/include/uapi/rdma/rdma_netlink.h:
> + RDMA_NLDEV_ATTR_RES_FRMR_POOL_AGING_PERIOD, /* u64 */
In rdma/res-frmr-pools.c (res_frmr_pools_one_set_aging):
> + uint32_t aging_period;
> + mnl_attr_put_u32(rd->nlh,
RDMA_NLDEV_ATTR_RES_FRMR_POOL_AGING_PERIOD,
> + aging_period);
The uapi header documents this attribute as u64, but the code declares a
uint32_t variable and sends it with mnl_attr_put_u32(). This mismatch
means userspace will send a 4-byte attribute when the kernel expects 8
bytes, leading to either a parse error or silent data truncation.
Fix: use uint64_t and mnl_attr_put_u64() to match the uapi annotation,
or correct the uapi comment to reflect the intended wire type.
---
2. Type mismatch: RDMA_NLDEV_ATTR_RES_FRMR_POOL_PINNED
In rdma/include/uapi/rdma/rdma_netlink.h:
> + RDMA_NLDEV_ATTR_RES_FRMR_POOL_PINNED, /* u8 */
In rdma/res-frmr-pools.c (res_frmr_pools_line):
> + uint32_t queue_handles = 0, pinned_handles = 0;
> + if (nla_line[RDMA_NLDEV_ATTR_RES_FRMR_POOL_PINNED])
> + pinned_handles = mnl_attr_get_u32(
> + nla_line[RDMA_NLDEV_ATTR_RES_FRMR_POOL_PINNED]);
In rdma/res-frmr-pools.c (res_frmr_pools_one_set_pinned):
> + uint32_t pinned_value;
> + mnl_attr_put_u32(rd->nlh, RDMA_NLDEV_ATTR_RES_FRMR_POOL_PINNED,
> + pinned_value);
The uapi header marks this as u8, but the code reads and writes it as u32
using mnl_attr_get_u32() and mnl_attr_put_u32(). The type used in
userspace must match the kernel's attribute definition.
Fix: decide on the actual wire type and make the uapi comment, variable
declaration, and mnl accessor consistent. If u32 is correct, change the
comment to /* u32 */; if u8 is correct, use uint8_t and mnl_attr_put_u8().
---
3. Declared but unimplemented: res_frmr_pools_idx_parse_cb
In rdma/res.h:
> +int res_frmr_pools_idx_parse_cb(const struct nlmsghdr *nlh, void *data);
This function is declared alongside all the other *_idx_parse_cb symbols,
but there is no corresponding definition in rdma/res-frmr-pools.c.
Because res_frmr_pools uses id=0 in RES_FUNC:
> +RES_FUNC(res_frmr_pools, RDMA_NLDEV_CMD_RES_FRMR_POOLS_GET,
> + frmr_pools_valid_filters, true, 0);
the macro's idx path is never triggered, so this won't cause a link error
in practice. However, the declaration is misleading and inconsistent with
the other resource types where the idx callback exists because they pass a
non-zero id. Either implement the function (if per-index lookup is
planned) or remove the declaration from res.h.
---
next prev parent reply other threads:[~2026-03-07 1:45 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-02 15:51 [PATCH iproute2-next 0/4] Introduce FRMR pools Chiara Meiohas
2026-03-02 15:51 ` [PATCH iproute2-next 1/4] rdma: Update headers Chiara Meiohas
2026-03-02 15:51 ` [PATCH iproute2-next 2/4] rdma: Add resource FRMR pools show command Chiara Meiohas
2026-03-07 1:45 ` David Ahern
2026-03-16 17:17 ` Michael Gur
2026-03-02 15:51 ` [PATCH iproute2-next 3/4] rdma: Add FRMR pools set aging command Chiara Meiohas
2026-03-02 15:52 ` [PATCH iproute2-next 4/4] rdma: Add FRMR pools set pinned command Chiara Meiohas
2026-03-07 0:16 ` [PATCH iproute2-next 0/4] Introduce FRMR pools David Ahern
2026-03-09 15:48 ` Chiara Meiohas
2026-03-07 1:45 ` David Ahern [this message]
2026-03-16 21:37 ` Michael Gur
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=2a638f50-6d22-4abe-9f20-74367a0f3295@gmail.com \
--to=dsahern@gmail.com \
--cc=cmeiohas@nvidia.com \
--cc=jgg@nvidia.com \
--cc=leon@kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=michaelgur@nvidia.com \
--cc=netdev@vger.kernel.org \
--cc=stephen@networkplumber.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