diff mbox series

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

Message ID 20200312165032.11644-1-tigerinxm@gmail.com (mailing list archive)
State Changes Requested
Headers show
Series RDMA/rxe: Advance req.wqe_index when rxe_requester meets error | expand

Commit Message

huangqingxin March 12, 2020, 4:50 p.m. UTC
From: huangqingxin <huangqingxin@ruijie.com.cn>

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.

Signed-off-by: huangqingxin <huangqingxin@ruijie.com.cn>
---
 drivers/infiniband/sw/rxe/rxe_req.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Zhu Yanjun March 14, 2020, 12:54 p.m. UTC | #1
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

On 3/13/2020 12:50 AM, huangqingxin wrote:
> From: huangqingxin <huangqingxin@ruijie.com.cn>
>
> 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.
>
> Signed-off-by: huangqingxin <huangqingxin@ruijie.com.cn>
> ---
>   drivers/infiniband/sw/rxe/rxe_req.c | 1 +
>   1 file changed, 1 insertion(+)
>
> diff --git a/drivers/infiniband/sw/rxe/rxe_req.c b/drivers/infiniband/sw/rxe/rxe_req.c
> index e5031172c..08f4bea06 100644
> --- a/drivers/infiniband/sw/rxe/rxe_req.c
> +++ b/drivers/infiniband/sw/rxe/rxe_req.c
> @@ -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:
diff mbox series

Patch

diff --git a/drivers/infiniband/sw/rxe/rxe_req.c b/drivers/infiniband/sw/rxe/rxe_req.c
index e5031172c..08f4bea06 100644
--- a/drivers/infiniband/sw/rxe/rxe_req.c
+++ b/drivers/infiniband/sw/rxe/rxe_req.c
@@ -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: