]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
RDMA/mana_ib: Take CQ type from the device type
authorKonstantin Taranov <kotaranov@microsoft.com>
Thu, 15 Jan 2026 09:36:25 +0000 (01:36 -0800)
committerLeon Romanovsky <leon@kernel.org>
Thu, 15 Jan 2026 11:03:22 +0000 (06:03 -0500)
Get CQ type from the used gdma device. The MANA_IB_CREATE_RNIC_CQ
flag is ignored. It was used in older kernel versions where
the mana_ib was shared between ethernet and rnic.

Fixes: d4293f96ce0b ("RDMA/mana_ib: unify mana_ib functions to support any gdma device")
Signed-off-by: Konstantin Taranov <kotaranov@microsoft.com>
Link: https://patch.msgid.link/20260115093625.177306-1-kotaranov@linux.microsoft.com
Signed-off-by: Leon Romanovsky <leon@kernel.org>
drivers/infiniband/hw/mana/cq.c
include/uapi/rdma/mana-abi.h

index 1becc87791235882517ad6750ff887deda967cb4..2dce1b677115066f341ba3313b60867b9adb47cb 100644 (file)
@@ -24,6 +24,7 @@ int mana_ib_create_cq(struct ib_cq *ibcq, const struct ib_cq_init_attr *attr,
 
        cq->comp_vector = attr->comp_vector % ibdev->num_comp_vectors;
        cq->cq_handle = INVALID_MANA_HANDLE;
+       is_rnic_cq = mana_ib_is_rnic(mdev);
 
        if (udata) {
                if (udata->inlen < offsetof(struct mana_ib_create_cq, flags))
@@ -35,8 +36,6 @@ int mana_ib_create_cq(struct ib_cq *ibcq, const struct ib_cq_init_attr *attr,
                        return err;
                }
 
-               is_rnic_cq = !!(ucmd.flags & MANA_IB_CREATE_RNIC_CQ);
-
                if ((!is_rnic_cq && attr->cqe > mdev->adapter_caps.max_qp_wr) ||
                    attr->cqe > U32_MAX / COMP_ENTRY_SIZE) {
                        ibdev_dbg(ibdev, "CQE %d exceeding limit\n", attr->cqe);
@@ -55,7 +54,6 @@ int mana_ib_create_cq(struct ib_cq *ibcq, const struct ib_cq_init_attr *attr,
                                                          ibucontext);
                doorbell = mana_ucontext->doorbell;
        } else {
-               is_rnic_cq = true;
                buf_size = MANA_PAGE_ALIGN(roundup_pow_of_two(attr->cqe * COMP_ENTRY_SIZE));
                cq->cqe = buf_size / COMP_ENTRY_SIZE;
                err = mana_ib_create_kernel_queue(mdev, buf_size, GDMA_CQ, &cq->queue);
index 45c2df619f07bbf575a44d51afbc7d9272e5ae5c..a75bf32b8cfb827a0866f6be7535c59881985580 100644 (file)
@@ -17,6 +17,9 @@
 #define MANA_IB_UVERBS_ABI_VERSION 1
 
 enum mana_ib_create_cq_flags {
+       /* Reserved for backward compatibility. Legacy
+        * kernel versions use it to create CQs in RNIC
+        */
        MANA_IB_CREATE_RNIC_CQ  = 1 << 0,
 };