Skip to content

Commit f972bde

Browse files
Konstantin Taranovrleon
authored andcommitted
RDMA/mana_ib: Take CQ type from the device type
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: d4293f9 ("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>
1 parent 7874eea commit f972bde

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

drivers/infiniband/hw/mana/cq.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ int mana_ib_create_cq(struct ib_cq *ibcq, const struct ib_cq_init_attr *attr,
2424

2525
cq->comp_vector = attr->comp_vector % ibdev->num_comp_vectors;
2626
cq->cq_handle = INVALID_MANA_HANDLE;
27+
is_rnic_cq = mana_ib_is_rnic(mdev);
2728

2829
if (udata) {
2930
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,
3536
return err;
3637
}
3738

38-
is_rnic_cq = !!(ucmd.flags & MANA_IB_CREATE_RNIC_CQ);
39-
4039
if ((!is_rnic_cq && attr->cqe > mdev->adapter_caps.max_qp_wr) ||
4140
attr->cqe > U32_MAX / COMP_ENTRY_SIZE) {
4241
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,
5554
ibucontext);
5655
doorbell = mana_ucontext->doorbell;
5756
} else {
58-
is_rnic_cq = true;
5957
buf_size = MANA_PAGE_ALIGN(roundup_pow_of_two(attr->cqe * COMP_ENTRY_SIZE));
6058
cq->cqe = buf_size / COMP_ENTRY_SIZE;
6159
err = mana_ib_create_kernel_queue(mdev, buf_size, GDMA_CQ, &cq->queue);

include/uapi/rdma/mana-abi.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717
#define MANA_IB_UVERBS_ABI_VERSION 1
1818

1919
enum mana_ib_create_cq_flags {
20+
/* Reserved for backward compatibility. Legacy
21+
* kernel versions use it to create CQs in RNIC
22+
*/
2023
MANA_IB_CREATE_RNIC_CQ = 1 << 0,
2124
};
2225

0 commit comments

Comments
 (0)