diff mbox series

Subject: [PATCH for-next] RDMA/rxe: Fix "Soft RoCE Driver"

Message ID 20220416063312.7777-1-rpearsonhpe@gmail.com (mailing list archive)
State Superseded
Headers show
Series Subject: [PATCH for-next] RDMA/rxe: Fix "Soft RoCE Driver" | expand

Commit Message

Bob Pearson April 16, 2022, 6:33 a.m. UTC
The rping benchmark fails on long runs. The root cause of this
failure has been traced to a failure to compute a nonzero value of mr
in rare situations.

Fix this failure by correctly handling the computation of mr in
read_reply() in rxe_resp.c in the replay flow.

Fixes: 8700e3e7c485 ("Soft RoCE driver")
Signed-off-by: Bob Pearson <rpearsonhpe@gmail.com>
---
 drivers/infiniband/sw/rxe/rxe_resp.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)


base-commit: 98c8026331ceabe1df579940b81eec75eb49cdd9

Comments

Zhu Yanjun April 16, 2022, 10:03 a.m. UTC | #1
在 2022/4/16 14:33, Bob Pearson 写道:
> The rping benchmark fails on long runs. The root cause of this
> failure has been traced to a failure to compute a nonzero value of mr
> in rare situations.
> 
> Fix this failure by correctly handling the computation of mr in
> read_reply() in rxe_resp.c in the replay flow.
> 
> Fixes: 8700e3e7c485 ("Soft RoCE driver")

Fixes should be 8a1a0be894da ("RDMA/rxe: Replace mr by rkey in responder 
resources")


> Signed-off-by: Bob Pearson <rpearsonhpe@gmail.com>
> ---
>   drivers/infiniband/sw/rxe/rxe_resp.c | 10 ++++++++--
>   1 file changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/infiniband/sw/rxe/rxe_resp.c b/drivers/infiniband/sw/rxe/rxe_resp.c
> index e2653a8721fe..2e627685e804 100644
> --- a/drivers/infiniband/sw/rxe/rxe_resp.c
> +++ b/drivers/infiniband/sw/rxe/rxe_resp.c
> @@ -734,8 +734,14 @@ static enum resp_states read_reply(struct rxe_qp *qp,
>   	}
>   
>   	if (res->state == rdatm_res_state_new) {
> -		mr = qp->resp.mr;
> -		qp->resp.mr = NULL;
> +		if (!res->replay) {
> +			mr = qp->resp.mr;
> +			qp->resp.mr = NULL;
> +		} else {
> +			mr = rxe_recheck_mr(qp, res->read.rkey);
> +			if (!mr)
> +				return RESPST_ERR_RKEY_VIOLATION;
> +		}
>   
>   		if (res->read.resid <= mtu)
>   			opcode = IB_OPCODE_RC_RDMA_READ_RESPONSE_ONLY;
> 
> base-commit: 98c8026331ceabe1df579940b81eec75eb49cdd9
Bob Pearson April 16, 2022, 3:20 p.m. UTC | #2
Agreed.
diff mbox series

Patch

diff --git a/drivers/infiniband/sw/rxe/rxe_resp.c b/drivers/infiniband/sw/rxe/rxe_resp.c
index e2653a8721fe..2e627685e804 100644
--- a/drivers/infiniband/sw/rxe/rxe_resp.c
+++ b/drivers/infiniband/sw/rxe/rxe_resp.c
@@ -734,8 +734,14 @@  static enum resp_states read_reply(struct rxe_qp *qp,
 	}
 
 	if (res->state == rdatm_res_state_new) {
-		mr = qp->resp.mr;
-		qp->resp.mr = NULL;
+		if (!res->replay) {
+			mr = qp->resp.mr;
+			qp->resp.mr = NULL;
+		} else {
+			mr = rxe_recheck_mr(qp, res->read.rkey);
+			if (!mr)
+				return RESPST_ERR_RKEY_VIOLATION;
+		}
 
 		if (res->read.resid <= mtu)
 			opcode = IB_OPCODE_RC_RDMA_READ_RESPONSE_ONLY;