From patchwork Thu Feb 2 00:58:21 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: 9550883 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 30DA860236 for ; Thu, 2 Feb 2017 00:59:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1C43C2844A for ; Thu, 2 Feb 2017 00:59:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 115AD2845B; Thu, 2 Feb 2017 00:59:08 +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 8859B2844A for ; Thu, 2 Feb 2017 00:59:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751394AbdBBA7G (ORCPT ); Wed, 1 Feb 2017 19:59:06 -0500 Received: from mail-by2nam03on0049.outbound.protection.outlook.com ([104.47.42.49]:33920 "EHLO NAM03-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751311AbdBBA7D (ORCPT ); Wed, 1 Feb 2017 19:59:03 -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=Nhj0vVARLBa2Dfz1EBxIQ16tJL1TNZYpwqOZyDBtga0=; b=gzljm2vvljMFkfz0aHsoxXN0heP7OdIU2i1gA23bnIH8XDrzG+3ZbMZyTEVrvEVVMLWYFvZr2ugecMqMA2vwbOvGD+lMTvK3QvqeeoneyNOdd0BEZqltf2Uy1OWdPL2Q2AfWWFu5H7PC1Wlt2fdKwO86KLBKWfYhl9UIRTsBCHE= Received: from BY2PR02CA0029.namprd02.prod.outlook.com (10.141.216.19) by CY1PR02MB1415.namprd02.prod.outlook.com (10.161.171.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.888.16; Thu, 2 Feb 2017 00:59:01 +0000 Received: from BY2FFO11OLC006.protection.gbl (2a01:111:f400:7c0c::157) by BY2PR02CA0029.outlook.office365.com (2a01:111:e400:2c40::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.888.16 via Frontend Transport; Thu, 2 Feb 2017 00:59:01 +0000 Authentication-Results: spf=pass (sender IP is 63.163.107.225) smtp.mailfrom=sandisk.com; linux-iscsi.org; dkim=none (message not signed) header.d=none;linux-iscsi.org; dmarc=bestguesspass action=none header.from=sandisk.com; Received-SPF: Pass (protection.outlook.com: domain of sandisk.com designates 63.163.107.225 as permitted sender) receiver=protection.outlook.com; client-ip=63.163.107.225; helo=milsmgep14.sandisk.com; Received: from milsmgep14.sandisk.com (63.163.107.225) by BY2FFO11OLC006.mail.protection.outlook.com (10.1.14.199) 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:01 +0000 Received: from MILHUBIP04.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 79.BC.01420.C0282985; Wed, 1 Feb 2017 16:49:17 -0800 (PST) Received: from milsmgip11.sandisk.com (10.177.9.6) by MILHUBIP04.sdcorp.global.sandisk.com (10.177.9.97) with Microsoft SMTP Server id 14.3.319.2; Wed, 1 Feb 2017 16:58:57 -0800 X-AuditID: 0ac94371-7ee9b9800001058c-98-5892820cf949 Received: from exp-402881.sdcorp.global.sandisk.com ( [10.177.8.100]) by (Symantec Messaging Gateway) with SMTP id CB.63.16817.05482985; Wed, 1 Feb 2017 16:58:56 -0800 (PST) From: Bart Van Assche To: Bart Van Assche CC: , "Nicholas A . Bellinger" Subject: [PATCH v2 04/36] target/iscsi: Introduce a helper function for TMF translation Date: Wed, 1 Feb 2017 16:58:21 -0800 Message-ID: <20170202005853.23456-5-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+NgFjrILMWRmVeSWpSXmKPExsXCddJ5kS5v06QIg1etbBZtq88wWrQufcvk wORxf/sRJo/Pm+QCmKK4bFJSczLLUov07RK4Mh5s/8dY8E+s4uP7RtYGxrnCXYycHBICJhLr mk4wdzFycQgJLGWSOHL5ICNIQkhgK6NEx5pgmKLFP58xQRRtZpRY9vEmC0iCTcBI4tv7mWC2 iICBxO/eC2DNzAIhEvduLQCLCwuES/RMP8IMYrMIqEjsfT8TqIaDg1fAXmLfISuI+fISu9ou soLYnAIOEouPQ4wUAir59ucoC8heCYHnLBLvr1wCm8MrIChxcuYTFohdEhIHX7xghmhQlzi5 ZD7TBEahWUjKZiEpW8DItIpRLDczpzg3PbXA0ESvODEvJbM4Wy85P3cTIyRgC3cwvr7tfYhR gINRiYdXQGRShBBrYllxZe4hRgkOZiURXt9GoBBvSmJlVWpRfnxRaU5q8SFGaQ4WJXHe1tf9 EUIC6YklqdmpqQWpRTBZJg5OqQbGpQFX+8rtD/5/tH29pHjyBbnbjF2bfy87qt3bHuFqlXXb R7VtztWtUdfk8r1+zb4vfEymKufxa2tr/emi6XrSlrIZFjuzBEJks3zvtKn93GfWKfXS/+X0 BeyTvPm98/t2GjO87WY82d6l9f5nivVcv+8+ofMv+hSfl53ONs9/dYNqp4rfn4lKLMUZiYZa zEXFiQBkkC+GVAIAAA== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprEJMWRmVeSWpSXmKPExsXCtZEjRTegZVKEwePXBhYHf7YxWrStPsNo 0br0LZMDs8f97UeYPKatOc/k8XmTXABzFJdNSmpOZllqkb5dAlfGg+3/GAv+iVV8fN/I2sA4 V7iLkZNDQsBEYvHPZ0xdjFwcQgIbGSWOr5vHBpJgEzCS+PZ+JguILSJgIPG79wIjiM0sECTx cWUXWI2wQLhEz/QjzCA2i4CqxJlDZ8HqeQXsJT5OusUEsUBeYlfbRVYQm1PAQWLxcYiZQkA1 3/4cZZnAyL2AkWEVo1huZk5xbnpmgaGhXnFiXkpmcbZecn7uJkawrzkjdzA+nWh+iJGJg1Oq gdH7xjGLS3d/rzgR4LZtJj87y9npN8zk9rIc+HCO9YZ9fpiObMbSV0r1EuXrf5vUi01P3zDj 91nrxvt7b+9dxBQklLeuXvqXxErh3zKHXqb8O2V235P3qld6UMyC3A2xirL1i5xY1jBeYL9r r3/HardmXsxXxw7luZdl1/JxnE8MP2xyZXvoQUYlluKMREMt5qLiRABqDv3QpQEAAA== MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:63.163.107.225; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(7916002)(39860400002)(39850400002)(39410400002)(39450400003)(39840400002)(2980300002)(438002)(199003)(189002)(1691005)(76176999)(68736007)(5003940100001)(50986999)(8676002)(97736004)(6862003)(47776003)(110136003)(626004)(356003)(50466002)(48376002)(36756003)(8936002)(5660300001)(305945005)(81166006)(81156014)(69596002)(1076002)(33646002)(53936002)(2270400002)(6200100001)(4326007)(2906002)(106466001)(50226002)(92566002)(2950100002)(54906002)(6666003)(575784001)(7049001)(189998001)(38730400001)(86362001)(77096006); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR02MB1415; H:milsmgep14.sandisk.com; FPR:; SPF:Pass; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11OLC006; 1:fwTQqI/U8yIqSyJ0UEd9MLpaIu9fWgHj4KR3+gx5OfQnSAk5AX/m6pZnCAlfeXe+dn2qd5gQDieWYNzCKWPDHn5taKrjXSZ2LL+imM5XOwC44AUImwskcXWRfdCK8YPyfePNL9ha2vhjSWgVl9Ro1mTLFod7Ou5z51XE5W0BPh2DXhB/DtVRopNXUBVGUtT4PysJFZg4xlXN27sxCgncGlTmr4VtIXeGmb+3p2zDSxBJgv7eWxhHxcRxTHmwYLrEDBerumVJ1Xxjc3W8zx72orQrF/6kjb67T745nmRpvJQ0atBoWyRYmOuKRgujynNsp9lncu1RW41hZnFNvahz8mPDAfDOPWKEdUQOln3hfnSiQ7+Idmp9DqFodnbm4SqSqekQlWNS/rsBQouqvmU0lMoCQ0jFqWekHM3k/QIXv4HyO5zXaSSZrapMeSMyS4Bv8nCwk8xcqjbkYlhQ0OyeW9HsxWuQB0zSSgdw/9nNQum1T3sW1mwqOLcaxZStAbtl X-MS-Office365-Filtering-Correlation-Id: 1933462c-51ae-4765-26fd-08d44b06ad2c X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(8251501002); SRVR:CY1PR02MB1415; X-Microsoft-Exchange-Diagnostics: 1; CY1PR02MB1415; 3:23Hl7e7fvw4L5G26peQloL/mv676EQPfr2HbKCoS+fAoUOqKIJphDTZ+wTmJEPgo/rs6joTJk9YM/d3FuhohdQJJ50x6CBvpYoKH0rV95D2WM2MscjV57LqWjBuJbrKa/Tx9Dbpx74j13xkhTVPAHJo2fZukz4AMrpL/yGho+YQv3PCnAU7tyAqcqbgRT4x/Av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6rM8hSg07qf/wSbYsE22XhDq/srYnEvU9PbuUjPEGq4oYCLCHbFJ2qLYziXPaczFHLUn7yfAzv19tLN5D7OUEfAd4+bRYJglai21ZGxulV/BfULbT8q+xvt2mYd/kjiNOvTmjnEqFtPGzm8SAXe6KDSObm02MHPzOWmQaGjQDkS2f0rNwMf+cN+EwuM87mdpxmfUn28HVGJdnu/7OVUTjsomgzVowIkO1fOCIN4jSPW+N11jb0OA/80FUpDJJzBNeOLc4AMiFjtckIKnhDD05Ykq7fhhSUVl2tX47ZuFb0DagfQhykhLOrC+nm5rm3Z3+SMhU9mbsjR5yCD6FWQ//Pp2SqTyPBEQgXZhL918AWnGk8lLjkFvVAz5ynRe5ZYu9SYnvHhjb5g6RVC/ZyNja8vV5KcDxnfZsuxAxU6Tf+vGjWX4TycLo2nrbnHSUDHUToyUFGSq/YO9kxyqVu 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)(8121501046)(5005006)(13018025)(13016025)(10201501046)(3002001)(6055026)(6041248)(20161123558025)(20161123560025)(20161123564025)(20161123555025)(20161123562025)(6072148); SRVR:CY1PR02MB1415; BCL:0; PCL:0; RULEID:; SRVR:CY1PR02MB1415; X-Microsoft-Exchange-Diagnostics: 1; CY1PR02MB1415; 4:kgdHwtvuaVzlCgdnpz/HwOz2tiU0hyc0cTHp/cuRjYulJ4VhtGqCXP0NqLVWQ/cROlX9eutvQx7l/VXW1EZsQn1wM8UxjYaj9hWcmBmHNrOF+a7D66Bq/oW2tPsQ6OykdVjbiVHy7hMAWs0X7lXiFq4Bsy5GQiFX3j5oZg0ByLf1dloHk6i9n9h8d6Unhu67aqcXdzvGCZ/aT+MjET2eQ9ZBBRq1MbaaG7oA3t11/h1o43iVd/8LTagRc+ZiTaZhE0SLevBBiPpB0f04YU0Eq1G631Ylv9cChDK60C7rA6z8u+oWGkYzrZZMJF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et66H0RiRpKx72gPCCZByupMI0Y0TgMVhASGHLEXxGDeRpHg1pH5cNBm2T+jAT+g9Ajof83idInonkSfqngPPYnjBsweovgB3wHMFjl/w3PJLPogVvkXYK9JYKCijfQ+0Ipe95SIJVd0YxjLLOPrWKTQZSra86yVhxWPwTG9eIZ7zAHgg== X-OriginatorOrg: sandisk.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Feb 2017 00:59:01.3165 (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.225]; Helo=[milsmgep14.sandisk.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR02MB1415 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 Reviewed-by: Hannes Reinecke Cc: Nicholas A. Bellinger Reviewed-by: Christoph Hellwig --- drivers/target/iscsi/iscsi_target.c | 48 ++++++++++++++++++------------------- include/target/target_core_base.h | 1 + 2 files changed, 25 insertions(+), 24 deletions(-) diff --git a/drivers/target/iscsi/iscsi_target.c b/drivers/target/iscsi/iscsi_target.c index e11f8d0f1fa3..d16729fa1f67 100644 --- a/drivers/target/iscsi/iscsi_target.c +++ b/drivers/target/iscsi/iscsi_target.c @@ -1920,6 +1920,28 @@ static int iscsit_handle_nop_out(struct iscsi_conn *conn, struct iscsi_cmd *cmd, return ret; } +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 TMR_UNKNOWN; + } +} + int iscsit_handle_task_mgt_cmd(struct iscsi_conn *conn, struct iscsi_cmd *cmd, unsigned char *buf) @@ -1985,30 +2007,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 == TMR_UNKNOWN) { pr_err("Unknown iSCSI TMR Function:" " 0x%02x\n", function); return iscsit_add_reject_cmd(cmd, diff --git a/include/target/target_core_base.h b/include/target/target_core_base.h index 43edf82e54ff..b9cf71692acc 100644 --- a/include/target/target_core_base.h +++ b/include/target/target_core_base.h @@ -197,6 +197,7 @@ enum tcm_tmreq_table { TMR_LUN_RESET = 5, TMR_TARGET_WARM_RESET = 6, TMR_TARGET_COLD_RESET = 7, + TMR_UNKNOWN = 0xff, }; /* fabric independent task management response values */