From: Konstantin Taranov <kotaranov@linux.microsoft.com>
To: kotaranov@microsoft.com, sharmaajay@microsoft.com,
longli@microsoft.com, jgg@ziepe.ca, leon@kernel.org
Cc: linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH rdma-next 3/6] RDMA/mana_ib: replace duplicate cqe with buf_size
Date: Thu, 18 Apr 2024 09:52:02 -0700 [thread overview]
Message-ID: <1713459125-14914-4-git-send-email-kotaranov@linux.microsoft.com> (raw)
In-Reply-To: <1713459125-14914-1-git-send-email-kotaranov@linux.microsoft.com>
From: Konstantin Taranov <kotaranov@microsoft.com>
Replace cqe with buf_size in struct mana_ib_cq.
The cqe field is already present in struct ib_cq and can be accessed there.
The buf_size field is required for mana RNIC CQs.
Signed-off-by: Konstantin Taranov <kotaranov@microsoft.com>
---
drivers/infiniband/hw/mana/cq.c | 4 ++--
drivers/infiniband/hw/mana/mana_ib.h | 2 +-
drivers/infiniband/hw/mana/qp.c | 4 ++--
3 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/infiniband/hw/mana/cq.c b/drivers/infiniband/hw/mana/cq.c
index dc931b9..0467ee8 100644
--- a/drivers/infiniband/hw/mana/cq.c
+++ b/drivers/infiniband/hw/mana/cq.c
@@ -33,8 +33,8 @@ int mana_ib_create_cq(struct ib_cq *ibcq, const struct ib_cq_init_attr *attr,
return -EINVAL;
}
- cq->cqe = attr->cqe;
- err = mana_ib_create_queue(mdev, ucmd.buf_addr, cq->cqe * COMP_ENTRY_SIZE, &cq->queue);
+ cq->buf_size = attr->cqe * COMP_ENTRY_SIZE;
+ err = mana_ib_create_queue(mdev, ucmd.buf_addr, cq->buf_size, &cq->queue);
if (err) {
ibdev_dbg(ibdev, "Failed to create queue for create cq, %d\n", err);
return err;
diff --git a/drivers/infiniband/hw/mana/mana_ib.h b/drivers/infiniband/hw/mana/mana_ib.h
index 9162f29..9c07021 100644
--- a/drivers/infiniband/hw/mana/mana_ib.h
+++ b/drivers/infiniband/hw/mana/mana_ib.h
@@ -90,7 +90,7 @@ struct mana_ib_mr {
struct mana_ib_cq {
struct ib_cq ibcq;
struct mana_ib_queue queue;
- int cqe;
+ u32 buf_size;
u32 comp_vector;
mana_handle_t cq_handle;
};
diff --git a/drivers/infiniband/hw/mana/qp.c b/drivers/infiniband/hw/mana/qp.c
index 280e85a..c4fb8b4 100644
--- a/drivers/infiniband/hw/mana/qp.c
+++ b/drivers/infiniband/hw/mana/qp.c
@@ -196,7 +196,7 @@ static int mana_ib_create_qp_rss(struct ib_qp *ibqp, struct ib_pd *pd,
wq_spec.queue_size = wq->wq_buf_size;
cq_spec.gdma_region = cq->queue.gdma_region;
- cq_spec.queue_size = cq->cqe * COMP_ENTRY_SIZE;
+ cq_spec.queue_size = cq->buf_size;
cq_spec.modr_ctx_id = 0;
eq = &mpc->ac->eqs[cq->comp_vector];
cq_spec.attached_eq = eq->eq->id;
@@ -355,7 +355,7 @@ static int mana_ib_create_qp_raw(struct ib_qp *ibqp, struct ib_pd *ibpd,
wq_spec.queue_size = ucmd.sq_buf_size;
cq_spec.gdma_region = send_cq->queue.gdma_region;
- cq_spec.queue_size = send_cq->cqe * COMP_ENTRY_SIZE;
+ cq_spec.queue_size = send_cq->buf_size;
cq_spec.modr_ctx_id = 0;
eq_vec = send_cq->comp_vector;
eq = &mpc->ac->eqs[eq_vec];
--
2.43.0
next prev parent reply other threads:[~2024-04-18 16:52 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-18 16:51 [PATCH rdma-next 0/6] RDMA/mana_ib: Implement RNIC CQs Konstantin Taranov
2024-04-18 16:52 ` [PATCH rdma-next 1/6] RDMA/mana_ib: create EQs for " Konstantin Taranov
2024-04-23 23:24 ` Long Li
2024-04-18 16:52 ` [PATCH rdma-next 2/6] RDMA/mana_ib: create and destroy RNIC cqs Konstantin Taranov
2024-04-23 23:30 ` Long Li
2024-04-18 16:52 ` Konstantin Taranov [this message]
2024-04-23 23:34 ` [PATCH rdma-next 3/6] RDMA/mana_ib: replace duplicate cqe with buf_size Long Li
2024-04-24 8:43 ` Konstantin Taranov
2024-04-25 20:17 ` Long Li
2024-04-18 16:52 ` [PATCH rdma-next 4/6] RDMA/mana_ib: introduce a helper to remove cq callbacks Konstantin Taranov
2024-04-23 23:42 ` Long Li
2024-04-24 8:50 ` Konstantin Taranov
2024-04-25 20:29 ` Long Li
2024-04-18 16:52 ` [PATCH rdma-next 5/6] RDMA/mana_ib: boundary check before installing " Konstantin Taranov
2024-04-23 23:45 ` Long Li
2024-04-24 8:58 ` Konstantin Taranov
2024-04-25 20:31 ` Long Li
2024-04-18 16:52 ` [PATCH rdma-next 6/6] RDMA/mana_ib: implement uapi for creation of rnic cq Konstantin Taranov
2024-04-23 23:57 ` Long Li
2024-04-30 12:37 ` Leon Romanovsky
2024-04-30 12:57 ` Jason Gunthorpe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1713459125-14914-4-git-send-email-kotaranov@linux.microsoft.com \
--to=kotaranov@linux.microsoft.com \
--cc=jgg@ziepe.ca \
--cc=kotaranov@microsoft.com \
--cc=leon@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=longli@microsoft.com \
--cc=sharmaajay@microsoft.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox