diff mbox series

[2/3] RDMA/rxe: Update wqe_index for each wqe error completion

Message ID 20220412022903.574238-2-lizhijian@fujitsu.com (mailing list archive)
State Superseded
Headers show
Series [1/3] RDMA/rxe: Remove useless parameters for update_state() | expand

Commit Message

Li Zhijian April 12, 2022, 2:29 a.m. UTC
Previously, if user space keep sending abnormal wqe, qeueu.prod will
keep increasing while queue.index doesn't. Once
queue.index==qeueu.prod in next round, req_next_wqe() will treat queue
is empty. In such case, no new completion would be generated.

Update wqe_index for each wqe completion so that
req_next_wqe() can get next wqe properly.

Signed-off-by: Li Zhijian <lizhijian@fujitsu.com>
---
 drivers/infiniband/sw/rxe/rxe_req.c | 2 ++
 1 file changed, 2 insertions(+)
diff mbox series

Patch

diff --git a/drivers/infiniband/sw/rxe/rxe_req.c b/drivers/infiniband/sw/rxe/rxe_req.c
index bf7493bab9b9..c369bebaf02e 100644
--- a/drivers/infiniband/sw/rxe/rxe_req.c
+++ b/drivers/infiniband/sw/rxe/rxe_req.c
@@ -760,6 +760,8 @@  int rxe_requester(void *arg)
 	if (ah)
 		rxe_put(ah);
 err:
+	/* update wqe_index for each wqe completion */
+	qp->req.wqe_index = queue_next_index(qp->sq.queue, qp->req.wqe_index);
 	wqe->state = wqe_state_error;
 	__rxe_do_task(&qp->comp.task);