aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Marchand <david.marchand@6wind.com>2017-02-24 09:38:26 -0500
committerDoug Ledford <dledford@redhat.com>2017-03-24 22:07:27 -0400
commit9fcd67d1772c43d2f23e8fca56acc7219e991676 (patch)
tree0eb856931b5b5655ae23e21087a12fe826a62f88
parent812755d69efcf7c12fded57983d456647a0bbadd (diff)
IB/rxe: increment msn only when completing a request
According to C9-147, MSN should only be incremented when the last packet of a multi packet request has been received. "Logically, the requester associates a sequential Send Sequence Number (SSN) with each WQE posted to the send queue. The SSN bears a one- to-one relationship to the MSN returned by the responder in each re- sponse packet. Therefore, when the requester receives a response, it in- terprets the MSN as representing the SSN of the most recent request completed by the responder to determine which send WQE(s) can be completed." Fixes: 8700e3e7c485 ("Soft RoCE driver") Signed-off-by: David Marchand <david.marchand@6wind.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
-rw-r--r--drivers/infiniband/sw/rxe/rxe_resp.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/infiniband/sw/rxe/rxe_resp.c b/drivers/infiniband/sw/rxe/rxe_resp.c
index d404a8aba7af..c9dd385ce62e 100644
--- a/drivers/infiniband/sw/rxe/rxe_resp.c
+++ b/drivers/infiniband/sw/rxe/rxe_resp.c
@@ -813,18 +813,17 @@ static enum resp_states execute(struct rxe_qp *qp, struct rxe_pkt_info *pkt)
813 WARN_ON_ONCE(1); 813 WARN_ON_ONCE(1);
814 } 814 }
815 815
816 /* We successfully processed this new request. */
817 qp->resp.msn++;
818
819 /* next expected psn, read handles this separately */ 816 /* next expected psn, read handles this separately */
820 qp->resp.psn = (pkt->psn + 1) & BTH_PSN_MASK; 817 qp->resp.psn = (pkt->psn + 1) & BTH_PSN_MASK;
821 818
822 qp->resp.opcode = pkt->opcode; 819 qp->resp.opcode = pkt->opcode;
823 qp->resp.status = IB_WC_SUCCESS; 820 qp->resp.status = IB_WC_SUCCESS;
824 821
825 if (pkt->mask & RXE_COMP_MASK) 822 if (pkt->mask & RXE_COMP_MASK) {
823 /* We successfully processed this new request. */
824 qp->resp.msn++;
826 return RESPST_COMPLETE; 825 return RESPST_COMPLETE;
827 else if (qp_type(qp) == IB_QPT_RC) 826 } else if (qp_type(qp) == IB_QPT_RC)
828 return RESPST_ACKNOWLEDGE; 827 return RESPST_ACKNOWLEDGE;
829 else 828 else
830 return RESPST_CLEANUP; 829 return RESPST_CLEANUP;