Commit b1377cc3 authored by Xiao Yang's avatar Xiao Yang Committed by Jason Gunthorpe

RDMA/rxe: Check the last packet by RXE_END_MASK

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: 9fcd67d1 ("IB/rxe: increment msn only when completing a request")
Fixes: 8700e3e7 ("Soft RoCE driver")
Link: https://lore.kernel.org/r/20211229034438.1854908-1-yangx.jy@fujitsu.comSigned-off-by: default avatarXiao Yang <yangx.jy@fujitsu.com>
Signed-off-by: default avatarJason Gunthorpe <jgg@nvidia.com>
parent 0d9c0011
...@@ -814,6 +814,10 @@ static enum resp_states execute(struct rxe_qp *qp, struct rxe_pkt_info *pkt) ...@@ -814,6 +814,10 @@ static enum resp_states execute(struct rxe_qp *qp, struct rxe_pkt_info *pkt)
return RESPST_ERR_INVALIDATE_RKEY; 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 */ /* next expected psn, read handles this separately */
qp->resp.psn = (pkt->psn + 1) & BTH_PSN_MASK; qp->resp.psn = (pkt->psn + 1) & BTH_PSN_MASK;
qp->resp.ack_psn = qp->resp.psn; 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) ...@@ -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.opcode = pkt->opcode;
qp->resp.status = IB_WC_SUCCESS; qp->resp.status = IB_WC_SUCCESS;
if (pkt->mask & RXE_COMP_MASK) { if (pkt->mask & RXE_COMP_MASK)
/* We successfully processed this new request. */
qp->resp.msn++;
return RESPST_COMPLETE; return RESPST_COMPLETE;
} else if (qp_type(qp) == IB_QPT_RC) else if (qp_type(qp) == IB_QPT_RC)
return RESPST_ACKNOWLEDGE; return RESPST_ACKNOWLEDGE;
else else
return RESPST_CLEANUP; return RESPST_CLEANUP;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment