RE: [EXTERNAL] Re: [PATCH rdma-next v3 1/1] RDMA/mana: Provide a modern CQ creation interface
From: Konstantin Taranov
Date: Wed Mar 25 2026 - 06:40:50 EST
> -----Original Message-----
> From: Leon Romanovsky <leon@xxxxxxxxxx>
> Sent: Sunday, 22 March 2026 15:01
> To: Konstantin Taranov <kotaranov@xxxxxxxxxxxxxxxxxxx>
> Cc: Konstantin Taranov <kotaranov@xxxxxxxxxxxxx>; Shiraz Saleem
> <shirazsaleem@xxxxxxxxxxxxx>; Long Li <longli@xxxxxxxxxxxxx>;
> jgg@xxxxxxxx; linux-rdma@xxxxxxxxxxxxxxx; linux-kernel@xxxxxxxxxxxxxxx
> Subject: [EXTERNAL] Re: [PATCH rdma-next v3 1/1] RDMA/mana: Provide a
> modern CQ creation interface
>
> On Wed, Mar 18, 2026 at 10:54:55AM -0700, Konstantin Taranov wrote:
> > From: Konstantin Taranov <kotaranov@xxxxxxxxxxxxx>
> >
> > The uverbs CQ creation UAPI allows users to supply their own umem for a
> CQ.
> > Create cq->umem if it was not created and use it to create a mana queue.
> > The created umem is owned by IB/core and will be deallocated by IB/core.
> >
> > To support RDMA objects that own umem, introduce
> > mana_ib_create_queue_with_umem() to use the umem provided by the
> > caller and do not de-allocate umem if it was allocted by the caller.
> >
> > Signed-off-by: Konstantin Taranov <kotaranov@xxxxxxxxxxxxx>
> > ---
> > v3: Make umem allocation explicit for cq->umem and use a new helper to
> create mana queue from it.
> > Remove the universal helper that was added in v2
> > v2: Rework of Leon's commit. Introduce univesal helper that returned
> ownership of umem to caller.
> > Added removed u32 overlow check for kernel cq.
> > drivers/infiniband/hw/mana/cq.c | 131 ++++++++++++++++++---------
> > drivers/infiniband/hw/mana/device.c | 1 +
> > drivers/infiniband/hw/mana/main.c | 27 +++---
> > drivers/infiniband/hw/mana/mana_ib.h | 5 +-
> > 4 files changed, 106 insertions(+), 58 deletions(-)
>
> <...>
>
> > +int mana_ib_create_queue_from_umem(struct mana_ib_dev *mdev,
> struct ib_umem *umem,
> > + struct mana_ib_queue *queue)
> > +{
> > + queue->umem = NULL;
>
> Two things. First, I'm waiting for Jason to converge on this
> ib_copy_*() work. Second, I still believe drivers should not cache umem.
Thanks for reviewing!
The helper mana_ib_create_queue_from_umem() does not cache umem.
In general, for other object, mana_ib needs to cache umem (e.g., for QPs).
In our HW design QPs have several queues and we need to pin them. So that
queue->umem just indicates that some queues still have their own umem.
I am happy to employ mana_ib_create_queue_from_umem() in other places
where it is will be possible and remove queue->umem completely, once it is
possible.
Thanks
>
> Thanks