From patchwork Mon May 18 11:23:36 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 6428101 Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 68ECD9F318 for ; Mon, 18 May 2015 11:23:50 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7257D205EB for ; Mon, 18 May 2015 11:23:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 91004205DC for ; Mon, 18 May 2015 11:23:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753894AbbERLXr (ORCPT ); Mon, 18 May 2015 07:23:47 -0400 Received: from mail-bl2on0100.outbound.protection.outlook.com ([65.55.169.100]:60956 "EHLO na01-bl2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753669AbbERLXq (ORCPT ); Mon, 18 May 2015 07:23:46 -0400 Received: from BY2PR02CA0021.namprd02.prod.outlook.com (10.141.216.11) by DM2PR02MB286.namprd02.prod.outlook.com (10.141.55.146) with Microsoft SMTP Server (TLS) id 15.1.160.19; Mon, 18 May 2015 11:23:42 +0000 Received: from BN1BFFO11FD025.protection.gbl (2a01:111:f400:7c10::1:144) by BY2PR02CA0021.outlook.office365.com (2a01:111:e400:2c40::11) with Microsoft SMTP Server (TLS) id 15.1.166.22 via Frontend Transport; Mon, 18 May 2015 11:23:42 +0000 Authentication-Results: spf=pass (sender IP is 63.163.107.173) smtp.mailfrom=sandisk.com; mellanox.com; dkim=none (message not signed) header.d=none; Received-SPF: Pass (protection.outlook.com: domain of sandisk.com designates 63.163.107.173 as permitted sender) receiver=protection.outlook.com; client-ip=63.163.107.173; helo=milsmgep12.sandisk.com; Received: from milsmgep12.sandisk.com (63.163.107.173) by BN1BFFO11FD025.mail.protection.outlook.com (10.58.144.88) with Microsoft SMTP Server id 15.1.172.14 via Frontend Transport; Mon, 18 May 2015 11:23:39 +0000 Received: from MILHUBIP03.sdcorp.global.sandisk.com ( [172.22.12.162]) by milsmgep12.sandisk.com (Symantec Messaging Gateway) with SMTP id 0A.27.06265.BBBC9555; Mon, 18 May 2015 04:23:39 -0700 (PDT) Received: from milsmgip12.sandisk.com (10.177.8.100) by MILHUBIP03.sdcorp.global.sandisk.com (10.177.9.96) with Microsoft SMTP Server id 14.3.224.2; Mon, 18 May 2015 04:23:38 -0700 X-AuditID: ac160a69-f790f6d000001879-06-5559cbbba81c Received: from [10.50.231.56] ( [10.177.8.100]) by milsmgip12.sandisk.com (Symantec Messaging Gateway) with SMTP id 26.47.04661.9BBC9555; Mon, 18 May 2015 04:23:39 -0700 (PDT) Message-ID: <5559CBB8.2060300@sandisk.com> Date: Mon, 18 May 2015 13:23:36 +0200 From: Bart Van Assche User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: Doug Ledford CC: James Bottomley , Sagi Grimberg , Sebastian Parschauer , linux-rdma , "linux-scsi@vger.kernel.org" Subject: [PATCH v2 04/12] IB/srp: Fix a connection setup race References: <5559CB3A.6060102@sandisk.com> In-Reply-To: <5559CB3A.6060102@sandisk.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmpnkeLIzCtJLcpLzFFi42JZI8azSHf36chQg0sXRCxenv/AavF//W0W i2eHelksuq/vYLO40faAzeLkbX4HNo9n0w8zeRz+8YPZ48+fz8we7/ddZfP4vEkugDWKyyYl NSezLLVI3y6BK+PtmT7mgmWcFZ9uTGBvYLzP3sXIySEhYCLx78UqKFtM4sK99WxdjFwcQgIn GCXa+3awQzg7GCUm75/DCtOx8eo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+v3eq4BXb6c9PP7uk/h0w/9b kuf4leSaLzCcVNwR9eN6Re87z46uY1xVuxUONn1TzzyYsPf/uXevmkMuV/A785409lsi8PJh iRbXk3xtY2N+lc+WNqLH+JpeiV8J1eypYpgpmu9ytfxB4JlnqbIRtdsaT5+xiOFVYinOSDTU Yi4qTgQAvQcQkBICAAA= X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD025; 1:o+mh62bTIpZbbd6bxS0uzbMTeCvtTMBRhFLCyPWiz/Nu0IwEUskt5ODxad79PbPy4u/KB8eBGRba4Px9TTPWXYCVqWWxuuwtPfCCOchrNx6q3ru1Lh3vmt8vn52LhWHpTLc84oYV7wI00DhEmDaQ+jCrbf+PFkoZawfTX9YgsP9/0ryfqNQBRShFsgCPZsW/ekij3Rfp3jHKjLLPHdCa731uDFiE7rxHTl5OGzCsWj84zOXxEWNgHebl1kTpVF0zugC0ZFCZJUpQaaD4tKeV7bbHTXtNH1lcMXD1tCkiQ03dtc42hs1itPXD5RWuVqSCw0zFv5Rtg5jtRLzD5Jtkjg== X-Forefront-Antispam-Report: CIP:63.163.107.173; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(438002)(189002)(199003)(189998001)(5001830100001)(110136002)(23676002)(5001860100001)(5001960100002)(59896002)(69596002)(19580395003)(68736005)(229853001)(106466001)(64126003)(33656002)(36756003)(19580405001)(83506001)(80316001)(65956001)(50986999)(76176999)(64706001)(47776003)(65816999)(87266999)(50466002)(65806001)(87936001)(77156002)(54356999)(92566002)(86362001)(4001540100001)(62966003)(46102003)(4001350100001)(97736004)(77096005)(2950100001)(81156007); DIR:OUT; SFP:1101; SCL:1; SRVR:DM2PR02MB286; H:milsmgep12.sandisk.com; FPR:; SPF:Pass; PTR:ErrorRetry; MX:1; A:1; LANG:en; X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:DM2PR02MB286; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(5005006)(3002001); SRVR:DM2PR02MB286; BCL:0; PCL:0; RULEID:; SRVR:DM2PR02MB286; X-Forefront-PRVS: 058043A388 X-OriginatorOrg: sandisk.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 May 2015 11:23:39.7905 (UTC) X-MS-Exchange-CrossTenant-Id: fcd9ea9c-ae8c-460c-ab3c-3db42d7ac64d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=fcd9ea9c-ae8c-460c-ab3c-3db42d7ac64d; Ip=[63.163.107.173]; Helo=[milsmgep12.sandisk.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM2PR02MB286 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Avoid that receiving a DREQ while RDMA channels are being established causes target->qp_in_error to be reset. Signed-off-by: Bart Van Assche Cc: Sagi Grimberg Cc: Sebastian Parschauer Cc: #v3.19 --- drivers/infiniband/ulp/srp/ib_srp.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/infiniband/ulp/srp/ib_srp.c b/drivers/infiniband/ulp/srp/ib_srp.c index cdb7a71..034d755 100644 --- a/drivers/infiniband/ulp/srp/ib_srp.c +++ b/drivers/infiniband/ulp/srp/ib_srp.c @@ -1009,8 +1009,6 @@ static int srp_connect_ch(struct srp_rdma_ch *ch, bool multich) WARN_ON_ONCE(!multich && target->connected); - target->qp_in_error = false; - ret = srp_lookup_path(ch); if (ret) return ret; @@ -1259,6 +1257,9 @@ static int srp_rport_reconnect(struct srp_rport *rport) for (j = 0; j < target->queue_size; ++j) list_add(&ch->tx_ring[j]->list, &ch->free_tx); } + + target->qp_in_error = false; + for (i = 0; i < target->ch_count; i++) { ch = &target->ch[i]; if (ret || !ch->target) {