Re: [PATCH rdma-next v2 1/1] RDMA/mana_ib: memory windows

From: Leon Romanovsky

Date: Mon Mar 30 2026 - 08:01:47 EST


On Wed, Mar 18, 2026 at 10:23:23AM -0700, Konstantin Taranov wrote:
> From: Konstantin Taranov <kotaranov@xxxxxxxxxxxxx>
>
> Implement .alloc_mw() and .dealloc_mw() for mana device.
>
> Signed-off-by: Konstantin Taranov <kotaranov@xxxxxxxxxxxxx>
> ---
> v2: fixed comments. Cleaned up the use of mana_gd_send_request()
> drivers/infiniband/hw/mana/device.c | 3 ++
> drivers/infiniband/hw/mana/mana_ib.h | 8 +++++
> drivers/infiniband/hw/mana/mr.c | 53 +++++++++++++++++++++++++++-
> include/net/mana/gdma.h | 5 +++
> 4 files changed, 68 insertions(+), 1 deletion(-)

<...>

> +static int mana_ib_gd_create_mw(struct mana_ib_dev *dev, struct mana_ib_pd *pd, struct ib_mw *ibmw)
> +{
> + struct mana_ib_mw *mw = container_of(ibmw, struct mana_ib_mw, ibmw);
> + struct gdma_context *gc = mdev_to_gc(dev);
> + struct gdma_create_mr_response resp = {};
> + struct gdma_create_mr_request req = {};
> + int err;
> +
> + mana_gd_init_req_hdr(&req.hdr, GDMA_CREATE_MR, sizeof(req), sizeof(resp));
> + req.pd_handle = pd->pd_handle;

Both sashiko, which runs on Gemnini https://sashiko.dev/#/patchset/20260318172323.1416803-1-kotaranov@xxxxxxxxxxxxxxxxxxx
and my local claude checks pointed to the same area of the code:

25 > + mana_gd_init_req_hdr(&req.hdr, GDMA_CREATE_MR, sizeof(req), sizeof(resp));
26 > + req.pd_handle = pd->pd_handle;
27
28 mana_gd_init_req_hdr() sets msg_version to GDMA_MESSAGE_V1.
29 mana_ib_gd_create_mr() explicitly upgrades this to GDMA_MESSAGE_V2
30 for all GDMA_CREATE_MR requests, regardless of mr_type:
31
32 mana_ib_gd_create_mr() {
33 mana_gd_init_req_hdr(&req.hdr, GDMA_CREATE_MR, ...);
34 req.hdr.req.msg_version = GDMA_MESSAGE_V2;
35 ...
36 }
37
38 Is it intentional that mana_ib_gd_create_mw() sends GDMA_CREATE_MR
39 at GDMA_MESSAGE_V1 rather than GDMA_MESSAGE_V2?

Thanks