From patchwork Wed Jan 25 23:36:17 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: 9538099 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 3CC20604A7 for ; Wed, 25 Jan 2017 23:37:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 32B4627F99 for ; Wed, 25 Jan 2017 23:37:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 27A8D27FBB; Wed, 25 Jan 2017 23:37:00 +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 A8D6D27F99 for ; Wed, 25 Jan 2017 23:36:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751865AbdAYXg7 (ORCPT ); Wed, 25 Jan 2017 18:36:59 -0500 Received: from mail-by2nam01on0048.outbound.protection.outlook.com ([104.47.34.48]:15200 "EHLO NAM01-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750896AbdAYXg4 (ORCPT ); Wed, 25 Jan 2017 18:36:56 -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=8O/IBjjHIMlgj9ip5Mmp2nRq03Y/zbD/w/IVeAe9E/c=; b=g10NmjEyVCThGDSAzaioyX7Oc4lhPvXcK5+vWo/F0763CGv3B2v/JrixZNQngRP4KgEVa68z5zrFhRH+kkhulqhLM+Mt2ZEBCnI0KNqIUBXoMUebypLmHY5oIO+O8Ps6jU1unfQKoFF/RC49CvgWQMOk5Bcpkra2JdgORHu/GNE= Received: from CY1PR0201CA0032.namprd02.prod.outlook.com (10.163.30.170) by CO1PR02MB046.namprd02.prod.outlook.com (10.242.163.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.860.13; Wed, 25 Jan 2017 23:36:55 +0000 Received: from BN1AFFO11FD016.protection.gbl (2a01:111:f400:7c10::188) by CY1PR0201CA0032.outlook.office365.com (2a01:111:e400:58b9::42) 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; Wed, 25 Jan 2017 23:36:54 +0000 Authentication-Results: spf=pass (sender IP is 63.163.107.21) smtp.mailfrom=sandisk.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=bestguesspass action=none header.from=sandisk.com; 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 BN1AFFO11FD016.mail.protection.outlook.com (10.58.52.76) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.803.8 via Frontend Transport; Wed, 25 Jan 2017 23:36:53 +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 67.C8.65426.4C339885; Wed, 25 Jan 2017 15:24:53 -0800 (PST) Received: from milsmgip11.sandisk.com (10.177.8.100) by MILHUBIP03.sdcorp.global.sandisk.com (10.177.9.96) with Microsoft SMTP Server id 14.3.319.2; Wed, 25 Jan 2017 15:36:49 -0800 X-AuditID: 0ac94369-b62949800001ff92-22-588933c411e7 Received: from exp-402881.sdcorp.global.sandisk.com ( [10.177.9.6]) by (Symantec Messaging Gateway) with SMTP id 18.35.16817.19639885; Wed, 25 Jan 2017 15:36:49 -0800 (PST) From: Bart Van Assche To: Bart Van Assche CC: , "Nicholas A . Bellinger" Subject: [PATCH 05/34] target/iscsi: Introduce a helper function for TMF translation Date: Wed, 25 Jan 2017 15:36:17 -0800 Message-ID: <20170125233646.2243-6-bart.vanassche@sandisk.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170125233646.2243-1-bart.vanassche@sandisk.com> References: <20170125233646.2243-1-bart.vanassche@sandisk.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrELMWRmVeSWpSXmKPExsXCddJ5ke5R484Ig3ffuSzaVp9htGhd+pbJ gcnj/vYjTB6fN8kFMEVx2aSk5mSWpRbp2yVwZXS9+sVYsEC4onvDCsYGxkaBLkZODgkBE4mX Bw6xdzFycQgJLGWSePd8MitIQkhgB6PEjL9GMEW7Dr1ggijayCjRPGEtG0iCTcBI4tv7mSwg toiAgcTv3guMIDazQIjEvVsLwOLCQPbdP01gQ1kEVCVmfusFi/MK2En86jnFCLFAXmJX20Ww Gk4Be4nWsz9ZII6wk1h/oBVssYTAfRaJn2c/QzULSpyc+YQFYpmExMEXL5ghGtQlTi6ZzzSB UWgWkrJZSMoWMDKtYhTLzcwpzk1PLTA01StOzEvJLM7WS87P3cQICdnMHYx3n3gfYhTgYFTi 4RXY0hEhxJpYVlyZe4hRgoNZSYR3nVxnhBBvSmJlVWpRfnxRaU5q8SFGaQ4WJXFet3tfwoQE 0hNLUrNTUwtSi2CyTBycUg2Mrh4r7VPfW/09qCPLadnFW+hSvuWI7M+lt+ttLOo/Sd9z+sew tOfv6enzXOexV55ZN9eRJ+PdbjP1Gf2pF3l2vTjbW+DvMM++9PZ1O85S00lOxkbNXXmcN3c5 P/HZaLgxRz8yipPv0JkdZ1/+ZYk1vL56wvRLpxMeLEp6lGFSeLj11L7J3Cb8SizFGYmGWsxF xYkAE2SmZFUCAAA= X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprIJMWRmVeSWpSXmKPExsXCtZGTTXeiWWeEwZ0OJYuDP9sYLdpWn2G0 aF36lsmB2eP+9iNMHtPWnGfy+LxJLoA5issmJTUnsyy1SN8ugSuj69UvxoIFwhXdG1YwNjA2 CnQxcnJICJhI7Dr0ggnEFhJYzyjxcU0wiM0mYCTx7f1MFhBbRMBA4nfvBUYQm1kgSOLjyi42 EFtYIETi7p8mVhCbRUBVYua3XrB6XgE7iW1XdjBBzJeX2NV2EayGU8BeovXsTxaIXXYS6w+0 Mk1g5F7AyLCKUSw3M6c4Nz2zwNBQrzgxLyWzOFsvOT93EyPE05E7GJ9OND/EyMTBKdXAeOmn ldHDDIfXd+au+c12e822nndJQvp1awKKs+u27xddI8FkkWj313gju/fsqbuNlqRW37Q8KMAU zziz/eEjef5jJydUBSnbSz/dHHj5fl9XOvMKFt1zL3Y5X/kcbWsVuIvR67SNx4SNgYWLz/9c lPX43X4Rjsn2yztF3l2S/fNpKZNc48mitUosxRmJhlrMRcWJAEjCmZakAQAA 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)(39850400002)(39410400002)(39860400002)(39840400002)(39450400003)(2980300002)(438002)(189002)(199003)(2950100002)(6862003)(5003940100001)(189998001)(77096006)(38730400001)(6200100001)(5660300001)(8676002)(110136003)(68736007)(54906002)(6666003)(356003)(86362001)(50226002)(626004)(305945005)(575784001)(8936002)(81166006)(33646002)(50466002)(48376002)(92566002)(36756003)(2906002)(4326007)(76176999)(50986999)(47776003)(1076002)(81156014)(2270400002)(7049001)(97736004)(69596002)(53936002)(106466001)(1691005); DIR:OUT; SFP:1101; SCL:1; SRVR:CO1PR02MB046; H:milsmgep15.sandisk.com; FPR:; SPF:Pass; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11FD016; 1:6DMO0J6Y+0XT6hCGxpbRxu9yJCBX9/TtCFb6RuA79m4A5DOCNbdC40YSnJy0folaJSVM+P7Rk9Wq071fmO8Qc5/m9S6EOFsnh4X9VwUxpbrwzhT7fuz9cBO/nKfqKgnAqel9nRNUmI6Vh7rULZ6ysR7g6GpJkD/rMk+FKuM2Et4HrshQLFc2vCiTxAJWxUO6VyCcuvt3o6EiNz5gc6dwhGe4EPt/4nqVO3zsr+muE7BFoWfUB7rSjfjI8K46b94CvdBXNFjjlk3FqcVEBv2KHxSceM62yjy4iU9qUtOG8K9Gml7vwYA8veygv7xYlOUN1gO5pDcQ7lgjQx4eBqCyzkPB2E7IBAxu3uefT64Ug4JtSUqzTODEFycj63qWGzF/UwJo9yK3oDqRvclN5sBmMqXneyS9aMVpuUKcQ4IfX93H90ZQF/UCecfYGf/QEMiWgXItMaYQdmF5mdR3M8tiztvySc5wiRR1IuTBQYXWf2R9XuPYRltPGe22dIYj9uV0 X-MS-Office365-Filtering-Correlation-Id: 65122d2e-c82b-4e6a-11c9-08d4457b0b7e X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(8251501002); SRVR:CO1PR02MB046; X-Microsoft-Exchange-Diagnostics: 1; CO1PR02MB046; 3:cHwfVv2m1pY23OQe4Mk8izLtLqVtCinr9iTABKo+XGFN+7Gkeh6m7TiCvRkdv/b4h3R5NR6iq4MRXoGTG0AtKh+EYkiwegEYgN0fCGjtKPDZtJ7EWAaENjbZ/OhdxSaRcpcscYK1IPYs8MfaPbjK9NsE9nI3AEGUG4x5ZLUo2tirU2sm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S/9dydrivoMaaK+E+G+O6gtotXvPQOMysN0ehP4rYKQHQ63mQ39q6jEC3rAOpNQ9iW1bVtj94Wn/MqAxzj4bv23D3MTjNHfR3QVmy8BiI0r/5Y2uENLi0kYQg0r1fTc77wqID6aosvBj4aWjDd85a+VitklPYneHpsho9vm378zX+z3q57m2zuUGB2IEkg9ZmrM0d8UXecRYg2M50yd+HiY7efi6iQykGAMQM1zv7wkfJAoCDMe53A08ojvuUzxVWzM+v5iNzI39pQKwzmh9u1bBe5X1oN+bmdOrJDdpegaCRbtSjF+qiYSjO29H3nmhTknrwG+x2nsAhmHu8+sTUROYhVXiM2eskmFeoJJZMonrn+qyBLPgRHX9nDSMaWQfjuE0Vx8qk0R0aw2FzRg8L9RBi/YiEhQxgbCPjldvUeNpaeEc0zWf8HsFBB6U9L+MMoYhC9vz+H6xkdf2Q8OhQ603zb 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)(13016025)(13018025)(5005006)(8121501046)(3002001)(10201501046)(6055026)(6041248)(20161123562025)(20161123555025)(20161123560025)(20161123564025)(6072148); SRVR:CO1PR02MB046; BCL:0; PCL:0; RULEID:; SRVR:CO1PR02MB046; X-Microsoft-Exchange-Diagnostics: 1; CO1PR02MB046; 4:nO+73M9BLqcJiPT+EHLtGJ1NIjAcFKbX+LT+iMv2xV1U1Qps0gkEevuFybTqfCre4v2r3VI5Ow0lpcswvAmBHReWStz8alOk5Ek9nFJ9pURcqlGO9zPAKwX1tSglJms4o2ExNlpTSBq0c8mBqwYnBQlV8treCukIpL1el05kGFWz8sx529mVF3nqL1/+Ggr3V35/I3gvTaUaN/Auvn8BFH+/VVxCbDUt5iBAkytjCfjIQC3rcMttJFDaJdFCr2q7koeyzBIGawSjyDYDmTA5ZakjS3SY4VWK6Zt9MxiREaoI6miyZR981/DNzimi+jtTTk/cKwH+IULfyrmQ3jFa41OTxVQACwDSRRrh7ckQAM/Gn6h+n96k328ovvKk0Bwy2G2ZCL/MYSSaXJ5PR8dBeBbARNBW6eho2yZWLkMwWqHPikMnBNgs4dObVCPma5z3/O9VcFnfmcJ4ahI4EQStO15JRwJcAdEs7Sh6uQDgaD8ba7bHdRSGCLucnT+4drgnbpbqAq3mUKSYay4XN75Y9FuGkjrXlGZN4EsWyyqBzJWysgHwTt8P2T3T9xgumCceSRsXdPaJwMlSiacC4G8j7kAaCcjPH/hMMy667jQ1U5t9eDhCBCgOxKbbHAd5mUVauTv09BgNIDcKHt17q46s7uRcHY4yOP8SDh9R50H+Z98= X-Forefront-PRVS: 01986AE76B X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CO1PR02MB046; 23:G74VQxJq1mXgfS9/tzVXnVtcmmPMybeXgtULKSXqri?= =?us-ascii?Q?p3Hm7QRtjeZnTJDpxQFC3rlc7rNudRehGKsHFmLuZWZMNLV+BiFX2l4YrKLf?= =?us-ascii?Q?7k2xdcLDNglVKijtWOOqpuOr3FxLB61WYqv6nGAKOB4QUCjg49XKnb02sUUf?= =?us-ascii?Q?CYx589eZFWgmrt/R8cBurZS7WbIg0+UqLozBpJXbAgGirOo4PFzeEM4vDgJv?= =?us-ascii?Q?5P2gHQldWdo61QIyIy46BxStYWXZcpKDryEbU+nuD/YWG1MJY3dcfO+igFcw?= =?us-ascii?Q?pl7vu0p73lCvlfe8qWmcuPp9WnXiyetVY66abJG/GhjfndJ6fzW4BAr9SBvB?= =?us-ascii?Q?97FubPuEiP6Z9x5qoRnKO9+Ynea/dvgbc/SK1TfWy79u7I3izPzPEKJWpQeU?= =?us-ascii?Q?UI//Xfe7Wunpqr7dJT+ECm2JFWhZUzgl4KTVYXrWxDWjAwQD8oShz4ZQIcVJ?= =?us-ascii?Q?4X/puKVi1ycTpkqeJRRBfhunGj/ukRciRNxDty7iPHSkjQD/PKBxLD3DkX5R?= =?us-ascii?Q?z9D9fd8jtaB5YrFF+fDsXOjAur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IFfCyPru2lSIarprKtI529Fy32bjcZvA0jpwQWvQBTOU6fnPPw== X-OriginatorOrg: sandisk.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jan 2017 23:36:53.9380 (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: CO1PR02MB046 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 This patch does not change any functionality. Signed-off-by: Bart Van Assche Cc: Nicholas A. Bellinger Reviewed-by: Hannes Reinecke --- drivers/target/iscsi/iscsi_target.c | 52 ++++++++++++++++++++----------------- 1 file changed, 28 insertions(+), 24 deletions(-) diff --git a/drivers/target/iscsi/iscsi_target.c b/drivers/target/iscsi/iscsi_target.c index e11f8d0f1fa3..3696cfbf1cf5 100644 --- a/drivers/target/iscsi/iscsi_target.c +++ b/drivers/target/iscsi/iscsi_target.c @@ -1920,6 +1920,32 @@ static int iscsit_handle_nop_out(struct iscsi_conn *conn, struct iscsi_cmd *cmd, return ret; } +enum { + UNKNOWN_TMF = 0xff +}; + +static enum tcm_tmreq_table iscsit_convert_tmf(u8 iscsi_tmf) +{ + switch (iscsi_tmf) { + case ISCSI_TM_FUNC_ABORT_TASK: + return TMR_ABORT_TASK; + case ISCSI_TM_FUNC_ABORT_TASK_SET: + return TMR_ABORT_TASK_SET; + case ISCSI_TM_FUNC_CLEAR_ACA: + return TMR_CLEAR_ACA; + case ISCSI_TM_FUNC_CLEAR_TASK_SET: + return TMR_CLEAR_TASK_SET; + case ISCSI_TM_FUNC_LOGICAL_UNIT_RESET: + return TMR_LUN_RESET; + case ISCSI_TM_FUNC_TARGET_WARM_RESET: + return TMR_TARGET_WARM_RESET; + case ISCSI_TM_FUNC_TARGET_COLD_RESET: + return TMR_TARGET_COLD_RESET; + default: + return UNKNOWN_TMF; + } +} + int iscsit_handle_task_mgt_cmd(struct iscsi_conn *conn, struct iscsi_cmd *cmd, unsigned char *buf) @@ -1985,30 +2011,8 @@ iscsit_handle_task_mgt_cmd(struct iscsi_conn *conn, struct iscsi_cmd *cmd, target_get_sess_cmd(&cmd->se_cmd, true); sess_ref = true; - - switch (function) { - case ISCSI_TM_FUNC_ABORT_TASK: - tcm_function = TMR_ABORT_TASK; - break; - case ISCSI_TM_FUNC_ABORT_TASK_SET: - tcm_function = TMR_ABORT_TASK_SET; - break; - case ISCSI_TM_FUNC_CLEAR_ACA: - tcm_function = TMR_CLEAR_ACA; - break; - case ISCSI_TM_FUNC_CLEAR_TASK_SET: - tcm_function = TMR_CLEAR_TASK_SET; - break; - case ISCSI_TM_FUNC_LOGICAL_UNIT_RESET: - tcm_function = TMR_LUN_RESET; - break; - case ISCSI_TM_FUNC_TARGET_WARM_RESET: - tcm_function = TMR_TARGET_WARM_RESET; - break; - case ISCSI_TM_FUNC_TARGET_COLD_RESET: - tcm_function = TMR_TARGET_COLD_RESET; - break; - default: + tcm_function = iscsit_convert_tmf(function); + if (tcm_function == UNKNOWN_TMF) { pr_err("Unknown iSCSI TMR Function:" " 0x%02x\n", function); return iscsit_add_reject_cmd(cmd,