From patchwork Thu Feb 2 00:58:28 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 9550919 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id BB94F60236 for ; Thu, 2 Feb 2017 00:59:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A6AD62844A for ; Thu, 2 Feb 2017 00:59:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9B8CE2845B; Thu, 2 Feb 2017 00:59:28 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AF1D32844A for ; Thu, 2 Feb 2017 00:59:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751418AbdBBA71 (ORCPT ); Wed, 1 Feb 2017 19:59:27 -0500 Received: from mail-cys01nam02on0055.outbound.protection.outlook.com ([104.47.37.55]:1857 "EHLO NAM02-CY1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751400AbdBBA7I (ORCPT ); Wed, 1 Feb 2017 19:59:08 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sandiskcorp.onmicrosoft.com; s=selector1-sandisk-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=ij5avyzAWtxKxuH+NreBIuspuEZovnlicBfuFE8l/M0=; b=lnYqPxPpZPuVPaKo5vYs+Cd97OjxV86GD1JB/hpN5NON5z9TsvR9/3yxQLdo+D+5pj0r/vM0R5z+B4/u528bdt9R7RUZII+krJoDZ50K8ra5XNYqXLlJM32XenPnt1NN++cR1+zniKzTdYyDUQXrxgGkb3Te+2m91tDysZHTOC4= Received: from CY4PR02CA0047.namprd02.prod.outlook.com (10.175.57.161) by BLUPR02MB035.namprd02.prod.outlook.com (10.242.191.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.874.12; Thu, 2 Feb 2017 00:59:03 +0000 Received: from BL2FFO11FD018.protection.gbl (2a01:111:f400:7c09::155) by CY4PR02CA0047.outlook.office365.com (2603:10b6:903:117::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.860.13 via Frontend Transport; Thu, 2 Feb 2017 00:59:03 +0000 Authentication-Results: spf=pass (sender IP is 63.163.107.21) smtp.mailfrom=sandisk.com; cavium.com; dkim=none (message not signed) header.d=none;cavium.com; dmarc=bestguesspass action=none header.from=sandisk.com;cavium.com; dkim=none (message not signed) header.d=none; Received-SPF: Pass (protection.outlook.com: domain of sandisk.com designates 63.163.107.21 as permitted sender) receiver=protection.outlook.com; client-ip=63.163.107.21; helo=milsmgep15.sandisk.com; Received: from milsmgep15.sandisk.com (63.163.107.21) by BL2FFO11FD018.mail.protection.outlook.com (10.173.161.36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.874.2 via Frontend Transport; Thu, 2 Feb 2017 00:59:02 +0000 Received: from MILHUBIP03.sdcorp.global.sandisk.com (Unknown_Domain [10.201.67.162]) (using TLS with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by (Symantec Messaging Gateway) with SMTP id FA.7C.65426.27182985; Wed, 1 Feb 2017 16:46:42 -0800 (PST) Received: from milsmgip11.sandisk.com (10.177.9.6) by MILHUBIP03.sdcorp.global.sandisk.com (10.177.9.96) with Microsoft SMTP Server id 14.3.319.2; Wed, 1 Feb 2017 16:58:56 -0800 X-AuditID: 0ac94369-b62949800001ff92-34-589281726fef Received: from exp-402881.sdcorp.global.sandisk.com ( [10.177.8.100]) by (Symantec Messaging Gateway) with SMTP id 7D.63.16817.05482985; Wed, 1 Feb 2017 16:58:57 -0800 (PST) From: Bart Van Assche To: Bart Van Assche CC: , Christoph Hellwig , "Himanshu Madhani" , Giridhar Malavali Subject: [PATCH v2 11/36] target: Make it possible to specify I_T nexus for SCSI abort Date: Wed, 1 Feb 2017 16:58:28 -0800 Message-ID: <20170202005853.23456-12-bart.vanassche@sandisk.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170202005853.23456-1-bart.vanassche@sandisk.com> References: <20170202005853.23456-1-bart.vanassche@sandisk.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrMLMWRmVeSWpSXmKPExsXCddJ5kW5R46QIgynzFS32PDjHZrFy9VEm iwt7uhktWpe+ZXJg8ZjxexGLx+6bDWwenzfJBTBHcdmkpOZklqUW6dslcGXsOXuEqeCJRsWn bXOYGhjPK3YxcnJICJhIrDrdzNTFyMUhJLCUSeLMuSdsEM5WRok/j1YywVQ9Pb6CHSKxmVHi 9/3JzCAJNgEjiW/vZ7KA2CICBhK/ey8wghQxC6xglPjf/gisSFggTOJjbw+YzSKgIrFp/3ew qbwCDhKvz0xgh9ggL7Gr7SIriM0JFF98HGKokIC9xLc/R1lAhkoI/GORWHmukxWiWVDi5Mwn YEXMAhISB1+8YIZoUJc4uWQ+0wRGoVlIymYhKVvAyLSKUSw3M6c4Nz21wNBUrzgxLyWzOFsv OT93EyMkqDN3MN594n2IUYCDUYmHV0BkUoQQa2JZcWXuIUYJDmYlEV5fYEwI8aYkVlalFuXH F5XmpBYfYpTmYFES5331qj9CSCA9sSQ1OzW1ILUIJsvEwSnVwLh9M48Vu2B3lr2eh2ZhHPua G6VWe67qKNk//N200YrBQdFRMjNtR4KnSoNyUVFeq4P1x3OJLr84Zn7bw31I+IGQsNCr/8UX U+9v5z3fenDmke6aye/fWfJdE7i/tzO8wdTRSj3I5/+lvLT6a2esj16Qfb3MLyzZ88V5mVCr zy6/pO+0fRE8p8RSnJFoqMVcVJwIAIUGsOtmAgAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrEJMWRmVeSWpSXmKPExsXCtZEjRTewZVKEweZ7TBYHf7YxWux5cI7N YuXqo0wWF/Z0M1q0Ln3L5MDqMeP3IhaP3Tcb2DymrTnP5PF5k1wASxSXTUpqTmZZapG+XQJX xp6zR5gKnmhUfNo2h6mB8bxiFyMnh4SAicTT4yvYuxi5OIQENjJK9KxdwgySYBMwkvj2fiYL iC0iYCDxu/cCI0gRs8AKRomGw/sZQRLCAmESH3t7wBpYBFQl1p9cwARi8wo4SJx5eZ8NYoO8 xK62i6wgNidQfPFxiKFCAvYS3/4cZZnAyL2AkWEVo1huZk5xbnpmgaGhXnFiXkpmcbZecn7u JkZwKHBG7mB8OtH8ECMTB6dUA2PAtWcM2y5vmPn0HvNOkQyD0EmPS30fW7zW9Uy/Ye7PV/b1 KMe2Zne3oGI116t+NzQLGDziP+ztPNswlUXsfWxF7ztf3Wtt3cnbk3uEn1i7pKhr1mpmGqWs rE9o3FaSEb95nviLMsUDPDPSva0YNqwQ3lK9bXGrgO+DEL8WdxaNY7JdPXvYlViKMxINtZiL ihMBbCqgWrUBAAA= MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:63.163.107.21; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(7916002)(39410400002)(39850400002)(39450400003)(39840400002)(39860400002)(2980300002)(438002)(189002)(199003)(356003)(2906002)(33646002)(50466002)(92566002)(575784001)(48376002)(5003940100001)(38730400001)(8676002)(1076002)(8936002)(97736004)(47776003)(6200100001)(189998001)(50226002)(7049001)(81166006)(86362001)(81156014)(2950100002)(76176999)(305945005)(2270400002)(50986999)(110136003)(4326007)(77096006)(6862003)(626004)(1691005)(68736007)(106466001)(36756003)(69596002)(54906002)(6666003)(5660300001)(53936002); DIR:OUT; SFP:1101; SCL:1; SRVR:BLUPR02MB035; H:milsmgep15.sandisk.com; FPR:; SPF:Pass; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD018; 1:Mhe8dM0QjorOwIDuSEXJjuZr4k0KPQa2dlpOrpo0y4OnbLnOVrV02GFQbtjt4ruL1qw6VU3Gz4RpUhwTlfVDK0D+GZ2KGVp2x4pN5SxcvI9QzwoD33a4+B+KIFrchdQiICm3KNvsRHqlDfllFKh0xVgIW+oudQ9ZjWctvrz0kx3nPNggqEFhRle15oDazmNDW2mKG24bJtzS/3Qbt0F1UQJjs+ZRZ/uNJ7sXdni6mf7zjZyx2ZlojdZZZ8nDDJNmRR+4J4hjev11+CKe0/L8F775UtHyaCIPUJb4ORQYgDQsiDuskV/CmGWYMALIgfPP8UkxnuW4dT350T8vn2xC6rDFfUXw1PQy2XgvB17vGmMZnUnTewtX5AKnhNEhsZvdmPslO10U1IpTDg+JkaKTAb/ltvbZIVHPMSS7gbRJ/W9Z1Jn0YcpvOJvzuepdB7lN8qRseeo2PhuIBf8SdzD6gaEkiSwucVV6OLRSQ7Gx2vIH2NGRN7i5UyLWh8drX++b X-MS-Office365-Filtering-Correlation-Id: 2f993ce1-dba7-4470-92db-08d44b06ae4d X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(8251501002); SRVR:BLUPR02MB035; X-Microsoft-Exchange-Diagnostics: 1; BLUPR02MB035; 3:l+LmRAH1SO2lYgiqunTQY/iJD2tQpAlip2S2VCr/S/T+hse2Cf8LINLZpPPFnLBVotFOpXhjuR73wt4Q8SFWAuWjhiJfs4Z+Wghf01Jv6l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A53RnGA==; 20:qnnySFr+TwxrtMdpx8xPtPREMbmJBkvF7oTdRhX5vFTzEEHEa5wSjymTQH0uyDclWSUJLRSsWx7gK8HH0zHUMSkUYk0OQHvhEG1Kd6PtkASQ9nCleVcNvZ360IlgDj4Tdw5rbpKCF0BnyiwJNcLKlqIdaZ7xVkFdicIXrBOV8OWkPHM4aUIuRRLojkozC3zXFbAaB6wWZj3Mke5g/DKDlVMP2xeITiDQ+hn+cqzcPvoZ6ry60PTreGqjHnQCx8WWz08y19+POwGGwJ+6p4uu8KWtQ7KDYRSfGSeooarv8ZfJ2EgDUXMjGSxql/xR4QZSFttJ1p1RDACYegkchKetgod8COzMb4QBaycFWo+CDxX9SY6RqT1ymMi46j8PDYiJzHjohDlfybXwEXD1RWy0ZFEuyRFZB5liRIUDXUIeQwOWjfeFPURYKYacZ2lmfpbw7rWrKTazijsTOjbY82ZTI7OlWJk88xtXhdO4qKAMquGx21xsm3v1iIznpe25V26d X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(42932892334569); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(13018025)(5005006)(8121501046)(13016025)(10201501046)(3002001)(6055026)(6041248)(20161123558025)(20161123562025)(20161123555025)(20161123560025)(20161123564025)(6072148); SRVR:BLUPR02MB035; BCL:0; PCL:0; RULEID:; SRVR:BLUPR02MB035; X-Microsoft-Exchange-Diagnostics: 1; BLUPR02MB035; 4:UjNfD60k4i+KlYicBsrYJmrfhzmYVLGoWQ88Ga9qzZ2/B41ZE9rGSqXoVfCMIIt0ExFbsAilTERMvnNliBVTjesJJbZhSZzE1PJmkUuIvelS9gnLSdvbvLqmB39VLdA/YZG7aQaMVtL0OYykR94tGaYYyvHSso5Fu0IHdbMmlSEoozF8Po7X1nM+oBSxPguVXow9lcpC/P/5qV2VSmVsiaRUaeRA1VSU93z18rXqFVJcw4XgZRgF2Sjdy8X8Vc93ld1Nw4rYuBr71vJ2V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gv1YlspmTuVvyt7EMQJ+I79CKhSSoQXs2Rr8FsUS/qmuDMD/n1Nfza7WeA7KcdG/lj5mMlqH43qYi3sL3iYJCnc+FaPb9u050jhWeRgvcaUMX0qIVgHpZ6ukpxXVIfj7xD+L789Q8iWry/0FsaHKFzjvYiExC+8ZkCln5D/2gMqfP5Qi0XS5jQwqPju2O+f+ngHR6JLYOTax4wg2dabc20rsuwK980+zZ2AMh+yTzC8hxPTtYQOK5H53p8QtNwY+xgOe8AnjSqQdVmMAfDN51zipYVCA6RcPWg4SyVz+li8Bw9JjK X-OriginatorOrg: sandisk.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Feb 2017 00:59:02.7920 (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.21]; Helo=[milsmgep15.sandisk.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR02MB035 Sender: target-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: target-devel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP target_submit_tmr() only supports the I_T_L nexus for SCSI abort and other task management functions. Make it possible for target drivers to specify I_T nexus for SCSI abort by passing the TARGET_SCF_IGNORE_TMR_LUN flag to target_submit_tmr(). Signed-off-by: Bart Van Assche Reviewed-by: Hannes Reinecke Cc: Christoph Hellwig Cc: Himanshu Madhani Cc: Giridhar Malavali Reviewed-by: Christoph Hellwig --- drivers/target/target_core_tmr.c | 16 +++++++++++++++- drivers/target/target_core_transport.c | 30 +++++++++++++++++++++++------- include/target/target_core_base.h | 1 + 3 files changed, 39 insertions(+), 8 deletions(-) diff --git a/drivers/target/target_core_tmr.c b/drivers/target/target_core_tmr.c index 311dc3c2f1dc..367799b4dde1 100644 --- a/drivers/target/target_core_tmr.c +++ b/drivers/target/target_core_tmr.c @@ -149,6 +149,13 @@ static bool __target_check_io_state(struct se_cmd *se_cmd, return kref_get_unless_zero(&se_cmd->cmd_kref); } +/** + * core_tmr_abort_task - abort a SCSI command + * @dev: LUN specified in task management function or NULL if no LUN has been + * specified. + * @tmr: Task management function. + * @se_sess: Session a.k.a. I_T nexus. + */ void core_tmr_abort_task( struct se_device *dev, struct se_tmr_req *tmr, @@ -161,7 +168,7 @@ void core_tmr_abort_task( spin_lock_irqsave(&se_sess->sess_cmd_lock, flags); list_for_each_entry(se_cmd, &se_sess->sess_cmd_list, se_cmd_list) { - if (dev != se_cmd->se_dev) + if (dev && dev != se_cmd->se_dev) continue; /* skip task management functions, including tmr->task_cmd */ @@ -178,6 +185,13 @@ void core_tmr_abort_task( if (!__target_check_io_state(se_cmd, se_sess, 0)) continue; + if (!tmr->tmr_dev && + transport_lookup_tmr_lun(tmr->task_cmd, + se_cmd->orig_fe_lun) < 0) { + target_put_sess_cmd(se_cmd); + continue; + } + list_del_init(&se_cmd->se_cmd_list); spin_unlock_irqrestore(&se_sess->sess_cmd_lock, flags); diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c index 18a76ee641ea..3f54ec6d7f66 100644 --- a/drivers/target/target_core_transport.c +++ b/drivers/target/target_core_transport.c @@ -1598,18 +1598,18 @@ static void target_complete_tmr_failure(struct work_struct *work) } /** - * target_submit_tmr - lookup unpacked lun and submit uninitialized se_cmd - * for TMR CDBs + * target_submit_tmr - submit a SCSI task management function to the target core * * @se_cmd: command descriptor to submit * @se_sess: associated se_sess for endpoint * @sense: pointer to SCSI sense buffer - * @unpacked_lun: unpacked LUN to reference for struct se_lun + * @unpacked_lun: LUN the TMR applies to. Ignored if TARGET_SCF_IGNORE_TMR_LUN + * has been set in @flags. * @fabric_context: fabric context for TMR req * @tm_type: Type of TM request * @gfp: gfp type for caller * @tag: referenced task tag for TMR_ABORT_TASK - * @flags: submit cmd flags + * @flags: submit cmd flags (TARGET_SCF_*). * * Callable from all contexts. **/ @@ -1645,7 +1645,14 @@ int target_submit_tmr(struct se_cmd *se_cmd, struct se_session *se_sess, return ret; } - ret = transport_lookup_tmr_lun(se_cmd, unpacked_lun); + if (flags & TARGET_SCF_IGNORE_TMR_LUN) { + WARN_ON_ONCE(tm_type != TMR_ABORT_TASK); + se_cmd->se_lun = NULL; + se_cmd->se_dev = NULL; + se_cmd->se_tmr_req->tmr_dev = NULL; + } else { + ret = transport_lookup_tmr_lun(se_cmd, unpacked_lun); + } if (ret) { /* * For callback during failure handling, push this work off @@ -1655,6 +1662,7 @@ int target_submit_tmr(struct se_cmd *se_cmd, struct se_session *se_sess, schedule_work(&se_cmd->work); return 0; } + WARN_ON_ONCE(tm_type != TMR_ABORT_TASK && !se_cmd->se_dev); transport_generic_handle_tmr(se_cmd); return 0; } @@ -3133,8 +3141,16 @@ static void target_tmr_work(struct work_struct *work) transport_cmd_check_stop_to_fabric(cmd); } -int transport_generic_handle_tmr( - struct se_cmd *cmd) +/** + * transport_generic_handle_tmr - queue a task management function + * + * Note: task management functions for which flag TARGET_SCF_IGNORE_TMR_LUN + * has been set are queued on a separate workqueue. This may cause out-of-order + * execution of task management functions. That is fine though since the + * SCSI Architecture Manual does not require that task management functions + * are executed in order. + */ +int transport_generic_handle_tmr(struct se_cmd *cmd) { unsigned long flags; diff --git a/include/target/target_core_base.h b/include/target/target_core_base.h index 5cb7583ad701..fb87f0e5d0d6 100644 --- a/include/target/target_core_base.h +++ b/include/target/target_core_base.h @@ -186,6 +186,7 @@ enum target_sc_flags_table { TARGET_SCF_ACK_KREF = 0x02, TARGET_SCF_UNKNOWN_SIZE = 0x04, TARGET_SCF_USE_CPUID = 0x08, + TARGET_SCF_IGNORE_TMR_LUN = 0x10, }; /* fabric independent task management function values */