Skip to content

Commit ca95f80

Browse files
kwan-intcjgunthorpe
authored andcommitted
IB/hfi1: Unreserve a reserved request when it is completed
Currently, When a reserved operation is completed, its entry in the send queue will not be unreserved, which leads to the miscalculation of qp->s_avail and thus the triggering of a WARN_ON call trace. This patch fixes the problem by unreserving the reserved operation when it is completed. Fixes: 856cc4c ("IB/hfi1: Add the capability for reserved operations") Reviewed-by: Mike Marciniszyn <[email protected]> Signed-off-by: Kaike Wan <[email protected]> Signed-off-by: Dennis Dalessandro <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
1 parent ff8b67f commit ca95f80

File tree

1 file changed

+2
-0
lines changed
  • drivers/infiniband/hw/hfi1

1 file changed

+2
-0
lines changed

drivers/infiniband/hw/hfi1/rc.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1157,6 +1157,7 @@ void hfi1_rc_send_complete(struct rvt_qp *qp, struct hfi1_opa_header *opah)
11571157
if (cmp_psn(wqe->lpsn, qp->s_sending_psn) >= 0 &&
11581158
cmp_psn(qp->s_sending_psn, qp->s_sending_hpsn) <= 0)
11591159
break;
1160+
rvt_qp_wqe_unreserve(qp, wqe);
11601161
s_last = qp->s_last;
11611162
trace_hfi1_qp_send_completion(qp, wqe, s_last);
11621163
if (++s_last >= qp->s_size)
@@ -1209,6 +1210,7 @@ static struct rvt_swqe *do_rc_completion(struct rvt_qp *qp,
12091210
u32 s_last;
12101211

12111212
rvt_put_swqe(wqe);
1213+
rvt_qp_wqe_unreserve(qp, wqe);
12121214
s_last = qp->s_last;
12131215
trace_hfi1_qp_send_completion(qp, wqe, s_last);
12141216
if (++s_last >= qp->s_size)

0 commit comments

Comments
 (0)