Re: [PATCH] RDMA/rxe: Check the last packet by RXE_END_MASK

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Dec 29, 2021 at 11:44:38AM +0800, Xiao Yang wrote:
> It's wrong to check the last packet by RXE_COMP_MASK because the flag
> is to indicate if responder needs to generate a completion.
> 
> Fixes: 9fcd67d1772c ("IB/rxe: increment msn only when completing a request")
> Fixes: 8700e3e7c485 ("Soft RoCE driver")
> Signed-off-by: Xiao Yang <yangx.jy@xxxxxxxxxxx>
> ---
>  drivers/infiniband/sw/rxe/rxe_resp.c | 10 ++++++----
>  1 file changed, 6 insertions(+), 4 deletions(-)

Bob/Zhu is this OK?

> diff --git a/drivers/infiniband/sw/rxe/rxe_resp.c b/drivers/infiniband/sw/rxe/rxe_resp.c
> index e8f435fa6e4d..380934e38923 100644
> --- a/drivers/infiniband/sw/rxe/rxe_resp.c
> +++ b/drivers/infiniband/sw/rxe/rxe_resp.c
> @@ -814,6 +814,10 @@ static enum resp_states execute(struct rxe_qp *qp, struct rxe_pkt_info *pkt)
>  			return RESPST_ERR_INVALIDATE_RKEY;
>  	}
>  
> +	if (pkt->mask & RXE_END_MASK)
> +		/* We successfully processed this new request. */
> +		qp->resp.msn++;
> +
>  	/* next expected psn, read handles this separately */
>  	qp->resp.psn = (pkt->psn + 1) & BTH_PSN_MASK;
>  	qp->resp.ack_psn = qp->resp.psn;
> @@ -821,11 +825,9 @@ static enum resp_states execute(struct rxe_qp *qp, struct rxe_pkt_info *pkt)
>  	qp->resp.opcode = pkt->opcode;
>  	qp->resp.status = IB_WC_SUCCESS;
>  
> -	if (pkt->mask & RXE_COMP_MASK) {
> -		/* We successfully processed this new request. */
> -		qp->resp.msn++;
> +	if (pkt->mask & RXE_COMP_MASK)
>  		return RESPST_COMPLETE;
> -	} else if (qp_type(qp) == IB_QPT_RC)
> +	else if (qp_type(qp) == IB_QPT_RC)
>  		return RESPST_ACKNOWLEDGE;
>  	else
>  		return RESPST_CLEANUP;
> -- 
> 2.25.1
> 
> 
> 



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux