Skip to contentSkip to conversation

RDMA/iw_cxgb4: Fix incorrect function parameters

PATCH In review Potnuri Bharat Teja 2 participants 3 messages May 10, 2020 – May 11, 2020

Subsystems (2)
lore
Share & tools
lore

Potnuri Bharat Teja

author maintainer
#0 lore raw

PATCH 1/1 RDMA/iw_cxgb4: Fix incorrect function parameters

Fixes the incorrect function parameters passed while reading TCB fields and completing cached SRQ buffers.

Fixes 11a27e2121a5 ("iw_cxgb4: complete the cached SRQ buffers")
---
 drivers/infiniband/hw/cxgb4/cm.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
drivers/infiniband/hw/cxgb4/cm.c +3 -4
index d69dece3b1d5..30e08bcc9afb 100644
@@ -2891,8 +2891,7 @@ static int peer_abort(struct c4iw_dev *dev, struct sk_buff *skb)
 			srqidx = ABORT_RSS_SRQIDX_G(
 					be32_to_cpu(req->srqidx_status));
 			if (srqidx) {
-				complete_cached_srq_buffers(ep,
-							    req->srqidx_status);
+				complete_cached_srq_buffers(ep, srqidx);
 			} else {
 				/* Hold ep ref until finish_peer_abort() */
 				c4iw_get_ep(&ep->com);
@@ -3878,8 +3877,8 @@ static int read_tcb_rpl(struct c4iw_dev *dev, struct sk_buff *skb)
 		return 0;
 	}
 
-	ep->srqe_idx = t4_tcb_get_field32(tcb, TCB_RQ_START_W, TCB_RQ_START_W,
-			TCB_RQ_START_S);
+	ep->srqe_idx = t4_tcb_get_field32(tcb, TCB_RQ_START_W, TCB_RQ_START_M,
+					  TCB_RQ_START_S);
 cleanup:
 	pr_debug("ep %p tid %u %016x\n", ep, ep->hwtid, ep->srqe_idx);
 
Signature · 1 line
2.24.0
#1 lore raw
Quoted 2 lines · Potnuri Bharat Teja

Fixes the incorrect function parameters passed while reading TCB fields and completing cached SRQ buffers.

For a -rc fix you must explain what bad thing happens because of the bug

Jason

author maintainer
#2 lore raw
Quoted 7 lines · Jason Gunthorpe
Quoted 2 lines · Potnuri Bharat Teja

Fixes the incorrect function parameters passed while reading TCB fields and completing cached SRQ buffers.

For a -rc fix you must explain what bad thing happens because of the bug

My bad. This patch fixes app segfults during connection teardown when SRQ is used. Resending patch wit updated description.