public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH rdma-next 1/1] RDMA/mana_ib: Use num_comp_vectors of ib_device
@ 2024-04-12  8:47 Konstantin Taranov
  2024-04-16 10:44 ` Leon Romanovsky
  0 siblings, 1 reply; 2+ messages in thread
From: Konstantin Taranov @ 2024-04-12  8:47 UTC (permalink / raw)
  To: kotaranov, sharmaajay, longli, jgg, leon; +Cc: linux-rdma, linux-kernel

From: Konstantin Taranov <kotaranov@microsoft.com>

Use num_comp_vectors of struct ib_device instead of max_num_queues
from gdma_context.

Signed-off-by: Konstantin Taranov <kotaranov@microsoft.com>
Reviewed-by: Long Li <longli@microsoft.com>
---
 drivers/infiniband/hw/mana/cq.c     | 7 +------
 drivers/infiniband/hw/mana/device.c | 2 +-
 drivers/infiniband/hw/mana/qp.c     | 4 ++--
 3 files changed, 4 insertions(+), 9 deletions(-)

diff --git a/drivers/infiniband/hw/mana/cq.c b/drivers/infiniband/hw/mana/cq.c
index c9129218f1be..dc931b9c3491 100644
--- a/drivers/infiniband/hw/mana/cq.c
+++ b/drivers/infiniband/hw/mana/cq.c
@@ -12,19 +12,14 @@ int mana_ib_create_cq(struct ib_cq *ibcq, const struct ib_cq_init_attr *attr,
 	struct ib_device *ibdev = ibcq->device;
 	struct mana_ib_create_cq ucmd = {};
 	struct mana_ib_dev *mdev;
-	struct gdma_context *gc;
 	int err;
 
 	mdev = container_of(ibdev, struct mana_ib_dev, ib_dev);
-	gc = mdev_to_gc(mdev);
 
 	if (udata->inlen < sizeof(ucmd))
 		return -EINVAL;
 
-	if (attr->comp_vector > gc->max_num_queues)
-		return -EINVAL;
-
-	cq->comp_vector = attr->comp_vector;
+	cq->comp_vector = attr->comp_vector % ibdev->num_comp_vectors;
 
 	err = ib_copy_from_udata(&ucmd, udata, min(sizeof(ucmd), udata->inlen));
 	if (err) {
diff --git a/drivers/infiniband/hw/mana/device.c b/drivers/infiniband/hw/mana/device.c
index 6fa902ee80a6..07e97de31886 100644
--- a/drivers/infiniband/hw/mana/device.c
+++ b/drivers/infiniband/hw/mana/device.c
@@ -74,7 +74,7 @@ static int mana_ib_probe(struct auxiliary_device *adev,
 	 * num_comp_vectors needs to set to the max MSIX index
 	 * when interrupts and event queues are implemented
 	 */
-	dev->ib_dev.num_comp_vectors = 1;
+	dev->ib_dev.num_comp_vectors = mdev->gdma_context->max_num_queues;
 	dev->ib_dev.dev.parent = mdev->gdma_context->dev;
 
 	ret = mana_gd_register_device(&mdev->gdma_context->mana_ib);
diff --git a/drivers/infiniband/hw/mana/qp.c b/drivers/infiniband/hw/mana/qp.c
index ef0a6dc664d0..f5c743db3a94 100644
--- a/drivers/infiniband/hw/mana/qp.c
+++ b/drivers/infiniband/hw/mana/qp.c
@@ -200,7 +200,7 @@ static int mana_ib_create_qp_rss(struct ib_qp *ibqp, struct ib_pd *pd,
 		cq_spec.gdma_region = cq->queue.gdma_region;
 		cq_spec.queue_size = cq->cqe * COMP_ENTRY_SIZE;
 		cq_spec.modr_ctx_id = 0;
-		eq = &mpc->ac->eqs[cq->comp_vector % gc->max_num_queues];
+		eq = &mpc->ac->eqs[cq->comp_vector];
 		cq_spec.attached_eq = eq->eq->id;
 
 		ret = mana_create_wq_obj(mpc, mpc->port_handle, GDMA_RQ,
@@ -359,7 +359,7 @@ static int mana_ib_create_qp_raw(struct ib_qp *ibqp, struct ib_pd *ibpd,
 	cq_spec.gdma_region = send_cq->queue.gdma_region;
 	cq_spec.queue_size = send_cq->cqe * COMP_ENTRY_SIZE;
 	cq_spec.modr_ctx_id = 0;
-	eq_vec = send_cq->comp_vector % gc->max_num_queues;
+	eq_vec = send_cq->comp_vector;
 	eq = &mpc->ac->eqs[eq_vec];
 	cq_spec.attached_eq = eq->eq->id;
 

base-commit: f10242b3da908dc9d4bfa040e6511a5b86522499
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH rdma-next 1/1] RDMA/mana_ib: Use num_comp_vectors of ib_device
  2024-04-12  8:47 [PATCH rdma-next 1/1] RDMA/mana_ib: Use num_comp_vectors of ib_device Konstantin Taranov
@ 2024-04-16 10:44 ` Leon Romanovsky
  0 siblings, 0 replies; 2+ messages in thread
From: Leon Romanovsky @ 2024-04-16 10:44 UTC (permalink / raw)
  To: kotaranov, sharmaajay, longli, jgg, Konstantin Taranov
  Cc: linux-rdma, linux-kernel


On Fri, 12 Apr 2024 01:47:36 -0700, Konstantin Taranov wrote:
> Use num_comp_vectors of struct ib_device instead of max_num_queues
> from gdma_context.
> 
> 

Applied, thanks!

[1/1] RDMA/mana_ib: Use num_comp_vectors of ib_device
      https://git.kernel.org/rdma/rdma/c/23f59f4e837bba

Best regards,
-- 
Leon Romanovsky <leon@kernel.org>


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-04-16 10:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-12  8:47 [PATCH rdma-next 1/1] RDMA/mana_ib: Use num_comp_vectors of ib_device Konstantin Taranov
2024-04-16 10:44 ` Leon Romanovsky

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox