From patchwork Mon May 18 11:26: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: 6428261 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 3FB6D9F318 for ; Mon, 18 May 2015 11:26:30 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5AE8B20602 for ; Mon, 18 May 2015 11:26:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6038E205DC for ; Mon, 18 May 2015 11:26:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753811AbbERL01 (ORCPT ); Mon, 18 May 2015 07:26:27 -0400 Received: from mail-bl2on0066.outbound.protection.outlook.com ([65.55.169.66]:50062 "EHLO na01-bl2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753724AbbERL0Z (ORCPT ); Mon, 18 May 2015 07:26:25 -0400 Received: from BY2PR02CA0046.namprd02.prod.outlook.com (10.141.216.36) by CY1PR0201MB1034.namprd02.prod.outlook.com (25.161.211.152) with Microsoft SMTP Server (TLS) id 15.1.166.22; Mon, 18 May 2015 11:26:22 +0000 Received: from BN1BFFO11FD013.protection.gbl (2a01:111:f400:7c10::1:136) by BY2PR02CA0046.outlook.office365.com (2a01:111:e400:2c40::36) with Microsoft SMTP Server (TLS) id 15.1.166.22 via Frontend Transport; Mon, 18 May 2015 11:26:22 +0000 Authentication-Results: spf=pass (sender IP is 63.163.107.172) 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.172 as permitted sender) receiver=protection.outlook.com; client-ip=63.163.107.172; helo=milsmgep11.sandisk.com; Received: from milsmgep11.sandisk.com (63.163.107.172) by BN1BFFO11FD013.mail.protection.outlook.com (10.58.144.76) with Microsoft SMTP Server id 15.1.172.14 via Frontend Transport; Mon, 18 May 2015 11:26:20 +0000 Received: from MILHUBIP03.sdcorp.global.sandisk.com ( [172.22.12.162]) by milsmgep11.sandisk.com (Symantec Messaging Gateway) with SMTP id A4.C3.04667.C5CC9555; Mon, 18 May 2015 04:26:20 -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:26:19 -0700 X-AuditID: ac160a68-f790b6d00000123b-96-5559cc5c37d6 Received: from [10.50.231.56] ( [10.177.8.100]) by milsmgip12.sandisk.com (Symantec Messaging Gateway) with SMTP id 1D.47.04661.A5CC9555; Mon, 18 May 2015 04:26:19 -0700 (PDT) Message-ID: <5559CC59.8@sandisk.com> Date: Mon, 18 May 2015 13:26: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 11/12] IB/srp: Remove !ch->target tests from the reconnect code References: <5559CB3A.6060102@sandisk.com> In-Reply-To: <5559CB3A.6060102@sandisk.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmpjkeLIzCtJLcpLzFFi42JZI8azSDfmTGSowYpZzBYvz39gtfi//jaL xbNDvSwW3dd3sFncaHvAZnHyNr8Dm8ez6YeZPA7/+MHs8efPZ2aP9/uusnl83iQXwBrFZZOS mpNZllqkb5fAlTF11ULWghd8Fa2nNrE2MP7i7mLk5JAQMJG4M7eTDcIWk7hwbz2QzcUhJHCC U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ZtYPx+kTzQ4xMHJxSDYwuN2XLZpgcbc7nnjebzTVlXt3ej3fjlTblKIjwlx0+ 5DTdarJyn99/ycCX1zdKxd1Zu68y/V44E//Fo9o6z2XZli29FGbLr9mgsZWxNLN92UKDktuf Ds44/1LsjhjDRKurjNY67A3e2+r+7TnT+GyJ72aDXhu9K0/iz5yxb2O0dG1ZO/3X/EwlluKM REMt5qLiRADWV9yNEQIAAA== X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD013; 1:Xjn0veFy/2I5bl85r2D6JykeR1q6RJKe6ZBVtdVivrbFYMgNQgz7oQX/syoo+x/bA3fXHVrarxtAMR40h0sK/yq6NdS4rAXKupbv7Lt5Tm7LyOuizbGpC9OlfrTs3VVGQEMhyCRa2XMPzeLN8fixw9FVjdH7UpXUe6gyBjDXzbiMEzS/CsjVFOp1zEfhOTGI/sfWaVnoK8ixQ9csBpc0yMLJ561ifPtSGD2VMrzm2fRQX+LdO1kfxLzlkiQCjqesXSqqPCEv1X6KXLmty4b9AJ1GG3m/M55hTaQmeWAscE6WoTQUphXbShqNouIBk3Doe6s1oFRzzM6BlXmvqkXGyQ== X-Forefront-Antispam-Report: CIP:63.163.107.172; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(438002)(189002)(199003)(110136002)(5001960100002)(4001350100001)(106466001)(23676002)(64706001)(47776003)(54356999)(76176999)(33656002)(46102003)(189998001)(64126003)(77156002)(2950100001)(229853001)(62966003)(68736005)(81156007)(4001540100001)(97736004)(77096005)(5001860100001)(5001830100001)(92566002)(36756003)(19580405001)(19580395003)(83506001)(69596002)(50986999)(65816999)(575784001)(86362001)(50466002)(65806001)(65956001)(87936001); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR0201MB1034; H:milsmgep11.sandisk.com; FPR:; SPF:Pass; PTR:ErrorRetry; MX:1; A:1; LANG:en; X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:CY1PR0201MB1034; 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:CY1PR0201MB1034; BCL:0; PCL:0; RULEID:; SRVR:CY1PR0201MB1034; X-Forefront-PRVS: 058043A388 X-OriginatorOrg: sandisk.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 May 2015 11:26:20.4599 (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.172]; Helo=[milsmgep11.sandisk.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR0201MB1034 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 Remove the !ch->target tests from the reconnect code. These tests are not needed: upon entry of srp_rport_reconnect() it is guaranteed that all ch->target pointers are non-NULL. None of the functions srp_new_cm_id(), srp_finish_req(), srp_create_ch_ib() nor srp_connect_ch() modifies this pointer. srp_free_ch_ib() is never called concurrently with srp_rport_reconnect(). Signed-off-by: Bart Van Assche Reviewed-by: Sagi Grimberg Cc: Sebastian Parschauer --- drivers/infiniband/ulp/srp/ib_srp.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/drivers/infiniband/ulp/srp/ib_srp.c b/drivers/infiniband/ulp/srp/ib_srp.c index dd6f928..a0a2348 100644 --- a/drivers/infiniband/ulp/srp/ib_srp.c +++ b/drivers/infiniband/ulp/srp/ib_srp.c @@ -1226,14 +1226,10 @@ static int srp_rport_reconnect(struct srp_rport *rport) */ for (i = 0; i < target->ch_count; i++) { ch = &target->ch[i]; - if (!ch->target) - break; ret += srp_new_cm_id(ch); } for (i = 0; i < target->ch_count; i++) { ch = &target->ch[i]; - if (!ch->target) - break; for (j = 0; j < target->req_ring_size; ++j) { struct srp_request *req = &ch->req_ring[j]; @@ -1242,8 +1238,6 @@ static int srp_rport_reconnect(struct srp_rport *rport) } for (i = 0; i < target->ch_count; i++) { ch = &target->ch[i]; - if (!ch->target) - break; /* * Whether or not creating a new CM ID succeeded, create a new * QP. This guarantees that all completion callback function @@ -1260,7 +1254,7 @@ 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 (ret) break; ret = srp_connect_ch(ch, multich); multich = true;