Skip to contentSkip to conversation

RDMA/rxe: Advance req.wqe_index when rxe_requester meets error

PATCH In review huangqingxin 2 participants 2 messages Mar 12, 2020 – Mar 15, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 RDMA/rxe: Advance req.wqe_index when rxe_requester meets error

From: huangqingxin <[email protected]>

In the rxe_requester, we may fail to xmit packet for missing GID entry. We should also advance req.wqe_index too.Otherwise, we won't be able to get the new next wqe, and completer would consume the wrong wqe.

---
 drivers/infiniband/sw/rxe/rxe_req.c | 1 +
 1 file changed, 1 insertion(+)
drivers/infiniband/sw/rxe/rxe_req.c +1 -0
index e5031172c..08f4bea06 100644
@@ -756,6 +756,7 @@ int rxe_requester(void *arg)
 err:
 	wqe->status = IB_WC_LOC_PROT_ERR;
 	wqe->state = wqe_state_error;
+	qp->req.wqe_index = next_index(qp->sq.queue, qp->req.wqe_index);
 	__rxe_do_task(&qp->comp.task);
 
 exit:
Signature · 1 line
2.17.1
#1 lore raw

When an application wants to move data over, it tells this to the RDMA NIC that translates work request (WR) into work queues (WQ). This is done by placing instructions into the respective send or receive queues telling the rNIC what memory buffers form the registered region it wants to send or receive. Those instructions are called Work Queue Elements (WQE).

A WQE contains a pointer to the memory buffer. When it’s a send queue it points to data to be sent over to the other side. In the case of a receive
queue, it points to the memory buffer where the data will be written to.

To this commit, rxe skb allocation failed. req.wqe_index should not be advanced.
Please do something in other places.

Zhu Yanjun

Quoted 23 lines · huangqingxin

From: huangqingxin <[email protected]>

In the rxe_requester, we may fail to xmit packet for missing GID entry. We should also advance req.wqe_index too.Otherwise, we won't be able to get the new next wqe, and completer would consume the wrong wqe.

---
  drivers/infiniband/sw/rxe/rxe_req.c | 1 +
  1 file changed, 1 insertion(+)
drivers/infiniband/sw/rxe/rxe_req.c +1 -0
index e5031172c..08f4bea06 100644
@@ -756,6 +756,7 @@ int rxe_requester(void *arg)
  err:
  	wqe->status = IB_WC_LOC_PROT_ERR;
  	wqe->state = wqe_state_error;
+	qp->req.wqe_index = next_index(qp->sq.queue, qp->req.wqe_index);
  	__rxe_do_task(&qp->comp.task);
 
  exit: