netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] IB/rxe: increment msn only when completing a request
@ 2017-02-24 14:38 David Marchand
  2017-03-25  2:07 ` Doug Ledford
  0 siblings, 1 reply; 2+ messages in thread
From: David Marchand @ 2017-02-24 14:38 UTC (permalink / raw)
  To: monis; +Cc: linux-rdma, netdev

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>
---
 drivers/infiniband/sw/rxe/rxe_resp.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/infiniband/sw/rxe/rxe_resp.c b/drivers/infiniband/sw/rxe/rxe_resp.c
index 5bcf073..193d95c 100644
--- a/drivers/infiniband/sw/rxe/rxe_resp.c
+++ b/drivers/infiniband/sw/rxe/rxe_resp.c
@@ -812,18 +812,18 @@ static enum resp_states execute(struct rxe_qp *qp, struct rxe_pkt_info *pkt)
 		/* Unreachable */
 		WARN_ON(1);
 
-	/* 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.opcode = pkt->opcode;
 	qp->resp.status = IB_WC_SUCCESS;
 
-	if (pkt->mask & RXE_COMP_MASK)
+	if (pkt->mask & RXE_COMP_MASK) {
+		/* We successfully processed this new request. See C9-147. */
+		qp->resp.msn++;
+
 		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.7.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] IB/rxe: increment msn only when completing a request
  2017-02-24 14:38 [PATCH] IB/rxe: increment msn only when completing a request David Marchand
@ 2017-03-25  2:07 ` Doug Ledford
  0 siblings, 0 replies; 2+ messages in thread
From: Doug Ledford @ 2017-03-25  2:07 UTC (permalink / raw)
  To: David Marchand, monis; +Cc: linux-rdma, netdev

On Fri, 2017-02-24 at 15:38 +0100, David Marchand wrote:
> 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>

Thanks, applied.

-- 
Doug Ledford <dledford@redhat.com>
    GPG KeyID: B826A3330E572FDD
   
Key fingerprint = AE6B 1BDA 122B 23B4 265B  1274 B826 A333 0E57 2FDD

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-03-25  2:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-24 14:38 [PATCH] IB/rxe: increment msn only when completing a request David Marchand
2017-03-25  2:07 ` Doug Ledford

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).