diff mbox series

[for-next,v3,03/13] RDMA/rxe: Simplify reset state handling in rxe_resp.c

Message ID 20221029031009.64467-4-rpearsonhpe@gmail.com (mailing list archive)
State Changes Requested
Delegated to: Jason Gunthorpe
Headers show
Series Implement work queues for rdma_rxe | expand

Commit Message

Bob Pearson Oct. 29, 2022, 3:10 a.m. UTC
Make rxe_responder() more like rxe_completer() and take qp reset
handling out of the state machine.

Signed-off-by: Ian Ziemba <ian.ziemba@hpe.com>
Signed-off-by: Bob Pearson <rpearsonhpe@gmail.com>
---
 drivers/infiniband/sw/rxe/rxe_resp.c | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)

Comments

Zhu Yanjun Nov. 11, 2022, 3:04 a.m. UTC | #1
在 2022/10/29 11:10, Bob Pearson 写道:
> Make rxe_responder() more like rxe_completer() and take qp reset
> handling out of the state machine.

 From RDMA spec, qp reset is part of qp states. If qp reset is moved out 
of the state machine. And other devices still take qp reset in the state 
machine. Will this make difference on the connection between rxe and 
other ib devices, such as irdma, mlx devices.

You know, rxe should make basic connections with other ib devices.

Zhu Yanjun

> 
> Signed-off-by: Ian Ziemba <ian.ziemba@hpe.com>
> Signed-off-by: Bob Pearson <rpearsonhpe@gmail.com>
> ---
>   drivers/infiniband/sw/rxe/rxe_resp.c | 12 +++---------
>   1 file changed, 3 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/infiniband/sw/rxe/rxe_resp.c b/drivers/infiniband/sw/rxe/rxe_resp.c
> index c32bc12cc82f..c4f365449aa5 100644
> --- a/drivers/infiniband/sw/rxe/rxe_resp.c
> +++ b/drivers/infiniband/sw/rxe/rxe_resp.c
> @@ -40,7 +40,6 @@ enum resp_states {
>   	RESPST_ERR_LENGTH,
>   	RESPST_ERR_CQ_OVERFLOW,
>   	RESPST_ERROR,
> -	RESPST_RESET,
>   	RESPST_DONE,
>   	RESPST_EXIT,
>   };
> @@ -75,7 +74,6 @@ static char *resp_state_name[] = {
>   	[RESPST_ERR_LENGTH]			= "ERR_LENGTH",
>   	[RESPST_ERR_CQ_OVERFLOW]		= "ERR_CQ_OVERFLOW",
>   	[RESPST_ERROR]				= "ERROR",
> -	[RESPST_RESET]				= "RESET",
>   	[RESPST_DONE]				= "DONE",
>   	[RESPST_EXIT]				= "EXIT",
>   };
> @@ -1281,8 +1279,9 @@ int rxe_responder(void *arg)
>   
>   	switch (qp->resp.state) {
>   	case QP_STATE_RESET:
> -		state = RESPST_RESET;
> -		break;
> +		rxe_drain_req_pkts(qp, false);
> +		qp->resp.wqe = NULL;
> +		goto exit;
>   
>   	default:
>   		state = RESPST_GET_REQ;
> @@ -1441,11 +1440,6 @@ int rxe_responder(void *arg)
>   
>   			goto exit;
>   
> -		case RESPST_RESET:
> -			rxe_drain_req_pkts(qp, false);
> -			qp->resp.wqe = NULL;
> -			goto exit;
> -
>   		case RESPST_ERROR:
>   			qp->resp.goto_error = 0;
>   			pr_debug("qp#%d moved to error state\n", qp_num(qp));
diff mbox series

Patch

diff --git a/drivers/infiniband/sw/rxe/rxe_resp.c b/drivers/infiniband/sw/rxe/rxe_resp.c
index c32bc12cc82f..c4f365449aa5 100644
--- a/drivers/infiniband/sw/rxe/rxe_resp.c
+++ b/drivers/infiniband/sw/rxe/rxe_resp.c
@@ -40,7 +40,6 @@  enum resp_states {
 	RESPST_ERR_LENGTH,
 	RESPST_ERR_CQ_OVERFLOW,
 	RESPST_ERROR,
-	RESPST_RESET,
 	RESPST_DONE,
 	RESPST_EXIT,
 };
@@ -75,7 +74,6 @@  static char *resp_state_name[] = {
 	[RESPST_ERR_LENGTH]			= "ERR_LENGTH",
 	[RESPST_ERR_CQ_OVERFLOW]		= "ERR_CQ_OVERFLOW",
 	[RESPST_ERROR]				= "ERROR",
-	[RESPST_RESET]				= "RESET",
 	[RESPST_DONE]				= "DONE",
 	[RESPST_EXIT]				= "EXIT",
 };
@@ -1281,8 +1279,9 @@  int rxe_responder(void *arg)
 
 	switch (qp->resp.state) {
 	case QP_STATE_RESET:
-		state = RESPST_RESET;
-		break;
+		rxe_drain_req_pkts(qp, false);
+		qp->resp.wqe = NULL;
+		goto exit;
 
 	default:
 		state = RESPST_GET_REQ;
@@ -1441,11 +1440,6 @@  int rxe_responder(void *arg)
 
 			goto exit;
 
-		case RESPST_RESET:
-			rxe_drain_req_pkts(qp, false);
-			qp->resp.wqe = NULL;
-			goto exit;
-
 		case RESPST_ERROR:
 			qp->resp.goto_error = 0;
 			pr_debug("qp#%d moved to error state\n", qp_num(qp));