From patchwork Mon May 18 11:24:17 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: 6428141 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 778C79F318 for ; Mon, 18 May 2015 11:24:31 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 88073205EB for ; Mon, 18 May 2015 11:24:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8F4C7205DC for ; Mon, 18 May 2015 11:24:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753768AbbERLY2 (ORCPT ); Mon, 18 May 2015 07:24:28 -0400 Received: from mail-by2on0079.outbound.protection.outlook.com ([207.46.100.79]:61207 "EHLO na01-by2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751870AbbERLY1 (ORCPT ); Mon, 18 May 2015 07:24:27 -0400 Received: from BY1PR0201CA0009.namprd02.prod.outlook.com (25.160.191.147) by BN3PR0201MB1025.namprd02.prod.outlook.com (25.161.207.147) with Microsoft SMTP Server (TLS) id 15.1.160.19; Mon, 18 May 2015 11:24:23 +0000 Received: from BL2FFO11FD052.protection.gbl (2a01:111:f400:7c09::150) by BY1PR0201CA0009.outlook.office365.com (2a01:111:e400:4814::19) with Microsoft SMTP Server (TLS) id 15.1.166.22 via Frontend Transport; Mon, 18 May 2015 11:24:23 +0000 Authentication-Results: spf=pass (sender IP is 63.163.107.173) smtp.mailfrom=sandisk.com; profitbricks.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 BL2FFO11FD052.mail.protection.outlook.com (10.173.161.214) with Microsoft SMTP Server id 15.1.172.14 via Frontend Transport; Mon, 18 May 2015 11:24:20 +0000 Received: from MILHUBIP04.sdcorp.global.sandisk.com ( [172.22.12.162]) by milsmgep12.sandisk.com (Symantec Messaging Gateway) with SMTP id EA.27.06265.3EBC9555; Mon, 18 May 2015 04:24:19 -0700 (PDT) Received: from milsmgip11.sandisk.com (10.177.8.100) by MILHUBIP04.sdcorp.global.sandisk.com (10.177.9.97) with Microsoft SMTP Server id 14.3.224.2; Mon, 18 May 2015 04:24:19 -0700 X-AuditID: ac160a69-f790f6d000001879-10-5559cbe3a2a4 Received: from [10.50.231.56] ( [10.177.8.100]) by milsmgip11.sandisk.com (Symantec Messaging Gateway) with SMTP id E5.E7.03643.2EBC9555; Mon, 18 May 2015 04:24:19 -0700 (PDT) Message-ID: <5559CBE1.9000202@sandisk.com> Date: Mon, 18 May 2015 13:24:17 +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 06/12] IB/srp: Fix reconnection failure handling References: <5559CB3A.6060102@sandisk.com> In-Reply-To: <5559CB3A.6060102@sandisk.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFupgkeLIzCtJLcpLzFFi42JZI8azSPfx6chQg5cHDCxenv/AavF//W0W i2eHelksuq/vYLO40faAzeLkbX4HNo9n0w8zeRz+8YPZ48+fz8we7/ddZfP4vEkugDWKyyYl NSezLLVI3y6BK+PLk99MBXc4Kk51NTM1ME5g72Lk5JAQMJGYcvw5M4QtJnHh3nq2LkYuDiGB E4wSExdfhnJ2MEqc2tn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/jQ+9bd4EkTWvf 5xYNLx78Mz/ecLfo8VpJhoSCh7Xvlq5z7Xi3q4L5o+JdPVM729f206tSzWStq9VvJEXNsff5 4LT7jrn/p9wnEecEbyyYaBqruie7hCch8NszryfG69xElO5/eCuo6P6moWBxpxJLcUaioRZz UXEiAPjLeJ4RAgAA X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD052; 1:6cXjisixssIo0r6/gp6cTOdeqMk27ATfqr2GSn0+wDKAAPHtqbO2uAC1Itbg70TlqEUSco0ADnECtQ5arUkojdvWhI97Y4oNBgmLh0Iln6Ieuzcbcf1mDgileaXSXUl8uqaeCg+qxdJo57jT/0fIXpXlLdCA7SYgP37ZtOJzmDDXy0g9KFRp8lhZY/vuY8TcaJUFGEp/JGN9Gjd9rJLrUz7Sn43lpbAXSJbpA7BXG6pSBRbcc3iFkfqQZbEXVGtXIfJBUcNQ1wdyeQJxnIP3G8X+0al2CcrrU4lsDhHqzRF2Oq78Gu+hq0XxJ7571wXtL8qdy7qyKUPNi/16iuIBEw== X-Forefront-Antispam-Report: CIP:63.163.107.173; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(438002)(199003)(189002)(77096005)(47776003)(65956001)(65806001)(4001540100001)(80316001)(86362001)(19580405001)(62966003)(76176999)(54356999)(64706001)(65816999)(50986999)(87266999)(110136002)(189998001)(5001830100001)(5001860100001)(5001960100002)(81156007)(19580395003)(97736004)(2950100001)(36756003)(4001350100001)(50466002)(68736005)(69596002)(77156002)(229853001)(83506001)(92566002)(46102003)(87936001)(33656002)(106466001)(23676002)(59896002)(64126003); DIR:OUT; SFP:1101; SCL:1; SRVR:BN3PR0201MB1025; H:milsmgep12.sandisk.com; FPR:; SPF:Pass; PTR:ErrorRetry; A:1; MX:1; LANG:en; X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BN3PR0201MB1025; 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:BN3PR0201MB1025; BCL:0; PCL:0; RULEID:; SRVR:BN3PR0201MB1025; X-Forefront-PRVS: 058043A388 X-OriginatorOrg: sandisk.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 May 2015 11:24:20.1597 (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: BN3PR0201MB1025 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 Although it is possible to let SRP I/O continue if a reconnect results in a reduction of the number of channels, the current code does not handle this scenario correctly. Instead of making the reconnect code more complex, consider this as a reconnection failure. 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, 1 insertion(+), 4 deletions(-) diff --git a/drivers/infiniband/ulp/srp/ib_srp.c b/drivers/infiniband/ulp/srp/ib_srp.c index 83e4d8a..982e329 100644 --- a/drivers/infiniband/ulp/srp/ib_srp.c +++ b/drivers/infiniband/ulp/srp/ib_srp.c @@ -1259,11 +1259,8 @@ static int srp_rport_reconnect(struct srp_rport *rport) for (i = 0; i < target->ch_count; i++) { ch = &target->ch[i]; - if (ret || !ch->target) { - if (i > 1) - ret = 0; + if (ret || !ch->target) break; - } ret = srp_connect_ch(ch, multich); multich = true; }