From patchwork Fri Jul 31 21:13:22 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: 6919071 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 2F3539F38B for ; Fri, 31 Jul 2015 21:13:58 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 48F6120618 for ; Fri, 31 Jul 2015 21:13:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 42D4C2065D for ; Fri, 31 Jul 2015 21:13:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1946174AbbGaVNw (ORCPT ); Fri, 31 Jul 2015 17:13:52 -0400 Received: from mail-bl2on0088.outbound.protection.outlook.com ([65.55.169.88]:22423 "EHLO na01-bl2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751527AbbGaVNn (ORCPT ); Fri, 31 Jul 2015 17:13:43 -0400 Received: from BY2PR02CA0123.namprd02.prod.outlook.com (10.163.44.177) by BY2PR0201MB0742.namprd02.prod.outlook.com (10.160.124.24) with Microsoft SMTP Server (TLS) id 15.1.219.17; Fri, 31 Jul 2015 21:13:41 +0000 Received: from BL2FFO11OLC009.protection.gbl (2a01:111:f400:7c09::198) by BY2PR02CA0123.outlook.office365.com (2a01:111:e400:5261::49) with Microsoft SMTP Server (TLS) id 15.1.225.19 via Frontend Transport; Fri, 31 Jul 2015 21:13:41 +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 BL2FFO11OLC009.mail.protection.outlook.com (10.173.160.145) with Microsoft SMTP Server id 15.1.243.9 via Frontend Transport; Fri, 31 Jul 2015 21:13:36 +0000 Received: from MILHUBIP04.sdcorp.global.sandisk.com ( [172.22.12.162]) by milsmgep11.sandisk.com (Symantec Messaging Gateway) with SMTP id 46.2E.04667.2F4EBB55; Fri, 31 Jul 2015 14:13:22 -0700 (PDT) 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.224.2; Fri, 31 Jul 2015 14:12:50 -0700 X-AuditID: ac160a68-f790b6d00000123b-90-55bbe4f21441 Received: from [10.60.52.33] ( [10.177.8.100]) by milsmgip12.sandisk.com (Symantec Messaging Gateway) with SMTP id 36.AA.04661.2F4EBB55; Fri, 31 Jul 2015 14:13:22 -0700 (PDT) Subject: [PATCH 2/3] IB/srp: Handle partial connection success correctly To: Doug Ledford References: <55BBE4A2.5090505@sandisk.com> CC: Sagi Grimberg , Sebastian Parschauer , Christoph Hellwig , "linux-rdma@vger.kernel.org" , "linux-scsi@vger.kernel.org" From: Bart Van Assche Message-ID: <55BBE4F2.3030700@sandisk.com> Date: Fri, 31 Jul 2015 14:13:22 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 MIME-Version: 1.0 In-Reply-To: <55BBE4A2.5090505@sandisk.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmphkeLIzCtJLcpLzFFi42JZI8azSPfTk92hBod3G1u8PP+B1WLl6qNM Fs8O9bJYdF/fwWZxo+0Bm8XJ2/wObB67bzaweTybfpjJ48+fz8we7/ddZfP4vEkugDWKyyYl NSezLLVI3y6BK2P9Te6CFr6KRVd4Ghg7eboYOTk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IEhy9n1A7G6xPNDzEycXBKNTAeYvFed1T50u2N8qdWhndvq68LdPPKkz5ayNYQ4HqQ0f/a hu6yq+E3z8ew+PDwLrWdYRvdtyTu2l/n61dnzvz/7ZvbNU7G/S2StXd5+f8xc73/HrMyM2Kq ae2K0MRXz08/vv5s2r/Fe0o/rL+z+r1fRNkKyaX8N51vGymKrfV78b9F/KIdZ99DJZbijERD Leai4kQAN/aFQg8CAAA= X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11OLC009; 1:tl9Q/uZpG54yLnt4NiFVpuxb7bu4a9eqyy5IfAAE8oAPKnNxNopbi752KfwxXoEA4/iuHbmaC/9jtGXQpQBEyFToAQOzVwvAPCGyIbG+Uui8Yrfy9lsNqjWFIqb+vtIoakIS5cGyxa0Jo/HPGx8wakJPtb4Z8weTPxilHXox4TzsJZFjW2fM+Q3ohKYklEAw4G8FiYQH0F17HGqWkjX1Ic3J3lqweSjCw6Nk1R7W3QS+PAdpYcVHd7T+/ys33eib9mAd7ylttu797HZgpIrQjWdBj9lE1PIdqWK0dK/oHMGRsqI+czo3H4vPwQxWAc4n5WV2f5hEMsSQ2aVMF4k2Bw== X-Forefront-Antispam-Report: CIP:63.163.107.172; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(2980300002)(438002)(189002)(199003)(54356999)(62966003)(77156002)(2950100001)(575784001)(87936001)(19580395003)(23676002)(50986999)(46102003)(189998001)(5001960100002)(76176999)(92566002)(110136002)(50466002)(77096005)(4001350100001)(80316001)(106466001)(65806001)(86362001)(19580405001)(83506001)(229853001)(33656002)(47776003)(65956001)(36756003); DIR:OUT; SFP:1101; SCL:1; SRVR:BY2PR0201MB0742; H:milsmgep11.sandisk.com; FPR:; SPF:Pass; MLV:sfv; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2PR0201MB0742; 2:QSnnsH/keMXa/0gOYOYgA8/ZYv1LtBFtyFE3WsfBg5XKIc0lDbXqYLm2hsKf+ogq; 3:CUOsKciiUO8x5oGL0SOyMFp9+CSHTkZWoE1DeszLJRmEhxyve41wBQhW8VtCbYbnMidijpccArhqU4AAwe2vWGQcG9rHqncdrdwqn+H5xTXmmLppMCDISB8QgfeB+hVqCZYK+S36DsI/4sbRmTeQA6CD7keMjEPS+mhnK0aBbDrVYNfXrND7W0u/oy85JM1dUlyRMCXkin3ICFg4qeZWnCzPGTw7NIvBsLz8AfJL8q7+EUFWBoW3sjK1tcYry+yJ; 25:48vLTBqE7fycgbuuwvWsDrTJewICUnfoMrwtnXXXAaDeC7YrZqodMKQsmbDmmVmTL0ouNH11ZR9IEX9im+64RI2AQxscABMTTwM4f4A7m6RFJx4nBmLQDtXfK1Eyk8paggmKHqCEO/XFmpCvWMrcSqws12zU/L1wHaz6ZmlDJmL0Ke4P+B0i6DDHVYwVBxym7zNVZLSAYvkgMJwS6ZwOFf7eCCNU6ZQ8t8uonTH/SD+IAvjRtNnDffLPpczkgrDXpd3S4QxkYj/66OByrgiZCg== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BY2PR0201MB0742; X-Microsoft-Exchange-Diagnostics: 1; BY2PR0201MB0742; 20:bgH8qW/W90k3hyn7alIay1/bwqRKik825cjPtemZ9+enmfelkIkDj3Axvrk/CSBapgmXty8wxgOXFIsoL9IULN2M+JtDURDAVzYs/IZ0TJeqtHqPwhiD5wZJdmk2NxhlmuPTZYlGHaX50Xz6Aftcki2AE8wF5ThYyyDy5ZF8c0HZPhIvopdE8ljt7db42itrXpAteoWczoh1539747YCex3qTSzW7nsqoaNdExBQK7e7425vTR1MPTwkjEl7SWra1wdDhyMFCXI+sHYVGix+TguyqVFQ1q6J8D0cF13ReVn5pOXKoF5mqFKs20/6IJWOpES6f0syQFlT0CNKjCT6YvT1A0rtQJ0yK7AKfazFIlXnQeBY8c5oCvG29A2v6u9CD6LEi3U7gU1VzAD+lp1HnBEg7/0mB2L4b6cvBxFThfuZrMWU9nWPMaxXV0xGB2guxTZ89JJF4Mzq3gxqyVlzXQgfYegHls9XcVn9JWcp9y7p6wtjbp9kv2pteUNC4TZL; 4:/fAbi0o5F5XRS5zO5b5xmhkjbS1TX49wIfCFQ9FFfx5FibOp4XE5dWDv2MiMUKuzOd9yKXXhOlBY6YviilS3/C1zWcp65lcXEBiQTI5o5i8MKqpfrOEaBHKt7OjkXp5y9LnS0godxsftIxFYRmQkzK+CErS3I69khyEFlUlObE+4pU5s6/4YmyweX3Qsp5YZnZyP6XMIhV/vYlVinJr+6PAsyBNu3KLWFBkDqFEd70uCfihVgXs5djaDC1AZGsQ2VfbmtjxLdUiZhEizRKzcl0dwSMtq6TvW87lYJ4h9xnE= 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:BY2PR0201MB0742; BCL:0; PCL:0; RULEID:; SRVR:BY2PR0201MB0742; X-Forefront-PRVS: 0654257CF5 X-Microsoft-Exchange-Diagnostics: 1; BY2PR0201MB0742; 23:K2MMN25NJ154/X+5hyHAoguclLz6O+WPc+bpE8Of5tPOHz0zVnJXDgDLOV+E/uWc8wquP3VHnQqetrC2TOn4nBa9eSA2czwQx137DwckXXiuViYgUf3AiDBB9+Kskx/TneBMaGzYhinzL2t55sWZNeqDv3qGvwKfa846CZX8EFZykmQrULTnM1OHgG/oS5n+S9SG3fDde7hLPSxySp4o+s//NYy5gIn8/p81Fp6uKczRdYvr7cA0Q3XXHgVboZkjVBGT6n2RyPGi5e0xZoEFf616nhQXfCPi8/O2Q+bSnO76vi24JhldHfptG53qewKVXnkUy6MU67BQWrG6dHTVZr5nS24X1QE3EcwPSeQlm75c0o/zLcAELbtRWdqK9uqHBnLXsHEt4I8WBopoGpfqUZtAQSQut7ZTeYMT1mIzUt/HSn2+qpV9O7xcfrep6I1hDaPft4CFA0UoYDykzWSaqi1eSH68c72euGXE99r8q0lq3GdG5+9NzD7KXqUTqUEbpz9RvnnJJ6r6a1CYWerX+4ScM/VxKsAK+JTN4Kg2lOfDyvtHXj3OwzndzTneuY76uhMxLwdBcIlUBpb7JaOki9vzZ3yG3/qPl9X1v+Xpen276v4ApDK/P38Gj3RYcrVySXzI2rzejpP7ZTGsWKtEZLfRupIVZjkcCjK/UsvjAtdPSppBEc6YhKh/hcliYWnTnt68zNWVK8t0kW7HgxuJCHOwZI0kLgJd5G7PLWuYThGkmvspmWy8x7bslVLJAdTstdrpqNGqQ60HBDTWRjb1i8w5KQYQsq6ScOg73p1gk8gNgfjUTPkay2fQC9UeSuCktv+XS3+fZkQRYm2CffkwGiW5i9l6VT3Gz3QJzXJjKOCnTFVVos16ulQBA1GhXOfKj9unsMlR3o5/k8iFOK6xWQ== X-Microsoft-Exchange-Diagnostics: 1; BY2PR0201MB0742; 5:Co4Et1r0ozesULJWSU316+uDfL4lxOVNt9Wz580DzR8Jyq4HVcWP+UAP+avKKzp9g+jyz+/erfdA1C2iz45tXNEo7wXqQwqgp0F3bRO4zzL6NCpgkW11FSjRqqGzgN0BAPEoTfJoYwBH3PAi2ftefg==; 24:HV/HXlOyo84xYWRt/J6HwSARwVyarOzS99a15ugAfh1IxNPgr8lF+ganbV5Urel2ogHb784Yo//C6vIuR9fqX+rQD81UMvuNZwJkoFWxptI=; 20:nvMCLkyIBgnujLybWM8YZvL8QSp1BP4FeaV19Z6yyPlPxDc9tVvp8/EYh8Uurkj0FP3PmetmA3mSjfhfUPovlaWw4JZR8GUygouo75lfZ1lpPqMpY4CGLmiYmx4SKzXnrbN5VtO2Ryhdax5rIii51+HuJSG3ct9sWJ7JgpZ/SMc= X-OriginatorOrg: sandisk.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Jul 2015 21:13:36.2932 (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: BY2PR0201MB0742 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Spam-Status: No, score=-8.3 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 the following kernel warning is reported if the SRP target system accepts fewer channels per connection than what was requested by the initiator system: WARNING: at drivers/infiniband/ulp/srp/ib_srp.c:617 srp_destroy_qp+0xb1/0x120 [ib_srp]() Call Trace: [] warn_slowpath_common+0x7f/0xc0 [] warn_slowpath_null+0x1a/0x20 [] srp_destroy_qp+0xb1/0x120 [ib_srp] [] srp_create_ch_ib+0x19b/0x420 [ib_srp] [] srp_create_target+0x7d7/0xa94 [ib_srp] [] dev_attr_store+0x20/0x30 [] sysfs_write_file+0xef/0x170 [] vfs_write+0xb4/0x130 [] sys_write+0x5f/0xa0 [] system_call_fastpath+0x16/0x1b Signed-off-by: Bart Van Assche Cc: Sagi Grimberg Cc: Sebastian Parschauer Cc: Christoph Hellwig Cc: stable@vger.kernel.org --- drivers/infiniband/ulp/srp/ib_srp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/infiniband/ulp/srp/ib_srp.c b/drivers/infiniband/ulp/srp/ib_srp.c index 61dadac..ab18665 100644 --- a/drivers/infiniband/ulp/srp/ib_srp.c +++ b/drivers/infiniband/ulp/srp/ib_srp.c @@ -3262,7 +3262,7 @@ static ssize_t srp_create_target(struct device *dev, srp_free_ch_ib(target, ch); srp_free_req_data(target, ch); target->ch_count = ch - target->ch; - break; + goto connected; } } @@ -3272,6 +3272,7 @@ static ssize_t srp_create_target(struct device *dev, node_idx++; } +connected: target->scsi_host->nr_hw_queues = target->ch_count; ret = srp_add_target(host, target);