From patchwork Fri Jan 29 23:18:20 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 8168661 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 DFDA29F96D for ; Fri, 29 Jan 2016 23:18:28 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0813E20340 for ; Fri, 29 Jan 2016 23:18:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D173220328 for ; Fri, 29 Jan 2016 23:18:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754627AbcA2XS0 (ORCPT ); Fri, 29 Jan 2016 18:18:26 -0500 Received: from mail-bn1bon0068.outbound.protection.outlook.com ([157.56.111.68]:35168 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753397AbcA2XSY (ORCPT ); Fri, 29 Jan 2016 18:18:24 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sandiskcorp.onmicrosoft.com; s=selector1-sandisk-com; h=From:To:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=m2MSrT0z4leUoFPqTnZ3dshnbHtbtgxBOhyboUQKfxI=; b=siw3oWD3no5beewwZtbILQvS9/LMOqPDDSVsXElyng7Zc2ZEPdr0QGKAvLa+Pa0ACDPyrpmcpyd6jdDb+lvmzzDaqRos40lxWynJcZ0GGR8A6AoAYXcyTaYDE5Bm4vkLqMJEcISIvm5SKCA/y8DgBVHrcbZhtn/sEm2WXoqW750= Received: from BY2PR02CA0075.namprd02.prod.outlook.com (10.242.32.33) by BY2PR0201MB1573.namprd02.prod.outlook.com (10.163.154.11) with Microsoft SMTP Server (TLS) id 15.1.390.13; Fri, 29 Jan 2016 23:18:22 +0000 Received: from BL2FFO11FD040.protection.gbl (2a01:111:f400:7c09::190) by BY2PR02CA0075.outlook.office365.com (2a01:111:e400:2c2a::33) with Microsoft SMTP Server (TLS) id 15.1.390.13 via Frontend Transport; Fri, 29 Jan 2016 23:18:21 +0000 Authentication-Results: spf=pass (sender IP is 63.163.107.172) smtp.mailfrom=sandisk.com; intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=bestguesspass action=none header.from=sandisk.com; 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 BL2FFO11FD040.mail.protection.outlook.com (10.173.161.136) with Microsoft SMTP Server id 15.1.355.15 via Frontend Transport; Fri, 29 Jan 2016 23:18:20 +0000 Received: from MILHUBIP04.sdcorp.global.sandisk.com ( [172.22.12.162]) by (Symantec Messaging Gateway) with SMTP id D6.50.29304.C33FBA65; Fri, 29 Jan 2016 15:18:20 -0800 (PST) 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.248.2; Fri, 29 Jan 2016 15:18:21 -0800 X-AuditID: ac160a68-f37ff70000007278-b6-56abf33c9548 Received: from [10.60.52.49] ( [10.177.8.100]) by (Symantec Messaging Gateway) with SMTP id 55.77.02700.C33FBA65; Fri, 29 Jan 2016 15:18:20 -0800 (PST) Subject: [PATCH v2 20/22] IB/srpt: Log out all initiators if a port is disabled To: Doug Ledford References: <56ABF16E.7070006@sandisk.com> CC: Christoph Hellwig , Sagi Grimberg , "Alex Estrin" , "linux-rdma@vger.kernel.org" From: Bart Van Assche Message-ID: <56ABF33C.9030509@sandisk.com> Date: Fri, 29 Jan 2016 15:18:20 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <56ABF16E.7070006@sandisk.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrGLMWRmVeSWpSXmKPExsWyRoxnka7N59VhBs8Wq1tcePqdyeLl+Q+s FitXH2WyeHaol8XiRtsDNgdWj8V7XjJ57L7ZwObxbPphJo/3+66yeXzeJBfAGsVlk5Kak1mW WqRvl8CVsfb6QraCg3wVbz8+YW5g/MjdxcjBISFgIvG+o6iLkYtDSGATo8SaR1NZIZwdjBKv F61ngyn68KocIj6HUWLm8ndMXYycHMICgRIzDuxnBLFFBNQkNr1axA5iCwloSZy78IUdpIFZ YBWjxKar18ESbAJGEt/ez2QBsXmBil692Q1mswioSrxbtA7MFhWIkDjc2cUOUSMocXLmE7A4 p4C2xJLZF1hADmIW0JRYv0sfJMwsIC+x/e0cZpBdEgJ7WSVuLn7PDHGEusTJJfOZJjAKz0Iy ahZC+ywk7QsYmVcxiuVm5hTnpqcWGBrqFSfmpWQWZ+sl5+duYgTHBlfGDsatk8wPMQpwMCrx 8HosWx0mxJpYVlyZe4hRgoNZSYS37gVQiDclsbIqtSg/vqg0J7X4EKM0B4uSOK91i1qYkEB6 YklqdmpqQWoRTJaJg1OqgbG3uvaTqmnUwU/pbcbG6eev/Otea6a/XZY3SqXwjNFRnVChwmbu 6m+rHO+w7vD27ldesJv3qbKoWhPPe7/P9459v1pw8eajtGW3sldKP1mW6Dzrap7isUX/duWm NgRtvLHB/vS+LZJcpbfVfyUHnTu7rDd77QbFHQfambOWHnsn/pXV89+SzbZKLMUZiYZazEXF iQCPStTYiQIAAA== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrHJMWRmVeSWpSXmKPExsXCtZEjRdfm8+owg1vLBC0uPP3OZPHy/AdW i5WrjzJZPDvUy2Jxo+0BmwOrx+I9L5k8dt9sYPN4Nv0wk8f7fVfZPD5vkgtgjeKySUnNySxL LdK3S+DKWHt9IVvBQb6Ktx+fMDcwfuTuYuTgkBAwkfjwqryLkYtDSGAWo8Sx42cYuxg5OYQF AiVmHNgPZosIqElserWIHcQWEtCSOHfhCztIA7PAKkaJ3ys/sIEk2ASMJL69n8kCYvMCFb16 sxvMZhFQlXi3aB2YLSoQIXG4s4sdokZQ4uTMJ2BxTgFtiSWzL4DZzALqEn/mXWKGsOUltr+d wzyBkW8WkpZZSMpmISlbwMi8ilEsNzOnODc9s8DQUK84MS8lszhbLzk/dxMjOEQ5I3cwPp1o foiRiYNTqoFRsG/LLLGvi+7HK/9eGv340lL32R2LTjHvXhuq3n9VrVfy+tbJZmqMeybcyvwR dDhdqzX7Znlb1bp5Dfcm/isRlPERLdhrwJOz+svjH/rBUlwe4bee8DsE+yzv+Nm1yyh0uWPL a26nvWFa3nXL2TMP3TPUqj+h7rxL+edOt96ISTvO75i3OuCzEktxRqKhFnNRcSIAByPnvQEC AAA= X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD040; 1:I4Cz96QgnGGAga9Q8HPqxh5UtyEAwwbHvLNR3eLblUcDfZUvBlIP44ql2OoDFKuB+PWDCU48tiX96n9+F06nV8XviO9BPyZzmD3sFB6C2Awk8D256PHj50Vof5LpjIKCQfPHcaODHD1EWlh1CkRmHDPd5qhVTYYWcZ3BaNO8NltPLXYQz1s/QcQlRL/ZP4TqQufl6aCBiS47Jw8Cw4gTxS80/Mm6xAFomVSUigz5HG5FwxbRClxSdBBqqAXGk0StmzD3rLZ3/fZs6E04JmpC95nDTdJ0kNNRrZuP7KZDmuE71QrvoWketyKiRhRCfWLtv0YUsLnqcQYnMZ8lzRZFLHtvrhUT3EYisIKQzme15uqJMDkzQSS1blIW6SqZY/G9a5oX59GKSTAJAA8lwE3fMkjGnQZ6Z10fZn3FRm9FlHL1IllaHftkVvoViaFIn1ij X-Forefront-Antispam-Report: CIP:63.163.107.172; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(2980300002)(438002)(189002)(199003)(33656002)(23676002)(64126003)(5008740100001)(36756003)(1220700001)(1096002)(586003)(92566002)(2906002)(4326007)(19580405001)(230700001)(80316001)(87936001)(76176999)(19580395003)(83506001)(4001350100001)(110136002)(47776003)(65816999)(87266999)(50466002)(65956001)(77096005)(54356999)(65806001)(5001960100002)(229853001)(189998001)(86362001)(106466001)(2950100001)(50986999); DIR:OUT; SFP:1101; SCL:1; SRVR:BY2PR0201MB1573; H:milsmgep11.sandisk.com; FPR:; SPF:Pass; MLV:sfv; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2PR0201MB1573; 2:7qrhns0kZ99F4TENpXH1B5VoKOoTEilbu1vTN/TiiAVzRmW9tb8YG4xqhA5c6AUYb1hoWLf/PglKF/du2+OPLgAIzm/Tp8wCOUaibxs+OLEUZgMplqiM0ZJ/akw8r2YP7TFbHW9xc7BNqR6mOCndnA==; 3:o74Mo2YDhKf/pN5OEbBXT+eRkrKsJVBhJoGyVkhjCD68AJMnzFCERSE5DEaXfWVhakEe3r8KExktp/7FH1hXHDs1b8sqtnVLZbebBIQJ+6xx3KMsFFiEBYoKpUt6YqQDwt5zcKcCR9A1uesEy6miOrKd2oBRJMaL+30YorJwo4jLOGBknO9bQNRlinjDiO3P8mIXWr2qgZvm7IqX1/ZhUHjRxycdnlG2pQ4B1lmYrf8AtZgxfyEj2GBMwOxiDoynMF4x8br3CqBh9sNPNEvDVw==; 25:bbtRvs7JqP+4+sgkonVLZtprDhHXo02nlPtrPTST1nz7EG4fD8MNiv1Va00gp11zepWHR+K8Z77h/xtg0uEiULcwn8stjeqiY9YizfSxF9JuKbY3NctflUYceCVv/1z/WPBytrE0Lhu6/dLstOzRS2gdJFbwm08A9yzawh038XO0LuaqNnrTDtSJU/57B3E1GuFiTkb286tqKd2C4T3xmDLQl8KuMjB0Fad7Of8LEBjSxgaiAIQWKyKhcfvC2CWI X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(8251501001); SRVR:BY2PR0201MB1573; X-MS-Office365-Filtering-Correlation-Id: ddef92b7-ae7d-4618-9bfc-08d329027a8a X-Microsoft-Exchange-Diagnostics: 1; BY2PR0201MB1573; 20:eh94dQql6jFi/Tpel1dM3klcXgTsREflwdIpR8VWDgbSq0Yn9V7RcVVkj5nKlx1600AxV7kz48NO2K3d8TqZZfGY5Nyiwtl//XB5qbvgDKjHdkw7wdu1JG1iA/uNT9OdoORtet9t5ivd5fQsJ0jyA0fraH8lYKwfSTux7ypLQ9aR0vI9SNbYWgwevMjYAyHrdhCQr4ofv9okhRmC4glmLANZsCAqI4FLBEIuQGQ4KKrpAF8v3znmc1nm8KcES2nkCUrSbk1yyQsDrUg0UOHMJ6J/wFxF/PbuAVO4zic5jJM/jGZ3JfdX2b++SDFD3wOZRC9iD395Idj10flpEraMIh5XuxYV75pftgiwx2Tf5nA+p0Y+T7KML9zRxftc+aL9DkVcJn0hD/tujJH/Z/qb1JjQCGwcOKPoSQaOPhU1ePqRjmTAgcNcXUrah+euHyK+5nB9JEPOuoDi2JnY9odlKlh81q2oP6EtwFFkoA3OzEH/W6yCtdjvjgdgkpXR0vaP X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(34787635062028)(42932892334569); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(13018025)(13024025)(13017025)(5005006)(8121501046)(13023025)(13015025)(3002001)(10201501046); SRVR:BY2PR0201MB1573; BCL:0; PCL:0; RULEID:; SRVR:BY2PR0201MB1573; X-Microsoft-Exchange-Diagnostics: 1; BY2PR0201MB1573; 4:LBbiIKj/D3/x2J0s9E5r3NRocjSpagbvOyANq5o2LWhD80BaCm4ZhZf7jDBHZ7uk+VFIcrzdVYw9Pp0mx3XrhZyZIyeWFx6qJ4CBFhzDrrH57Qsztv7mzdsOPNT0EbHggk5oSAJ31vrPQHZchznYA8ttcxnNR6B+3LKC+3gu2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TJFVzB6dnho?= =?utf-8?Q?9xfEga3M=3D?= X-Microsoft-Exchange-Diagnostics: 1; BY2PR0201MB1573; 5:RwbXMqo5HRAFS5C0IK5Dt9UsUDHOmN5YF73+2pIntsgYLZ2an3j9wjUBOaDofxUc/ssh/9t8S1/tBrpeVK+Pxbe3qSbYFfP1f8RDXSV1jOBvhy++yxiL3iDZrIFLibMQeDYBHEPFqxScynxjmc/ejQ==; 24:4QoK380qkhVcnL0QI5jTRf+qcfkj8FH5Kzktg2WqZJDs8/XXC0yu/2NUvefkmsDO63H7wcPbox4+bqx/DWHFVetuVGB24ZwAcGATVFP1y8Y=; 20:545n36WjTsDBrkHNccJ7ov3WSL0INivx+ku5/QQE71279NcKmbyKgLAJ8aI+TZXfbpgXOjWXcS3/1skfkLJW5F3h6RV0FQqgu2n59qc5/IMKJM3TbL8YJE4YnQyVk4OOnQdCia7GuG0PQAFaXBNAQAYT/oGLRyjIRO17hcTm96//oCvRtm8FFj+CIkYb5rbFIzl+0GGBk8+MEBVr5MnkFlBKDIBCmnqH1JRAuDKtcBuSQCYyXZ3gqnpa+1NOZc62 SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: sandisk.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Jan 2016 23:18:20.6489 (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: BY2PR0201MB1573 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.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,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 If an initiator observes LUN deletion during shutdown of the target stack then that will trigger an I/O error even when using multipathd. Users need a way to avoid that shutting down the target stack causes I/O errors, e.g. by providing a way to force initiator logout. Hence close all sessions if a target port is disabled. Signed-off-by: Bart Van Assche Cc: Christoph Hellwig Cc: Sagi Grimberg Reviewed-by: Christoph Hellwig --- drivers/infiniband/ulp/srpt/ib_srpt.c | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/drivers/infiniband/ulp/srpt/ib_srpt.c b/drivers/infiniband/ulp/srpt/ib_srpt.c index a7c966f..d5b932c 100644 --- a/drivers/infiniband/ulp/srpt/ib_srpt.c +++ b/drivers/infiniband/ulp/srpt/ib_srpt.c @@ -3157,6 +3157,8 @@ static ssize_t srpt_tpg_enable_store(struct config_item *item, { struct se_portal_group *se_tpg = to_tpg(item); struct srpt_port *sport = container_of(se_tpg, struct srpt_port, port_tpg_1); + struct srpt_device *sdev = sport->sdev; + struct srpt_rdma_ch *ch; unsigned long tmp; int ret; @@ -3170,11 +3172,24 @@ static ssize_t srpt_tpg_enable_store(struct config_item *item, pr_err("Illegal value for srpt_tpg_store_enable: %lu\n", tmp); return -EINVAL; } - if (tmp == 1) - sport->enabled = true; - else - sport->enabled = false; + if (sport->enabled == tmp) + goto out; + sport->enabled = tmp; + if (sport->enabled) + goto out; + mutex_lock(&sdev->mutex); + list_for_each_entry(ch, &sdev->rch_list, list) { + if (ch->sport == sport) { + pr_debug("%s: ch %p %s-%d\n", __func__, ch, + ch->sess_name, ch->qp->qp_num); + srpt_disconnect_ch(ch); + srpt_close_ch(ch); + } + } + mutex_unlock(&sdev->mutex); + +out: return count; }