[PATCH rdma-core] providers/i40iw: Return correct value for max_send_wr and max_recv_wr

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: "Sindhu, Devale" <sindhu.devale@xxxxxxxxx>

The max_send_wr and max_recv_wr attributes returned in create QP do not
account for the internally reserved quantas (minimum sized WQE) used in
sizing the WQ. Thus the values reported exceed what can actually be fit
in the WQ.

Fix this accounting for the reserve quantas when returning
max_send_wr/max_recv_wr.

Reported-by: Stefan Assmann <sassmann@xxxxxxxxxx>
Signed-off-by: Sindhu, Devale <sindhu.devale@xxxxxxxxx>
Reviewed-by: Shiraz, Saleem <shiraz.saleem@xxxxxxxxx>
Signed-off-by: Tatyana Nikolova <tatyana.e.nikolova@xxxxxxxxx>
---
 providers/i40iw/i40iw_uverbs.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/providers/i40iw/i40iw_uverbs.c b/providers/i40iw/i40iw_uverbs.c
index 9d407c76..63b7206a 100644
--- a/providers/i40iw/i40iw_uverbs.c
+++ b/providers/i40iw/i40iw_uverbs.c
@@ -689,8 +689,11 @@ struct ibv_qp *i40iw_ucreate_qp(struct ibv_pd *pd, struct ibv_qp_init_attr *attr
 	info.max_rq_frag_cnt = attr->cap.max_recv_sge;
 	info.max_inline_data = attr->cap.max_inline_data;
 
-	if (!iwvctx->dev.ops_uk.iwarp_qp_uk_init(&iwuqp->qp, &info))
+	if (!iwvctx->dev.ops_uk.iwarp_qp_uk_init(&iwuqp->qp, &info)) {
+		attr->cap.max_send_wr = (sqdepth - I40IW_SQ_RSVD) >> sqshift;
+		attr->cap.max_recv_wr = (rqdepth - I40IW_RQ_RSVD) >> rqshift;
 		return &iwuqp->ibv_qp;
+	}
 
 	i40iw_destroy_vmapped_qp(iwuqp, info.sq);
 err_free_rq_wrid:
-- 
2.14.2




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux