Skip to content

Commit 23f59f4

Browse files
Konstantin Taranovrleon
authored andcommitted
RDMA/mana_ib: Use num_comp_vectors of ib_device
Use num_comp_vectors of struct ib_device instead of max_num_queues from gdma_context. Signed-off-by: Konstantin Taranov <kotaranov@microsoft.com> Link: https://lore.kernel.org/r/1712911656-17352-1-git-send-email-kotaranov@linux.microsoft.com Reviewed-by: Long Li <longli@microsoft.com> Signed-off-by: Leon Romanovsky <leon@kernel.org>
1 parent dfcdb38 commit 23f59f4

File tree

3 files changed

+4
-9
lines changed

3 files changed

+4
-9
lines changed

drivers/infiniband/hw/mana/cq.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,14 @@ int mana_ib_create_cq(struct ib_cq *ibcq, const struct ib_cq_init_attr *attr,
1212
struct ib_device *ibdev = ibcq->device;
1313
struct mana_ib_create_cq ucmd = {};
1414
struct mana_ib_dev *mdev;
15-
struct gdma_context *gc;
1615
int err;
1716

1817
mdev = container_of(ibdev, struct mana_ib_dev, ib_dev);
19-
gc = mdev_to_gc(mdev);
2018

2119
if (udata->inlen < sizeof(ucmd))
2220
return -EINVAL;
2321

24-
if (attr->comp_vector > gc->max_num_queues)
25-
return -EINVAL;
26-
27-
cq->comp_vector = attr->comp_vector;
22+
cq->comp_vector = attr->comp_vector % ibdev->num_comp_vectors;
2823

2924
err = ib_copy_from_udata(&ucmd, udata, min(sizeof(ucmd), udata->inlen));
3025
if (err) {

drivers/infiniband/hw/mana/device.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ static int mana_ib_probe(struct auxiliary_device *adev,
7474
* num_comp_vectors needs to set to the max MSIX index
7575
* when interrupts and event queues are implemented
7676
*/
77-
dev->ib_dev.num_comp_vectors = 1;
77+
dev->ib_dev.num_comp_vectors = mdev->gdma_context->max_num_queues;
7878
dev->ib_dev.dev.parent = mdev->gdma_context->dev;
7979

8080
ret = mana_gd_register_device(&mdev->gdma_context->mana_ib);

drivers/infiniband/hw/mana/qp.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ static int mana_ib_create_qp_rss(struct ib_qp *ibqp, struct ib_pd *pd,
198198
cq_spec.gdma_region = cq->queue.gdma_region;
199199
cq_spec.queue_size = cq->cqe * COMP_ENTRY_SIZE;
200200
cq_spec.modr_ctx_id = 0;
201-
eq = &mpc->ac->eqs[cq->comp_vector % gc->max_num_queues];
201+
eq = &mpc->ac->eqs[cq->comp_vector];
202202
cq_spec.attached_eq = eq->eq->id;
203203

204204
ret = mana_create_wq_obj(mpc, mpc->port_handle, GDMA_RQ,
@@ -357,7 +357,7 @@ static int mana_ib_create_qp_raw(struct ib_qp *ibqp, struct ib_pd *ibpd,
357357
cq_spec.gdma_region = send_cq->queue.gdma_region;
358358
cq_spec.queue_size = send_cq->cqe * COMP_ENTRY_SIZE;
359359
cq_spec.modr_ctx_id = 0;
360-
eq_vec = send_cq->comp_vector % gc->max_num_queues;
360+
eq_vec = send_cq->comp_vector;
361361
eq = &mpc->ac->eqs[eq_vec];
362362
cq_spec.attached_eq = eq->eq->id;
363363

0 commit comments

Comments
 (0)