Skip to content

Commit

Permalink
RDMA/rxe: Check the last packet by RXE_END_MASK
Browse files Browse the repository at this point in the history
[ Upstream commit b1377cc ]

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: 9fcd67d ("IB/rxe: increment msn only when completing a request")
Fixes: 8700e3e ("Soft RoCE driver")
Link: https://lore.kernel.org/r/20211229034438.1854908-1-yangx.jy@fujitsu.com
Signed-off-by: Xiao Yang <yangx.jy@fujitsu.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
yangx-jy authored and gregkh committed Apr 8, 2022
1 parent 1a0e004 commit 0765552
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions drivers/infiniband/sw/rxe/rxe_resp.c
Expand Up @@ -814,18 +814,20 @@ 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;

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;
Expand Down

0 comments on commit 0765552

Please sign in to comment.