RE: [PATCH rdma-next v2 2/3] RDMA/mana_ib: MMQ creation for RC QPs

From: Long Li

Date: Fri Aug 28 2026 - 15:40:10 EST


> From: Konstantin Taranov <kotaranov@xxxxxxxxxxxxx>
>
> Create an MMQ for an RC QP when userspace sets the corresponding
> compatibility-mask flag. Register the userspace MMQ buffer and pass the
> queue to hardware instead of setting the NO_MMQ creation flag.
>
> Keep the MMQ disabled for applications that do not request it, preserving the
> existing behavior. Return the created MMQ ID to userspace in the extended RC
> QP response.
>
> Signed-off-by: Konstantin Taranov <kotaranov@xxxxxxxxxxxxx>

Reviewed-by: Long Li <longli@xxxxxxxxxxxxx>




> ---
> drivers/infiniband/hw/mana/qp.c | 20 ++++++++++++++------
> 1 file changed, 14 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/infiniband/hw/mana/qp.c
> b/drivers/infiniband/hw/mana/qp.c index aa5f8c607..c6821ae5f 100644
> --- a/drivers/infiniband/hw/mana/qp.c
> +++ b/drivers/infiniband/hw/mana/qp.c
> @@ -557,16 +557,22 @@ static int mana_ib_create_rc_qp(struct ib_qp *ibqp,
> struct ib_pd *ibpd,
>
> for (i = 0, j = 0; i < MANA_RC_QUEUE_TYPE_MAX; ++i) {
> if (i == MANA_RC_SEND_QUEUE_MMQ) {
> - qp->rc_qp.queues[i].id = INVALID_QUEUE_ID;
> - qp->rc_qp.queues[i].gdma_region =
> GDMA_INVALID_DMA_REGION;
> + if (ucmd.comp_mask & MANA_IB_RC_MMQ_CREATE)
> {
> + flags &= ~MANA_RC_FLAG_NO_MMQ;
> + err = mana_ib_create_queue(mdev,
> ucmd.mmq_buf, ucmd.mmq_size,
> + &qp-
> >rc_qp.queues[i]);
> + if (err)
> + goto destroy_queues;
> + } else {
> + qp->rc_qp.queues[i].id = INVALID_QUEUE_ID;
> + qp->rc_qp.queues[i].gdma_region =
> GDMA_INVALID_DMA_REGION;
> + }
> continue;
> }
> err = mana_ib_create_queue(mdev, ucmd.queue_buf[j],
> ucmd.queue_size[j],
> &qp->rc_qp.queues[i]);
> - if (err) {
> - ibdev_err(&mdev->ib_dev, "Failed to create queue %d,
> err %d\n", i, err);
> + if (err)
> goto destroy_queues;
> - }
> j++;
> }
>
> @@ -580,8 +586,10 @@ static int mana_ib_create_rc_qp(struct ib_qp *ibqp,
> struct ib_pd *ibpd,
>
> if (udata) {
> for (i = 0, j = 0; i < MANA_RC_QUEUE_TYPE_MAX; ++i) {
> - if (i == MANA_RC_SEND_QUEUE_MMQ)
> + if (i == MANA_RC_SEND_QUEUE_MMQ) {
> + resp.mmq_id = qp->rc_qp.queues[i].id;
> continue;
> + }
> resp.queue_id[j] = qp->rc_qp.queues[i].id;
> j++;
> }
> --
> 2.43.0