From patchwork Fri Nov 3 23:20:52 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 10041359 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id AA19B602D8 for ; Fri, 3 Nov 2017 23:21:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9C4DC283AF for ; Fri, 3 Nov 2017 23:21:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 912C52920A; Fri, 3 Nov 2017 23:21:04 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3282A28757 for ; Fri, 3 Nov 2017 23:21:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753224AbdKCXVC (ORCPT ); Fri, 3 Nov 2017 19:21:02 -0400 Received: from esa3.hgst.iphmx.com ([216.71.153.141]:41264 "EHLO esa3.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751536AbdKCXVB (ORCPT ); Fri, 3 Nov 2017 19:21:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1509751262; x=1541287262; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=o2DGbjotCPVrZmiVZ0AeP+G/OS6LKF9suq/5Ftcq1zU=; b=jRq3Jq3Z23vynpM/UU/gidTu42PzHZoRqhFWkVzjb2SpXJpxO5SEJRgg BfIqH6JK549nsREa3L1ITBWJINv8M1OTHCbCU2QyyJltPU/9lzSAljYGp snj9oRSEDRjVBF3P6V4l6/itaxLOaNufXc1r2kWDWYGxhdgL4jYZFS5yS ah9yOR+M2WM/l4g5Qn67bVIafgAsLoMTl/i/XMU60bOKPBXoA2aCQSXjr jUEzlx7jIu7VYPK8/hInhD462lZTf3y7CbwIicfTBIsqWZMRAqn4dCbQP Oy28Tu8nYJJpCl4p6Uvp556gyBr+0qFfbJ21tPMZZW76T+Wvmt86YH8hU g==; X-IronPort-AV: E=Sophos;i="5.44,339,1505750400"; d="scan'208";a="61365168" Received: from uls-op-cesaip01.wdc.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 04 Nov 2017 07:21:00 +0800 Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP; 03 Nov 2017 16:19:02 -0700 Received: from unknown (HELO MILHUBIP04.sdcorp.global.sandisk.com) ([10.177.9.97]) by uls-op-cesaip02.wdc.com with ESMTP; 03 Nov 2017 16:21:01 -0700 Received: from milsmgip12.sandisk.com (10.177.8.100) by MILHUBIP04.sdcorp.global.sandisk.com (10.177.9.97) with Microsoft SMTP Server id 14.3.319.2; Fri, 3 Nov 2017 16:20:59 -0700 X-AuditID: 0ab1095a-d99e3980000146e4-bb-59fcf9dbcf5a Received: from thinkpad-bart.int.fusionio.com ( [10.177.9.6]) by (Symantec Messaging Gateway) with SMTP id C7.33.18148.BD9FCF95; Fri, 3 Nov 2017 16:20:59 -0700 (PDT) From: Bart Van Assche To: Doug Ledford CC: , Mike Marciniszyn , Bart Van Assche Subject: [PATCH 1/5] IB/srpt: Post receive work requests after qp transition to INIT state Date: Fri, 3 Nov 2017 16:20:52 -0700 Message-ID: <20171103232056.30614-2-bart.vanassche@wdc.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20171103232056.30614-1-bart.vanassche@wdc.com> References: <20171103232056.30614-1-bart.vanassche@wdc.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprNJMWRmVeSWpSXmKPExsXCtZGTTff2zz+RBos2S1hc+vOF0eLl+Q+s Fs8O9bJYbPjfyO7A4rF4z0smj/f7rrJ5fN4k59F+oJspgCWKyyYlNSezLLVI3y6BK6Nn9wW2 glbuiqm7D7M0MM7j7GLk5JAQMJG4ceQHYxcjF4eQwEpGibsrvrKAJNgE9CROzdvHBGKLCKhJ bHq1iB3EZhaolri6ZzojiC0sECXx+PELNhCbRUBV4vP7D8wgNq+AtcS2I13sEAvkJda+vQdU z8HBKWAjcX6mOEhYCKhkyc0G1gmM3AsYGVYxiuVm5hTnpmcWGBrpFSfmpWQWZ+sl5+duYoR4 P2oH4/WJ5ocYmTg4pRoYF6u/M146sYqTKXRTOGNRfWIu88udP397/7lo45F8I65v8ZztPesC DDj2q8y4cib1gW3JVB2llUsm3L2u08cRtqf/68rHV28WlcRflT4TK/7t8dUnQaLRApejDpcu vfnCM+GckvTh8vRJAjNXf0o/q68TZ3fX1N1rr+Xp8lUmrtdtdr1hNOaRVmIpzkg01GIuKk4E ANhta1CuAQAA MIME-Version: 1.0 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Mike Marciniszyn 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 Signed-off-by: Bart Van Assche --- drivers/infiniband/ulp/srpt/ib_srpt.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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;