diff mbox

[1/5] IB/srpt: Post receive work requests after qp transition to INIT state

Message ID 20171103232056.30614-2-bart.vanassche@wdc.com (mailing list archive)
State Accepted
Headers show

Commit Message

Bart Van Assche Nov. 3, 2017, 11:20 p.m. UTC
From: Mike Marciniszyn <mike.marciniszyn@intel.com>

Not all HCAs support posting receive work requests in the RESET
state. Postpone posting receive work requests until after the
transition to the INIT state.

Fixes: commit dea262094cdf ("IB/srpt: Change default behavior from using SRQ to using RC")
Signed-off-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
---
 drivers/infiniband/ulp/srpt/ib_srpt.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Comments

Jason Gunthorpe Nov. 6, 2017, 5:15 p.m. UTC | #1
On Fri, Nov 03, 2017 at 04:20:52PM -0700, Bart Van Assche wrote:
> From: Mike Marciniszyn <mike.marciniszyn@intel.com>
> 
> Not all HCAs support posting receive work requests in the RESET
> state. Postpone posting receive work requests until after the
> transition to the INIT state.

IBA spec even says submitting a WR to a RESET QP is an error.

Jason
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Marciniszyn, Mike Nov. 6, 2017, 5:28 p.m. UTC | #2
> > Not all HCAs support posting receive work requests in the RESET
> > state. Postpone posting receive work requests until after the
> > transition to the INIT state.
> 
> IBA spec even says submitting a WR to a RESET QP is an error.
> 

C10-97.2.1: If the QP is not associated with an SRQ, the QP shall process Work Requests submitted to the Receive Queue as described in the
rules that follow:
* Return an immediate error if the QP is in the Reset state.

So are other implementations not doing this?

Mike
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/infiniband/ulp/srpt/ib_srpt.c b/drivers/infiniband/ulp/srpt/ib_srpt.c
index 304855b9b537..98b1b80e476b 100644
--- a/drivers/infiniband/ulp/srpt/ib_srpt.c
+++ b/drivers/infiniband/ulp/srpt/ib_srpt.c
@@ -1687,10 +1687,6 @@  static int srpt_create_ch_ib(struct srpt_rdma_ch *ch)
 		goto err_destroy_cq;
 	}
 
-	if (!sdev->use_srq)
-		for (i = 0; i < ch->rq_size; i++)
-			srpt_post_recv(sdev, ch, ch->ioctx_recv_ring[i]);
-
 	atomic_set(&ch->sq_wr_avail, qp_init->cap.max_send_wr);
 
 	pr_debug("%s: max_cqe= %d max_sge= %d sq_size = %d cm_id= %p\n",
@@ -1701,6 +1697,10 @@  static int srpt_create_ch_ib(struct srpt_rdma_ch *ch)
 	if (ret)
 		goto err_destroy_qp;
 
+	if (!sdev->use_srq)
+		for (i = 0; i < ch->rq_size; i++)
+			srpt_post_recv(sdev, ch, ch->ioctx_recv_ring[i]);
+
 out:
 	kfree(qp_init);
 	return ret;