Skip to contentSkip to conversation

RDMA/qedr: Fix reporting max_{send/recv}_wr attrs

PATCH Applied Kamal Heib 4 participants 5 messages Dec 6, 2021 – Dec 7, 2021

Subsystems (2)
lore
Share & tools
lore

Kamal Heib

author
#0 lore raw

PATCH 1/1 RDMA/qedr: Fix reporting max_{send/recv}_wr attrs

Fix the wrongly reported max_send_wr and max_recv_wr attributes for user QP by making sure to save their valuse on QP creation, so when query QP is called the attributes will be reported correctly.

---
 drivers/infiniband/hw/qedr/verbs.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/infiniband/hw/qedr/verbs.c +2 -0
index 9100009f0a23..a53476653b0d 100644
@@ -1931,6 +1931,7 @@ static int qedr_create_user_qp(struct qedr_dev *dev,
 	/* db offset was calculated in copy_qp_uresp, now set in the user q */
 	if (qedr_qp_has_sq(qp)) {
 		qp->usq.db_addr = ctx->dpi_addr + uresp.sq_db_offset;
+		qp->sq.max_wr = attrs->cap.max_send_wr;
 		rc = qedr_db_recovery_add(dev, qp->usq.db_addr,
 					  &qp->usq.db_rec_data->db_data,
 					  DB_REC_WIDTH_32B,
@@ -1941,6 +1942,7 @@ static int qedr_create_user_qp(struct qedr_dev *dev,
 
 	if (qedr_qp_has_rq(qp)) {
 		qp->urq.db_addr = ctx->dpi_addr + uresp.rq_db_offset;
+		qp->rq.max_wr = attrs->cap.max_recv_wr;
 		rc = qedr_db_recovery_add(dev, qp->urq.db_addr,
 					  &qp->urq.db_rec_data->db_data,
 					  DB_REC_WIDTH_32B,
Signature · 1 line
2.31.1
#1 lore raw
Quoted 8 lines · Kamal Heib

Fix the wrongly reported max_send_wr and max_recv_wr attributes for user QP by making sure to save their valuse on QP creation, so when query QP is called the attributes will be reported correctly.

---
 drivers/infiniband/hw/qedr/verbs.c | 2 ++
 1 file changed, 2 insertions(+)

Fixes line?

Jason

author
#2 lore raw
Quoted 5 lines · Jason Gunthorpe
Quoted 4 lines · Kamal Heib

Fix the wrongly reported max_send_wr and max_recv_wr attributes for user QP by making sure to save their valuse on QP creation, so when query QP is called the attributes will be reported correctly.

Quoted 8 lines
Quoted 4 lines
---
 drivers/infiniband/hw/qedr/verbs.c | 2 ++
 1 file changed, 2 insertions(+)

Fixes line?

Jason

Fixes cecbcddf6461 ("qedr: Add support for QP verbs")

Thanks,
Kamal

maintainer Acked-by on v1 1/1
#3 lore raw
In reply to Kamal Heib
Quoted 35 lines

From: Kamal Heib <[email protected]>
Sent: Monday, December 6, 2021 10:13 PM

Fix the wrongly reported max_send_wr and max_recv_wr attributes for user QP by making sure to save their valuse on QP creation, so when query QP is called the attributes will be reported correctly.

---
 drivers/infiniband/hw/qedr/verbs.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/infiniband/hw/qedr/verbs.c +1 -0
index 9100009f0a23..a53476653b0d 100644
@@ -1931,6 +1931,7 @@ static int qedr_create_user_qp(struct qedr_dev
 *dev,
 	/* db offset was calculated in copy_qp_uresp, now set in the user q
 */
 	if (qedr_qp_has_sq(qp)) {
 		qp->usq.db_addr = ctx->dpi_addr + uresp.sq_db_offset;
+		qp->sq.max_wr = attrs->cap.max_send_wr;
 		rc = qedr_db_recovery_add(dev, qp->usq.db_addr,
drivers/infiniband/hw/qedr/verbs.c +1 -0
 					  &qp->usq.db_rec_data->db_data,
 					  DB_REC_WIDTH_32B,
@@ -1941,6 +1942,7 @@ static int qedr_create_user_qp(struct qedr_dev
 *dev,
 
 	if (qedr_qp_has_rq(qp)) {
 		qp->urq.db_addr = ctx->dpi_addr + uresp.rq_db_offset;
+		qp->rq.max_wr = attrs->cap.max_recv_wr;
 		rc = qedr_db_recovery_add(dev, qp->urq.db_addr,
 					  &qp->urq.db_rec_data->db_data,
Quoted 3 lines

DB_REC_WIDTH_32B,
--
2.31.1

Thanks,

maintainer Applied
#4 lore raw
In reply to Kamal Heib
Quoted 9 lines · Kamal Heib

Fix the wrongly reported max_send_wr and max_recv_wr attributes for user QP by making sure to save their valuse on QP creation, so when query QP is called the attributes will be reported correctly.

---
 drivers/infiniband/hw/qedr/verbs.c | 2 ++
 1 file changed, 2 insertions(+)

Applied to for-next, thanks

Jason