From patchwork Thu Feb 11 12:27:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 12083081 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 93F0FC433DB for ; Thu, 11 Feb 2021 12:32:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7377764D79 for ; Thu, 11 Feb 2021 12:32:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230219AbhBKMbo (ORCPT ); Thu, 11 Feb 2021 07:31:44 -0500 Received: from aserp2120.oracle.com ([141.146.126.78]:42006 "EHLO aserp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231394AbhBKM2i (ORCPT ); Thu, 11 Feb 2021 07:28:38 -0500 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 11BCPhiV050907; Thu, 11 Feb 2021 12:27:41 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2020-01-29; bh=drov18IvbxJcf1RpDKUP9FgkY5cU2xGkcthCPJKMhSQ=; b=kSIFVzBLjge2XWxng/8T/cXdXwnuhDdYWmP2EIlKPCJ2MfEog3hww2x9LKtsfppQqDZR XGe6x8UxOkHGJY5zbEP1/VlsrDsWD7hwM5/hTpmWXhK/7dAdWdN5OaKZDlQmQ1rmYEqh LjS7WEpGncJe5XDmBk2ixjYNJU9T3c0i9iAtvm43QRzOh47aU2B3KPzu7mq9Ae6+bOQ5 zDDzuv59azBRDwpylV7VVBQEESKvmO63x6OadET0XzOjM27QD2LsN5CB1QeKskZ1MJcY 8kdGqomeTcwjOo0e43Zg+xChK1MA1mqgyF7rVPx3y4RxgoDOFek/fIcSM1H59M96I/kN Dw== Received: from userp3030.oracle.com (userp3030.oracle.com [156.151.31.80]) by aserp2120.oracle.com with ESMTP id 36m4upws49-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 11 Feb 2021 12:27:41 +0000 Received: from pps.filterd (userp3030.oracle.com [127.0.0.1]) by userp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 11BCP6Df052161; Thu, 11 Feb 2021 12:27:40 GMT Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2105.outbound.protection.outlook.com [104.47.55.105]) by userp3030.oracle.com with ESMTP id 36j51yxtuj-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 11 Feb 2021 12:27:40 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NyxOMA4oUUr3dPOPXmYD0c5lp+Oh8oA/mWWVQjbSNTHZmQ+hNasp0G8rv/sQE8Qju4uwWu8hoNMBALEj+q3OAjprOmOnMrx/tITgpi8/152wj13YgaXgSvRgSBt1k6BY5+eXRKinyL5j3uXbjkmZXGMvGCNEPknTdXFnpbLG2tohmbcFfNBD1eBD/8rGXV66HEMPnKvZnMaffa2Kxm2bw4QyunoSvcg78hewR9P65lxrfEWwtJEDc4f2JSDIFeVQobQZf+c+bbViVudSsD8TWFLOt4RPB0RXJAAzHN5noKi6IjGliRMst/qeV0MDX3Rwy0zBG+VQzDsozxB5BnUNmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=drov18IvbxJcf1RpDKUP9FgkY5cU2xGkcthCPJKMhSQ=; b=hfBeT62/Xk+F38X68llZdPUpSsZ0/F7PimYFL0pM5R1CHfeqpbeUFAlvvxSECPj8R0hUO2lmAgd2bAfYr5Ed2QF+hlsQDWyk4VJvrkbAFCes8i67Dj+8/EcOcof4V0eKoK7x7PiTatrt87QdqhV2iSJ6ZMbNeKv/dRmYUsJS+Hx4GSpajpeLt2k1Y9XWve31ODm6LY54FkOfmaB4nKEoiPgwoR0WUClUkqZ/yo47OPiep5f70Ez+LLIcxfGHEuuS1s5k+yoTSLvs5HzYRc3ubuXiSeW/YL4SO0KOa4XDLWDWzvj8qp3DqjN0+FYyMOs34DLS99TiZF+O+kAJ/ElOig== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=drov18IvbxJcf1RpDKUP9FgkY5cU2xGkcthCPJKMhSQ=; b=XzY0Kjewi0Yg06c3uZ9u+r6nANfHDKp9uL1/QX9LEqasATpDOSrQ9rvAVqD5dXGMOJ7b0zI9PcKwG2XSwD1EJU3TomE2LNaotcw7hH3l1PzGxfY9R7Zz5jvjyMoZ6uckvVc+dH5lFZdvX0DL3QW5Rmx506g5zuCSkNiqvReu8mY= Authentication-Results: lst.de; dkim=none (message not signed) header.d=none;lst.de; dmarc=none action=none header.from=oracle.com; Received: from BYAPR10MB3573.namprd10.prod.outlook.com (2603:10b6:a03:11e::32) by BY5PR10MB4339.namprd10.prod.outlook.com (2603:10b6:a03:20a::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3846.27; Thu, 11 Feb 2021 12:27:39 +0000 Received: from BYAPR10MB3573.namprd10.prod.outlook.com ([fe80::1d86:b9d7:c9ef:ba20]) by BYAPR10MB3573.namprd10.prod.outlook.com ([fe80::1d86:b9d7:c9ef:ba20%7]) with mapi id 15.20.3825.030; Thu, 11 Feb 2021 12:27:39 +0000 From: Mike Christie To: hch@lst.de, loberman@redhat.com, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, target-devel@vger.kernel.org, mst@redhat.com, stefanha@redhat.com Cc: Mike Christie Subject: [PATCH 01/14] target: move t_task_cdb initialization Date: Thu, 11 Feb 2021 06:27:15 -0600 Message-Id: <20210211122728.31721-2-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210211122728.31721-1-michael.christie@oracle.com> References: <20210211122728.31721-1-michael.christie@oracle.com> X-Originating-IP: [73.88.28.6] X-ClientProxiedBy: CH0PR04CA0060.namprd04.prod.outlook.com (2603:10b6:610:77::35) To BYAPR10MB3573.namprd10.prod.outlook.com (2603:10b6:a03:11e::32) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (73.88.28.6) by CH0PR04CA0060.namprd04.prod.outlook.com (2603:10b6:610:77::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3846.25 via Frontend Transport; Thu, 11 Feb 2021 12:27:38 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 19032911-8b5c-4928-5d62-08d8ce886b96 X-MS-TrafficTypeDiagnostic: BY5PR10MB4339: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6790; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: rqrLxRx3oo/XJwtxQKE3H8uPCs/0oBCpRWHV4ooIJb8a1WyEjCBbP9n5Aqwoyhwr8+fx4AdOTdwlZuJGMfWyvR88A8A2SfKtbOlnJ4tn7eQyVDiBZxoXTeNMp8qh/CnjK931d0yiJK9zBbzQqZKmMoZNRfydcoHWse0v9HWJwGwQRrX2e8gdIpRUKhd6qzG8i+jhEaN560Sx0iezl9wBVV9BFv7/NbgbLySVpL8Ry6d6wvh7WeARiu8jG+uUmM8aWYFG0QTPfjtpcEUSnunMmkxIANQZei7vO7apu39mhduBX9s8OAreUexXFp8p4imfP6+gutpgOR4CcmNSliGuSE8PBR3rkFIuDMDJDNujztUFp/XWsP+jJZyJai93bK8DbKj9RGpBShNmrG80tVGs/Gpb10HWXbM5OesGg+oVevGgI+aY+UwoiQN+q2gGR5Gsw0umIoAKwCulpLdLh5dVdfrApfg8njRKCMbpMSTQ2Ws72LLypz/ICRJ461tLNXSM6/+QnO2XFgv2ja+g2tP2+/1FhWYc0Uy3GstcOItiw7HBSfCIigtnJ1vMPQ5Vq7a42zunhIMqF7RwkJFtY8tzeg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BYAPR10MB3573.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(366004)(346002)(39860400002)(136003)(376002)(396003)(83380400001)(1076003)(6512007)(16526019)(2906002)(107886003)(4326008)(6506007)(478600001)(316002)(186003)(6486002)(8936002)(26005)(52116002)(66946007)(86362001)(6666004)(8676002)(2616005)(36756003)(5660300002)(66556008)(69590400011)(956004)(66476007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: MmD77CMZo0EJ1yFdZcDxBj2JuvvChCWxW3Aadz2KLQgqEaw8fFuBcDS3Ne54hy7oBsi51g2x6+QuKq9bGNzJKmPXcqtmchm2CR4sgCM9YgFfsd+kHQXNoFwRDynU2MeAJaD1lnUw5ly4JMTj8+Gv8/zm9jDG0Yo/xtTyX+yiSvPy4eb31nNgygc6WfyHwQMr3y8/cb5uWkbZ7aIIkoJZvi3ngcwlmpmDxAAiz+hvoFN4rgppAwfXWcQTcw+pElyO4cJkEWBRpSVtNizdM82hOSvNXTvTa64oqrGLvufWR+YqOjsVamEz9qIGWOCrkglKvrFc+dah7O4S9RNROKmfIbC1gIHouuMkEahspWmOijiz+Z/qIWpPPYYaiKW8iKIRX/5jW/51kcjFPbUY219GPZjjXd68gCuAJvmvSWXonPcSxcHrdZl9XDXW14zI1vPyVmadfE4LrjR1rKx/T2F6KTkXeAZ3ysZLpE0GZi47AbhIPPh9tnZ8c5ZUeMUuNTUvZX7SEeRArZxuKUJCd9hkoJB+/lD5i0bpnMdxN6Fvh7iS7qyJKgt+MuMRNWb4JJKWmpmbQgK50r/2wgwKL9JVLawaSFyVgjLakDT+x/qAlyAvoWPt90Lgpa31y69+oTXIzEUSzoqyrqeWkLMYiq8Q6n60HuoN4+s7Tm0Kg8XkSTHlVol91kXp6UQDDLIlc0XihSQzIHDtdwPYqq94cnI/9N+ngeQXh1qsa3LXQikpAd1TWMOHUTjHhfqeoMASzjLqYvybSlg5U6GcGXCSBs9DQbmEHenWd4gSt/uB//bKjcU1usgzKkO1DJSn8Qx8xuHnRKWq509iIgTygsZkqBiOcA8BmytgqG45nx9QgS8wbXtzdN6j8MnMJQdhWHImGxCWS1UOe2l9/F6eoFTXP3EMHPK77RSg23JoO4m/SHnt1O1/t3xnHRG8ouxVzCcWak5bkWU8gfdkI+ex18KZZtouQ0PT9b2KDbLOW0iU5F4jeIA/j6efBQbu564v1eEJvbaezpfwQNTMdrRvattEcszQndKkwRya1OUySH8MTw72XNp3r5+N9vLOwkbkHx/auG1K2kxNQarbKsURyo03JAVWovxGsbfC9UKqoV6WBnx8FlAUWmrBovmpFPBtS7B3wBvqxiqeOvSqVWO8/bUn8tUuAXJ5jmhi4ro4nWd4qci12T07Cq94vwtptdjRTmWbUkuZWV6c8RufqEwht78aBWaxN9QSQdmXMFmUYk+yVEbU3ZpLYy0An2IDo+K+1AD9ZH+RuvucXLRy2LNC1auGoMAo3gki9UAwZQDom7fIJA/gfZ6wp8Fcp7H2iv1nEX0tC60b X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 19032911-8b5c-4928-5d62-08d8ce886b96 X-MS-Exchange-CrossTenant-AuthSource: BYAPR10MB3573.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Feb 2021 12:27:39.2503 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: I6bUskpzVB8paz1CPNxRdylqxzupTEGdVhBd/FoBgDvk8+w2IpciWAK3kGZXbznQxSXq1kV6G1Nxcx2TFLrvN70qi7bCimKFuXbxj8sUwaM= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR10MB4339 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9891 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 spamscore=0 phishscore=0 mlxscore=0 malwarescore=0 mlxlogscore=999 bulkscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2102110111 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9891 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 mlxscore=0 mlxlogscore=999 spamscore=0 impostorscore=0 malwarescore=0 clxscore=1015 suspectscore=0 adultscore=0 bulkscore=0 lowpriorityscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2102110111 Precedence: bulk List-ID: X-Mailing-List: target-devel@vger.kernel.org The next patch splits target_submit_cmd_map_sgls so the initialization and submission part can be called at different times. If the init part fails we can reference the t_task_cdb early in some of the logging and tracing code. This moves it to transport_init_se_cmd so we don't hit NULL pointer crashes. Signed-off-by: Mike Christie Reviewed-by: Christoph Hellwig --- drivers/target/target_core_transport.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c index d47bfd8b0f87..5c4adde96d5e 100644 --- a/drivers/target/target_core_transport.c +++ b/drivers/target/target_core_transport.c @@ -1389,6 +1389,7 @@ void transport_init_se_cmd( INIT_WORK(&cmd->work, NULL); kref_init(&cmd->cmd_kref); + cmd->t_task_cdb = &cmd->__t_task_cdb[0]; cmd->se_tfo = tfo; cmd->se_sess = se_sess; cmd->data_length = data_length; @@ -1430,7 +1431,6 @@ target_cmd_init_cdb(struct se_cmd *cmd, unsigned char *cdb) { sense_reason_t ret; - cmd->t_task_cdb = &cmd->__t_task_cdb[0]; /* * Ensure that the received CDB is less than the max (252 + 8) bytes * for VARIABLE_LENGTH_CMD From patchwork Thu Feb 11 12:27:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 12083079 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4BC20C433E6 for ; Thu, 11 Feb 2021 12:32:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 18B0064E2E for ; Thu, 11 Feb 2021 12:32:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229577AbhBKMbi (ORCPT ); Thu, 11 Feb 2021 07:31:38 -0500 Received: from aserp2120.oracle.com ([141.146.126.78]:42028 "EHLO aserp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231396AbhBKM2h (ORCPT ); Thu, 11 Feb 2021 07:28:37 -0500 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 11BCQLJg051499; Thu, 11 Feb 2021 12:27:43 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2020-01-29; bh=Y1wyS6xzoLzfxeFA2GCG/qtoPnZNLF0qz5NjTir0KI4=; b=nLet5o2iKr0KHGhbL7L0RK0FtrzR8HlyuSakZ/jjmHLp01XZhVocSkcTXYEchKu3fArM VPLwr4kRRU18bAUlvjpQ5d9VC/h6LdABdXHA1hjr+CH/g7Zbhm9LyI0M+ewsWeHOjqaP F64hjYpJU2j/XVJddBvh5zXVykYGduv05DzLZmw3hoCN9RyGks0OZFyC2XV2xHXXAPsg s8+VcFMSft7rMkIPqVMI2/2HthXhrKizGnkFtQSICsHf7tRqq72tbRpx/ZkRleZmBuvv vygdLa0/5gcuQu0m4qBrH4+JF5UaDdoCq4QgZ3q1o210/U1qYo3PURlY9oyv6rs1KVMX 1A== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by aserp2120.oracle.com with ESMTP id 36m4upws4b-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 11 Feb 2021 12:27:43 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 11BCOn9t068569; Thu, 11 Feb 2021 12:27:42 GMT Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2100.outbound.protection.outlook.com [104.47.55.100]) by userp3020.oracle.com with ESMTP id 36j4vu69v3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 11 Feb 2021 12:27:42 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=g9AvE1R8N2xrNYlMtwFKVwcEZLyqoK60SebVyardMHBRAlq0vcdsKoTciZiEIsTywuxXJWqAsYBRGd6C9vJOL/KjD7aTenmLSisFZzuj9wq0gDvR4X7AjPlD6WuCYENWEU3EClRehLE/mxA8RN+d5oaNszFhEOSTAIvD3ah8HF7iG7snwtovf/AEwL96OFBCk+WXxAOEaGvwAMhxgG2L1Z8M3CO2ag+xnccdg7vh2Gvzc6UyErNLnqpKB55wDGiAW+tNo7R/oYMDE2AR5ROPF/pKZbGe/J7rOllMHH/PnEQlo+77qERAA7+1MzakA07MP2nxlONBV4s5018bvS2pDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Y1wyS6xzoLzfxeFA2GCG/qtoPnZNLF0qz5NjTir0KI4=; b=TFhrpEzuI5RuQWyf35xnybiGTA24Id/BYQj3p8Ag3gl+ItAu0VpxA9t1G2psycV9w5RP2gqlqOxMnrLvfHQEsbeSDoRpbRVkoUWUSNuIztBMtUaqYQUBG8bLSOC4B+M8Ab5fTJ6mkZuj4+s8KCY0hHeVkP8ZoTZEFDaD8pfsfQa7N7PCfR7QGzs/9OJLcZeNIMN4XZCJ68BuF+tLSPpGavtrjl9WVxDhIe6BJOjda34tjIsHMFUcsy8/IPOFwvD8MSrV0dJUkFg6s6pSmciclaBZA1CwoTElEWVNNwGmCjuaW0NgvnpM69vrRLkSjxKzKwRv4agGS5z8Y+PnlRhh+w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Y1wyS6xzoLzfxeFA2GCG/qtoPnZNLF0qz5NjTir0KI4=; b=qs6EEMUgALeYul+F376d31YMSvGsQIi5BEbNE3fTTyabfg/noTA0I79STntrH+nxaplF3pSJK7aY3F+md6hSYkQMr2imnvTpWBemLjxJtsYbERe5fScROyfPfJ0hzmZDRC+NwPhW/UidUIcjpsx712xxBT4roj2XkZWYRSH2WwA= Authentication-Results: lst.de; dkim=none (message not signed) header.d=none;lst.de; dmarc=none action=none header.from=oracle.com; Received: from BYAPR10MB3573.namprd10.prod.outlook.com (2603:10b6:a03:11e::32) by BY5PR10MB4339.namprd10.prod.outlook.com (2603:10b6:a03:20a::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3846.27; Thu, 11 Feb 2021 12:27:40 +0000 Received: from BYAPR10MB3573.namprd10.prod.outlook.com ([fe80::1d86:b9d7:c9ef:ba20]) by BYAPR10MB3573.namprd10.prod.outlook.com ([fe80::1d86:b9d7:c9ef:ba20%7]) with mapi id 15.20.3825.030; Thu, 11 Feb 2021 12:27:40 +0000 From: Mike Christie To: hch@lst.de, loberman@redhat.com, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, target-devel@vger.kernel.org, mst@redhat.com, stefanha@redhat.com Cc: Mike Christie Subject: [PATCH 02/14] target: drop kref_get_unless_zero in target_get_sess_cmd Date: Thu, 11 Feb 2021 06:27:16 -0600 Message-Id: <20210211122728.31721-3-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210211122728.31721-1-michael.christie@oracle.com> References: <20210211122728.31721-1-michael.christie@oracle.com> X-Originating-IP: [73.88.28.6] X-ClientProxiedBy: CH0PR04CA0060.namprd04.prod.outlook.com (2603:10b6:610:77::35) To BYAPR10MB3573.namprd10.prod.outlook.com (2603:10b6:a03:11e::32) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (73.88.28.6) by CH0PR04CA0060.namprd04.prod.outlook.com (2603:10b6:610:77::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3846.25 via Frontend Transport; Thu, 11 Feb 2021 12:27:39 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e9418f8a-caa7-40de-13c1-08d8ce886c54 X-MS-TrafficTypeDiagnostic: BY5PR10MB4339: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3383; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: KXV65UamKIrXSsWlZ3PCv7nWmuoR/ZJveUOrtkDKkiLG8XxPKX4rlK2MMVAWrwg9LFdonw1MbKxzbdbepK0GT8mE3T8fwK/yR1RXtrRdvOZMH7Ux6mt3OcrwrGtNfGwUL1/VC51QX0ZozV2R8L5gQ3Wt1VuZeOsomV71Tcqx7fhGYX84MoVTIZFJ540OypMY28XqC6nJSr93sV0PuT8Ypn/l3RUUnNQBHKg96RhJrC/MXrekYZNtzlrWrNcKdfeyDqt4RdOyf/lrlzp6qW3vBs411ux6h1b4oeyKeLKNrT0YuSIf0n1sEsWU9YoMNyBgDZkUGBxecLUZHiwfa2OuH9w6fLkWZROtqvAzi+1a/8y7xIjvxLR0CFhJ3swvOw8L3W7ojwOv24L3Ygc7rRnnE3vfogdNAd1zbvjomGAtLFjI+MES4Y3Yi/pIheiz+PPdxIJG8/PIsInwSYpz17qhZm/QSbRWoX8eJvHhiIJoQaZH5nrSKiy4e2XKXm9te5ALrUxb5JQcS11j4/7w2Lc8I/k+7PhPeo5tKzIn/rvwcL4o0UhnH8mb7r0aUDso9WrESY2qyJ827KMrdbT2PbuL1g== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BYAPR10MB3573.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(366004)(346002)(39860400002)(136003)(376002)(396003)(83380400001)(1076003)(6512007)(16526019)(2906002)(107886003)(4326008)(6506007)(478600001)(316002)(186003)(6486002)(8936002)(26005)(52116002)(66946007)(86362001)(6666004)(8676002)(2616005)(36756003)(5660300002)(66556008)(69590400011)(956004)(66476007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: aTE0Amq9s+WpwpHAKidDlAJIswDEol4iRiQGKlckryuLkhF7oYiwTJ9v01vEPFWihf2/MJ1q+O7oB7xxLkviLYZT3ZA5rTdC3BMn43MEuJ/EIuVscyv54LaCRGKO0PyGM9d4bnKb4SnoiJ9RY6owamutaUu1Iui9gYZQXTpOpHIGO6WMMiO54b5gXfqG3yjdowvp+Bl4VoIuU7HV1KQHaHjzFzXnRyWHNo29/23BUjbhC3w4H9HtqdYd9PY+dBn7b+RpGagrZr2ktTMCE11+RZVvwTFgLcfIrzd783fSMY62go1lL9UJ9i4BaHJyhG+cHg9uHcU563Vjl721XJgKzQ2Op/4s/+JFN6pQ3rIvl+esNW7cVgOrfovVVvivz2XcOjsGC4kcHGYAZmi2RKAM587Ps8XQZ4gRzyGN6fp6m016Uicme5VNgG+nsoT5JMpdhL106sO03Ufg2LAEIzr5JEO/kxRPSU6kUsC2a9m+KMK4R1xe2ygXDNS+VdwszncbgJ19I6oky8PGqJlQy6EctARP2bYpBy3/hzhsZkXkJ3KnzIR8xzfvZZWBDwOX4AmO9MaoLUWS79K6giqec+0L8pRPvb4/ICSt+LgV3e0hKKMGHQq2Fk9Zu8H8+5+peNfYflfGeMKcsnJfGjDmYS9LdrLcLh3KjZ1VVW6iSrnFvpOVi5nR72Jd3V2qiWA3MWrjXd8rPdAK3CgPCXDqCNBALuIBHTha9mBu33CrlHc7f6/z5vJswByc3hzGiT0/LegQ9fBzJs2lsE316GVJHWFRUVVG+vOxJNkMDhQbtfE/w0hvoIJzh7xUZTyE0rctVCQLmaSIYDCNOTxdVxAOIlKXYtyLefpRgDQxMTNdLprDKqUVXY3acr+9S8qCncDEAWIVEkKQWXCCU3uEL2oIatzT/VU3X7kA+y9F0nwJ26KaOhiB5o05gPfrKuRD4sHJxpCwqKjky6b4LMksMUbdQx25HUV/Tcnl9lzXk8CYj/pzIhUOPUlLJaWxJF6iLvy0sd+pBr/EGz19BDyQEaa1gH0KaQpEAw6cnNI3CXYUgWJY9R+XLCbLLXyfS5dHiu2JiCwKwolDH1jiX7hPGOadGWpaoKsCZCvkBwdYali3V1TpkC0L+64uGBTbNo1Q5i3aqI7zS9En9wa1QXurKBh/tRY7gsFVUFZ5WB/l3jGkGcVJ/DRjqcAk/Brln/nwh+apyYYXI218XfBZty3kaDzFUPb++znmRX14FlLxy7wqpwW+xtUjwYEaOCLP4bUTCwQP1B428CaX2+Os55vaHKrViIDKW2XgulUHHjF0LY6/JwWQrjaQiBqU4o+8yXXx2MskJ95V X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: e9418f8a-caa7-40de-13c1-08d8ce886c54 X-MS-Exchange-CrossTenant-AuthSource: BYAPR10MB3573.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Feb 2021 12:27:40.3267 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: GHSsLnjUFUECSZPX8pLPF7rR3N/hcdIiE5UaJ+hTfomfLXDJGFdWRHunw+75rJotsHdEKqca4ZqgrDEifeGSkVz/RBigLENjA6Pu5pY7jLw= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR10MB4339 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9891 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 adultscore=0 mlxlogscore=999 mlxscore=0 suspectscore=0 malwarescore=0 phishscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2102110111 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9891 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 mlxscore=0 mlxlogscore=999 spamscore=0 impostorscore=0 malwarescore=0 clxscore=1015 suspectscore=0 adultscore=0 bulkscore=0 lowpriorityscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2102110111 Precedence: bulk List-ID: X-Mailing-List: target-devel@vger.kernel.org The kref_get_unless_zero use in target_get_sess_cmd was added in: commit 1b4c59b7a1d0 ("target: fix potential race window in target_sess_cmd_list_waiting()")' but it does not seem to do anything. I think the original patch might have thought we could have added the cmd to the sess_wait_list and then target_wait_for_sess_cmds could do a put before target_get_sess_cmd did it's get. That wouldn't happen because we do the get first then grab the sess lock and put it on the list. It's also not needed now, because the sess_cmd_list does not exist anymore and we instead wait on the session cmd_count. The other problem with the patch is that target_submit_cmd_map_sgls/ target_submit_cmd callers do not handle the error case properly if it were to ever happen. The drivers assume they have a refcount on the cmd and in many cases do a target_put_sess_cmd on it either directly or via transport_generic_free_cmd. So this patch just changes the kref_get_unless_zero to kref_get. Signed-off-by: Mike Christie Reviewed-by: Christoph Hellwig --- drivers/target/target_core_transport.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c index 5c4adde96d5e..b5427e26187b 100644 --- a/drivers/target/target_core_transport.c +++ b/drivers/target/target_core_transport.c @@ -2775,9 +2775,7 @@ int target_get_sess_cmd(struct se_cmd *se_cmd, bool ack_kref) * invocations before se_cmd descriptor release. */ if (ack_kref) { - if (!kref_get_unless_zero(&se_cmd->cmd_kref)) - return -EINVAL; - + kref_get(&se_cmd->cmd_kref); se_cmd->se_cmd_flags |= SCF_ACK_KREF; } From patchwork Thu Feb 11 12:27:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 12083087 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 05453C433E0 for ; Thu, 11 Feb 2021 12:32:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B4DCE64E8A for ; Thu, 11 Feb 2021 12:32:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231406AbhBKMcF (ORCPT ); Thu, 11 Feb 2021 07:32:05 -0500 Received: from userp2130.oracle.com ([156.151.31.86]:43208 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231401AbhBKM2j (ORCPT ); Thu, 11 Feb 2021 07:28:39 -0500 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 11BCOwJB050824; Thu, 11 Feb 2021 12:27:43 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2020-01-29; bh=mJLOM170UOVxs6KEy9JlX5oB6OXlJ1nwsdmN9GE7Xx8=; b=eeWCdI9yUuIo3hqtcAvLexW92oMUg4gO1ITkypFfw/h9WU3cLFxVOn3urZK7mWxuQ6f6 TrL/lIZgZ6TOFXrF/N7DvxQstUbEtaQdCWYYZAFTs0eIty2KOsxcHVgj9kq1QP0DSETW iVffMg3eI81OVwjSO+QQKw2WsIfobQ4kZCxZjRitPBhxQuenE58029C3RwSddBauHXGi 9MbxOamm3R9Owms3sqhjdy7j5JKLISimCxLKaKeqq74hQLJagOb9p4NZeoEVCuwnUgdS MJWex/8tw71m61VYeo6XLM4v+z+lvtmeBKyeI943qeuHOMMSfk5iFw9Ma65XNK9qwp/N yw== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by userp2130.oracle.com with ESMTP id 36mv9dsej5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 11 Feb 2021 12:27:43 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 11BCOn9u068569; Thu, 11 Feb 2021 12:27:42 GMT Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2100.outbound.protection.outlook.com [104.47.55.100]) by userp3020.oracle.com with ESMTP id 36j4vu69v3-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 11 Feb 2021 12:27:42 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Skh+cTACdZXDqr9s9221snHcz4UAKW1W39MT27tpi4cm52QZcLiIgdYY5zaYeOJd+NGaXXbErJCiRHVDU27tzjxEfOG9L7XqFMdP2Z9k0iV6651XgywyL2zmi7h13XGM2BNQczZCc9gEiVWYbnI9i87Ts3EmN5WfeDqT1+zcFzP1z6axeHVGVM5GSAC2uUs19Wqkc2SWEW2atJ9izPbbZ1UHvh5hsbvpdNs3RUIvlDduRB+lWQaE3dVN7cjQ+A7GJbWVKsyTqElP8CQcblfOvY7FKM6WeLt4Sl2P9mvsEeuHMsZxXDpw4QjEVyIKyYVplDZxGVDwCPCY/OBpVhdnPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=mJLOM170UOVxs6KEy9JlX5oB6OXlJ1nwsdmN9GE7Xx8=; b=PZeptEGtGVZ+X34JdARPQtc4+N1mztUIvEEtw+WF6TGCa+ogEmC2Em5HRgIqr31RIvnVTB9tqDweblKO2AV6BhU3WOwFP60tBvv6wEhFDKnGKlLbq0+CWpDFUdMtluxOeH07kxixuE2WL98FDqVKHyQf5GCpy+db1Dvwbjyctz384TObO3+jcgmh2t2Z3FqaVBQY18OB2o11Fo09FY7RbtQAOSpFZqDANAyemKwupdK/lGQY48QOvf+bs6RainoQmATp68F1e177tY+o++dcTZCsGrRHxSW4gH+pQNZsM+xOyezggyX8vy5e5jVuGXYz0ShtHT0j/edt1IB1iBgSHg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=mJLOM170UOVxs6KEy9JlX5oB6OXlJ1nwsdmN9GE7Xx8=; b=OGQDabzVEL2Qhhw3iBwPILG9bO1N+wTLQj4t5jklYYEnLAQZUQ/BOsxg9yvvAteZV7iXEzIzF5eb0oJslLd3yE9VyhjvAwdHknjyAYvudbfo/rrfBYvImHuSsTbI6riskzNV0sxGmWlyAkpTAXOvNDDgn2HQokBlQXzpRCoOfX8= Authentication-Results: lst.de; dkim=none (message not signed) header.d=none;lst.de; dmarc=none action=none header.from=oracle.com; Received: from BYAPR10MB3573.namprd10.prod.outlook.com (2603:10b6:a03:11e::32) by BY5PR10MB4339.namprd10.prod.outlook.com (2603:10b6:a03:20a::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3846.27; Thu, 11 Feb 2021 12:27:41 +0000 Received: from BYAPR10MB3573.namprd10.prod.outlook.com ([fe80::1d86:b9d7:c9ef:ba20]) by BYAPR10MB3573.namprd10.prod.outlook.com ([fe80::1d86:b9d7:c9ef:ba20%7]) with mapi id 15.20.3825.030; Thu, 11 Feb 2021 12:27:41 +0000 From: Mike Christie To: hch@lst.de, loberman@redhat.com, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, target-devel@vger.kernel.org, mst@redhat.com, stefanha@redhat.com Cc: Mike Christie Subject: [PATCH 03/14] target: rename transport_init_se_cmd Date: Thu, 11 Feb 2021 06:27:17 -0600 Message-Id: <20210211122728.31721-4-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210211122728.31721-1-michael.christie@oracle.com> References: <20210211122728.31721-1-michael.christie@oracle.com> X-Originating-IP: [73.88.28.6] X-ClientProxiedBy: CH0PR04CA0060.namprd04.prod.outlook.com (2603:10b6:610:77::35) To BYAPR10MB3573.namprd10.prod.outlook.com (2603:10b6:a03:11e::32) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (73.88.28.6) by CH0PR04CA0060.namprd04.prod.outlook.com (2603:10b6:610:77::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3846.25 via Frontend Transport; Thu, 11 Feb 2021 12:27:40 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 591a21bc-70ac-4574-33a4-08d8ce886cfd X-MS-TrafficTypeDiagnostic: BY5PR10MB4339: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4941; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 4pvLOWCkuWgD4wjbQs+SlF3AdxSPULLvl0ZmlbglM7z/63mhjWK9XC+DXCw/fWOMeUbvd23Y6BfpcUydPbmMGVNVy6zVNTRCruracKI44393jaIBu90gsfUnPtYd/kr81jxWNx0XO7V50xUxYWE+dKN3/dMRHD8EYKjKtlgBxKJZmZiZltur8fZo3QLN1Yju3wTRXbc/ndF++lBQu3muhgGOuuIX4jz76nxtEhXi6tL04GzoVKdXH5OLhJfxlEUPTg2XrXDhaq8qJfjNaKo/WtNxhE6+2rd73P2kt7sNhqnxu0oziaiHWvONCKH9LIED/wvW5IsU0pCtD2V5DayfzMDUKXi6EdGQRaog4hp/qdH/w8HsUSdmEq2ZJJqpdimoWI9yMImqaDtWtyFEfDVOtcsGrup555U8zXSMs04v1cQ46ncY1t0FU4cA8siR/zsUTStMEYTHwxh1DojGGLT3uzYOc0JhJqEvrXjtsOcl4Ikgw0emtFoksu2gVZLqcbhLSiA6STFIlZOlobnEtMXKVGAtNw5XybnY4NYdJYF8qZTneo3R0h7I3o+Dev81Enzv3ZoBGic503YEIIb9176J5A== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BYAPR10MB3573.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(366004)(346002)(39860400002)(136003)(376002)(396003)(83380400001)(1076003)(6512007)(16526019)(2906002)(107886003)(4326008)(6506007)(478600001)(316002)(186003)(6486002)(8936002)(26005)(52116002)(66946007)(86362001)(6666004)(8676002)(2616005)(36756003)(5660300002)(66556008)(69590400011)(956004)(66476007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: GJBG6e/J+9G1UumfKC2aLq5mD4XL0InYTh+LSbkV7kmsEGTMt+54wjymy0pH7Zi365CieDhHkNFpuXqxES6hfcFkWX1L1k/n4AZhxuuRMOsP6Pduq5ESx+yz3z6nE2QhGEcESOVuZCZIGmaZBb79eU5sb+CaEx5AnBi4TbB7aZ2DRSKBwCgnegtbZeQmBx+uF4iJRc6chBCut6DsVIF2ZadJHs+fgr5hLBh9Q7nzNouJqnrHJzb3Mlpy8qc5dRjffPliY/f7bjaBj71N2Dxjy7kPR6UF8/PRziRRmqFWVrV+92Yg7mWisXxzFKerqgVEn/3FpKM8rliXcCqveV9UFg0UrEbJ9TV4sScLr+g0LVZTLvvBzDx8m5Xn5IKSq4RlyF3ryM+IT7EGnkNRV29ZHpdz4u4JvLRlhHFfP990YTXga+E7+qpTHRtgKUfDi2tmc70LCErRJapz5CAD3NB4aUGkW8+GOe96Q+Kepfc2CzTbeaC93wVZDEZp17OqySB0XEefKvcRIisKm9oXWvIP5wjhShd7D+EPrHu1UWedOrAMh49yChfkh9mwvyjxeT3HYIb6DueCDQLiMVNrqfQb3Ay1XloMekDBrGk2KRK6wkoe6W5s1htYdU/tD7ok1AqzM/N2ensBp+A34Neik/hv4Lzw67GpqYuy3Z3W9C3iUp4JQdW0++/T3cTTAMTO/9LUOGupx7gZEpFdQe+sUYYxHnHq+u59d/u5r5N71m924KL7SkYMemnZPxvY9g9nT3o2uaUnrcNCeAg4QmgikEuvI7ESDVBZpiJyDS/s1y3nAQmr+O+OZ6Jy0Jsrdio6uriAkjqML/yFhJe3sFJcWbFz2u9wo/3RqW4rnPE4PlYqYoZZ7YKl/MAgYMXtYEUgkbjM/WKHDSDQAfZ0rEkVwjNTWxsxmkwLeXjtzJgZF4nyvez3KuZGUg77lmtoYkP4kUicn+fvFzpYmhLMOKuwD/HphSDy3kZrHtHho2HJR4uohSpiMe0ay0PhYOqvnGFLFRMpUQLuiDh2NwFHB3jKnjMF282AEpHbrSyrhc54rPdXaOkK2XBtr8wpntHwcVEBgqVxQqEyJ9RX1fHotICC3ndOqMjctj32RTPSwwCE2fCJQFF1MmMpXDEW0BXmYRXwyMFr5N7N7DAf0uct3y+C0abpaG27aVf+I2LHoKcD5EIUr8jRsBz9JtxCYuNrUZe17p2rHQnPp7DV7oTXrY4vfTCk6Zv/0e8MkfW9kfgumWHP4FlS7p0JgGFQrzbIpWV2j3Vc/K7avybX+uHKeakzJjkTFXPEhkWsSKP9b1Mj6V0eY7UICGbmBhD1CUWScHe5hZ1S X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 591a21bc-70ac-4574-33a4-08d8ce886cfd X-MS-Exchange-CrossTenant-AuthSource: BYAPR10MB3573.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Feb 2021 12:27:41.4251 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: wb0Dwfw2tKNqydXUAA0LaLw+PkwJapr00JkXVEnhdb+yMiWXo5HsQG/mma/cLk9aqTbt329tFvMcaVMrru2pXisXGhdjOaJxB4aOBNYru3Y= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR10MB4339 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9891 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 adultscore=0 mlxlogscore=999 mlxscore=0 suspectscore=0 malwarescore=0 phishscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2102110111 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9891 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 mlxlogscore=999 bulkscore=0 suspectscore=0 phishscore=0 adultscore=0 impostorscore=0 mlxscore=0 clxscore=1015 lowpriorityscore=0 malwarescore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2102110111 Precedence: bulk List-ID: X-Mailing-List: target-devel@vger.kernel.org Rename transport_init_se_cmd to __target_init_cmd to reflect that it's more of an internal function that drivers should normally not use (usb seems to use it wrong and iscsi is that weird guy), and because we are going to add a new init function in the next patches. Signed-off-by: Mike Christie Reviewed-by: Christoph Hellwig --- drivers/target/iscsi/iscsi_target.c | 16 ++++++++-------- drivers/target/target_core_transport.c | 16 ++++++++-------- drivers/target/target_core_xcopy.c | 8 ++++---- drivers/usb/gadget/function/f_tcm.c | 20 ++++++++++---------- include/target/target_core_fabric.h | 2 +- 5 files changed, 31 insertions(+), 31 deletions(-) diff --git a/drivers/target/iscsi/iscsi_target.c b/drivers/target/iscsi/iscsi_target.c index 518fac4864cf..f2107705f2ea 100644 --- a/drivers/target/iscsi/iscsi_target.c +++ b/drivers/target/iscsi/iscsi_target.c @@ -1154,10 +1154,10 @@ int iscsit_setup_scsi_cmd(struct iscsi_conn *conn, struct iscsi_cmd *cmd, /* * Initialize struct se_cmd descriptor from target_core_mod infrastructure */ - transport_init_se_cmd(&cmd->se_cmd, &iscsi_ops, - conn->sess->se_sess, be32_to_cpu(hdr->data_length), - cmd->data_direction, sam_task_attr, - cmd->sense_buffer + 2, scsilun_to_int(&hdr->lun)); + __target_init_cmd(&cmd->se_cmd, &iscsi_ops, + conn->sess->se_sess, be32_to_cpu(hdr->data_length), + cmd->data_direction, sam_task_attr, + cmd->sense_buffer + 2, scsilun_to_int(&hdr->lun)); pr_debug("Got SCSI Command, ITT: 0x%08x, CmdSN: 0x%08x," " ExpXferLen: %u, Length: %u, CID: %hu\n", hdr->itt, @@ -2013,10 +2013,10 @@ iscsit_handle_task_mgt_cmd(struct iscsi_conn *conn, struct iscsi_cmd *cmd, buf); } - transport_init_se_cmd(&cmd->se_cmd, &iscsi_ops, - conn->sess->se_sess, 0, DMA_NONE, - TCM_SIMPLE_TAG, cmd->sense_buffer + 2, - scsilun_to_int(&hdr->lun)); + __target_init_cmd(&cmd->se_cmd, &iscsi_ops, + conn->sess->se_sess, 0, DMA_NONE, + TCM_SIMPLE_TAG, cmd->sense_buffer + 2, + scsilun_to_int(&hdr->lun)); target_get_sess_cmd(&cmd->se_cmd, true); diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c index b5427e26187b..013f4a5e8972 100644 --- a/drivers/target/target_core_transport.c +++ b/drivers/target/target_core_transport.c @@ -1297,7 +1297,7 @@ target_check_max_data_sg_nents(struct se_cmd *cmd, struct se_device *dev, * Compare the data buffer size from the CDB with the data buffer limit from the transport * header. Set @cmd->residual_count and SCF_OVERFLOW_BIT or SCF_UNDERFLOW_BIT if necessary. * - * Note: target drivers set @cmd->data_length by calling transport_init_se_cmd(). + * Note: target drivers set @cmd->data_length by calling __target_init_cmd(). * * Return: TCM_NO_SENSE */ @@ -1369,7 +1369,7 @@ target_cmd_size_check(struct se_cmd *cmd, unsigned int size) * * Preserves the value of @cmd->tag. */ -void transport_init_se_cmd( +void __target_init_cmd( struct se_cmd *cmd, const struct target_core_fabric_ops *tfo, struct se_session *se_sess, @@ -1403,7 +1403,7 @@ void transport_init_se_cmd( cmd->state_active = false; } -EXPORT_SYMBOL(transport_init_se_cmd); +EXPORT_SYMBOL(__target_init_cmd); static sense_reason_t transport_check_alloc_task_attr(struct se_cmd *cmd) @@ -1623,9 +1623,9 @@ int target_submit_cmd_map_sgls(struct se_cmd *se_cmd, struct se_session *se_sess * exceptions are handled by sending exception status via * target_core_fabric_ops->queue_status() callback */ - transport_init_se_cmd(se_cmd, se_tpg->se_tpg_tfo, se_sess, - data_length, data_dir, task_attr, sense, - unpacked_lun); + __target_init_cmd(se_cmd, se_tpg->se_tpg_tfo, se_sess, + data_length, data_dir, task_attr, sense, + unpacked_lun); if (flags & TARGET_SCF_UNKNOWN_SIZE) se_cmd->unknown_data_length = 1; @@ -1797,8 +1797,8 @@ int target_submit_tmr(struct se_cmd *se_cmd, struct se_session *se_sess, se_tpg = se_sess->se_tpg; BUG_ON(!se_tpg); - transport_init_se_cmd(se_cmd, se_tpg->se_tpg_tfo, se_sess, - 0, DMA_NONE, TCM_SIMPLE_TAG, sense, unpacked_lun); + __target_init_cmd(se_cmd, se_tpg->se_tpg_tfo, se_sess, + 0, DMA_NONE, TCM_SIMPLE_TAG, sense, unpacked_lun); /* * FIXME: Currently expect caller to handle se_cmd->se_tmr_req * allocation failure. diff --git a/drivers/target/target_core_xcopy.c b/drivers/target/target_core_xcopy.c index 66d6f1d06f21..e86cc6135587 100644 --- a/drivers/target/target_core_xcopy.c +++ b/drivers/target/target_core_xcopy.c @@ -615,8 +615,8 @@ static int target_xcopy_read_source( pr_debug("XCOPY: Built READ_16: LBA: %llu Sectors: %u Length: %u\n", (unsigned long long)src_lba, src_sectors, length); - transport_init_se_cmd(se_cmd, &xcopy_pt_tfo, &xcopy_pt_sess, length, - DMA_FROM_DEVICE, 0, &xpt_cmd.sense_buffer[0], 0); + __target_init_cmd(se_cmd, &xcopy_pt_tfo, &xcopy_pt_sess, length, + DMA_FROM_DEVICE, 0, &xpt_cmd.sense_buffer[0], 0); rc = target_xcopy_setup_pt_cmd(&xpt_cmd, xop, src_dev, &cdb[0], remote_port); @@ -660,8 +660,8 @@ static int target_xcopy_write_destination( pr_debug("XCOPY: Built WRITE_16: LBA: %llu Sectors: %u Length: %u\n", (unsigned long long)dst_lba, dst_sectors, length); - transport_init_se_cmd(se_cmd, &xcopy_pt_tfo, &xcopy_pt_sess, length, - DMA_TO_DEVICE, 0, &xpt_cmd.sense_buffer[0], 0); + __target_init_cmd(se_cmd, &xcopy_pt_tfo, &xcopy_pt_sess, length, + DMA_TO_DEVICE, 0, &xpt_cmd.sense_buffer[0], 0); rc = target_xcopy_setup_pt_cmd(&xpt_cmd, xop, dst_dev, &cdb[0], remote_port); diff --git a/drivers/usb/gadget/function/f_tcm.c b/drivers/usb/gadget/function/f_tcm.c index 410fa89eae8f..dcce6e2605f5 100644 --- a/drivers/usb/gadget/function/f_tcm.c +++ b/drivers/usb/gadget/function/f_tcm.c @@ -1050,11 +1050,11 @@ static void usbg_cmd_work(struct work_struct *work) tv_nexus = tpg->tpg_nexus; dir = get_cmd_dir(cmd->cmd_buf); if (dir < 0) { - transport_init_se_cmd(se_cmd, - tv_nexus->tvn_se_sess->se_tpg->se_tpg_tfo, - tv_nexus->tvn_se_sess, cmd->data_len, DMA_NONE, - cmd->prio_attr, cmd->sense_iu.sense, - cmd->unpacked_lun); + __target_init_cmd(se_cmd, + tv_nexus->tvn_se_sess->se_tpg->se_tpg_tfo, + tv_nexus->tvn_se_sess, cmd->data_len, DMA_NONE, + cmd->prio_attr, cmd->sense_iu.sense, + cmd->unpacked_lun); goto out; } @@ -1181,11 +1181,11 @@ static void bot_cmd_work(struct work_struct *work) tv_nexus = tpg->tpg_nexus; dir = get_cmd_dir(cmd->cmd_buf); if (dir < 0) { - transport_init_se_cmd(se_cmd, - tv_nexus->tvn_se_sess->se_tpg->se_tpg_tfo, - tv_nexus->tvn_se_sess, cmd->data_len, DMA_NONE, - cmd->prio_attr, cmd->sense_iu.sense, - cmd->unpacked_lun); + __target_init_cmd(se_cmd, + tv_nexus->tvn_se_sess->se_tpg->se_tpg_tfo, + tv_nexus->tvn_se_sess, cmd->data_len, DMA_NONE, + cmd->prio_attr, cmd->sense_iu.sense, + cmd->unpacked_lun); goto out; } diff --git a/include/target/target_core_fabric.h b/include/target/target_core_fabric.h index d60a3eb7517a..4975c4d2a933 100644 --- a/include/target/target_core_fabric.h +++ b/include/target/target_core_fabric.h @@ -148,7 +148,7 @@ void transport_deregister_session_configfs(struct se_session *); void transport_deregister_session(struct se_session *); -void transport_init_se_cmd(struct se_cmd *, +void __target_init_cmd(struct se_cmd *, const struct target_core_fabric_ops *, struct se_session *, u32, int, int, unsigned char *, u64); sense_reason_t transport_lookup_cmd_lun(struct se_cmd *); From patchwork Thu Feb 11 12:27:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 12083105 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 75886C433E0 for ; Thu, 11 Feb 2021 12:34:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3ED9564E05 for ; Thu, 11 Feb 2021 12:34:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231559AbhBKMeR (ORCPT ); Thu, 11 Feb 2021 07:34:17 -0500 Received: from userp2120.oracle.com ([156.151.31.85]:44354 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230474AbhBKMa6 (ORCPT ); Thu, 11 Feb 2021 07:30:58 -0500 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 11BCO18R139515; Thu, 11 Feb 2021 12:27:46 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2020-01-29; bh=pmZfKSFF2u9HV5P4RAb6IslzlbYKwVdkQUe53+3I4Ao=; b=yBvgZZFnCpTIV3EOSbpGVaXgjUMpfINbE/HaZcV46ANf4UOfwgxpVDMBG27fGJvXW6Ip at53b3o4g3yv2wv5LKBDC+qxc/vIF3rvwht2ONwj8M5sPh2mPA/ahrV4QYOIXL0tLZQp ORWDXJHMEFBRCMyA2tDOAIQJoEeSLGH2jzJ77Ob1D5p0ao+vvVCy7VepVrD7iIU4kd1w JEkitzt7fumk5T2izbuE9tV6RkwK39EwgzNODtThvXrGVgXZ2zKiaYEOHnJpNeTm1yN6 3CP2TyJMmefLaKQHOUvolp68Z6V8APPC13eEv76PsR7fV4yZeN4RiXMk1rCySG/5X1kF pQ== Received: from userp3030.oracle.com (userp3030.oracle.com [156.151.31.80]) by userp2120.oracle.com with ESMTP id 36hkrn76ev-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 11 Feb 2021 12:27:46 +0000 Received: from pps.filterd (userp3030.oracle.com [127.0.0.1]) by userp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 11BCP7qM052228; Thu, 11 Feb 2021 12:27:45 GMT Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2104.outbound.protection.outlook.com [104.47.55.104]) by userp3030.oracle.com with ESMTP id 36j51yxtx1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 11 Feb 2021 12:27:45 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cN0r0WHEt3t+bdsAOeSs/7ZDta4uwRpl9z10iVDIqxIUI6Vp4vTWhF1ZpySvY+ZyuWXJht3/u9zgePUDJfAr69rIIK6+61MJ/qk+JLxUHHi/V5ycHpDys6gbEHIjvMtyJSnTAfXLwvvtUoyludPNkydEWRiI8CfuqhmcMks+EcskbMGXMJszmuKFO9O9PcSApff0VJfTUWCWqcLY/JM+8cLjgMtH7V3V0eVjn4DAh5IUSlrMQYD++7mlA5O054zhloFHYLrGSNMfIGFJO8oT6Zst9tfyytTidw/AiNGAk9vyYXvQ79VK6+NIYZ+kF1SPgjFadSgMrw3LTwywjesZlA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=pmZfKSFF2u9HV5P4RAb6IslzlbYKwVdkQUe53+3I4Ao=; b=X8bdmO+CTj75cNKajl83LYeZJ6k5N0MxMsrcBr0V+/ecsushLVyP5xIgFRP1BzgR7tV6/hxziEeQEi1RxzlNB6lJBkAYmzQX2ta8NOeMoicqma4Ckuib+oyYo9hsx9BpWwnF64RXRoCVp+hkZyV5KPhz4D8MfbeBvwTFy14JAySJyaFuweKoMwFVGruYACqF35LZWCuhg0mcyE76a+e/pU8g/nzVhTS+Cpz/BLOrYFz7/9MBWa8tun7Dl6PNQVbB2oAe/7qqXELn8yinn1Z5McpICvNLtPOlnqbPY0ma2Xik5DJszPio4I7hD0g1JK0pbmo1F5gQfn93bM9hqH/6Gw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=pmZfKSFF2u9HV5P4RAb6IslzlbYKwVdkQUe53+3I4Ao=; b=Yua8jOP5Uh+VTvQPRTiLYPfSMeHKf4lC6vQpkGYVRdvUdZtARZoRBwf/KjDUOrokRvPq01e65eIJI+2WBtm0/VsK4DIWnVxGY1TDUDHwsRCN/RCIpQBMv4M3Tuy5IQyuOw4GxSg8QYJ/ubpMnCpLb4gVhf3R0EvPdqMiMNnaDFo= Authentication-Results: lst.de; dkim=none (message not signed) header.d=none;lst.de; dmarc=none action=none header.from=oracle.com; Received: from BYAPR10MB3573.namprd10.prod.outlook.com (2603:10b6:a03:11e::32) by BY5PR10MB4339.namprd10.prod.outlook.com (2603:10b6:a03:20a::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3846.27; Thu, 11 Feb 2021 12:27:43 +0000 Received: from BYAPR10MB3573.namprd10.prod.outlook.com ([fe80::1d86:b9d7:c9ef:ba20]) by BYAPR10MB3573.namprd10.prod.outlook.com ([fe80::1d86:b9d7:c9ef:ba20%7]) with mapi id 15.20.3825.030; Thu, 11 Feb 2021 12:27:43 +0000 From: Mike Christie To: hch@lst.de, loberman@redhat.com, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, target-devel@vger.kernel.org, mst@redhat.com, stefanha@redhat.com Cc: Mike Christie , Bart Van Assche , Juergen Gross , Hannes Reinecke , Nilesh Javali , Michael Cyr , Chris Boot , Felipe Balbi Subject: [PATCH 04/14] target: break up target_submit_cmd_map_sgls Date: Thu, 11 Feb 2021 06:27:18 -0600 Message-Id: <20210211122728.31721-5-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210211122728.31721-1-michael.christie@oracle.com> References: <20210211122728.31721-1-michael.christie@oracle.com> X-Originating-IP: [73.88.28.6] X-ClientProxiedBy: CH0PR04CA0060.namprd04.prod.outlook.com (2603:10b6:610:77::35) To BYAPR10MB3573.namprd10.prod.outlook.com (2603:10b6:a03:11e::32) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (73.88.28.6) by CH0PR04CA0060.namprd04.prod.outlook.com (2603:10b6:610:77::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3846.25 via Frontend Transport; Thu, 11 Feb 2021 12:27:41 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1affbcd1-67fb-4e91-2797-08d8ce886dee X-MS-TrafficTypeDiagnostic: BY5PR10MB4339: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:9508; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: gW6B32Ve3mrpC94ysMqZmqLqEIss7RXOd64yUR57H63BFzPNRFIbmRSOjjUDFFqcyjqO6VHD1yCN5+ZtcG+UNEw4OhvUIIhDXNXCztmRq2HvKKUIds+wH6109WamBRx+usA31h4GtrYCqm+capLUy/IQUyY3xaXVP33Pi7oPtpanC0o6CvbOmnnLcwmUScppOHwEpl6BXKGBQfAKsbl8tNIos4isVUvSCGqBI99OvIVyejTT+/QcaqRU2wY1LwJM/bd+1K80ylONdLDmoEpcqZoMsRnbmq+M9C9EuG440Jhe5TggNYUW6f1S9slLC0HvUpSDTcwmAXXyJFQppPVSu8Hw1VBwLTZgB+fSOu1UAS/iPec+8uhLSaBg8uN512juRw89zQ5L1IaEWGiXNVlRmuwT2hRokHHBTRVeWlNTq19FCNti+HLoqh+I3BllO/FFkPwTaRXIQBXJCqxWlFS2Ftiu+HrOwf0WSIVV0rXNkGaqdz04ciG5LT2xS7EKUjlTc0ZSZzSlrjRxs+7vNUusDovH+I1iYErUTy9qnLP47rFE5tbPfNhbF14yFpCtH+7wCoDAHTTd4Sj/pLoiSHzQpg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BYAPR10MB3573.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(366004)(346002)(39860400002)(136003)(376002)(396003)(83380400001)(1076003)(6512007)(16526019)(2906002)(4326008)(6506007)(478600001)(316002)(186003)(6486002)(8936002)(26005)(52116002)(66946007)(30864003)(86362001)(6666004)(54906003)(8676002)(2616005)(36756003)(5660300002)(66556008)(69590400011)(7416002)(956004)(66476007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: d4aXNf+I/wJzxTUNeTE6ZySsT5sQbm+KZzXvWkss050VU0Vh4RbEfMS4a3nKgXjQt0rAHJVPx4lDWS1CPKQ0+1gEyib80Cpejh3rz83BZ9mXCjLq1oGQkReuT3YhsNDjkCrZmpT7UxF3XeuyBftZFhllmiH6Q0HgrVBKb+rX6/SeeopYYDs959IUgBHXY7wtas1h/+0ckP/KqEkDqQvT8pmJibScuwYi5FX3d53qZFHvL902giAU8hK1q4wsGt3yDfMMU15qt566n+2Xm02HlAeBqiqYLk7hzJNeJ3+YxFV8qm02hO2Pnpc/XwQYfhLiMG2B/qNqGDSAqx53uIZWFckPqvJMplS/j6l+1F0uAY34yJfsxxV2mUMAScns0eMRonYxN815cO0w2EMMlQVyvVJIEfNkGo3VD6gRO0rYkRieQLcKNReXTy0HmA/Ky9IXhdFkzIdQ4V7ESh75xExLMamY/+hpctQauPWJqTjfMJIVSxYksLgotim2l8HhsfBJ9ycmT+S/cvfvk4kTnTLZ/db0LbUOwz+WISBFNf0g74dPnqIraVFOP5S1ASPIszIFbZbyTsHEJuiBtp4+sD1WganbRQYgoq7Xud9oJR7A2GgeDVvBDFZmNJRVXR7TARpt+vvQokO2j8fNOOdCy70QqAtmtKPzQewOZVlZSAxhrNAikVnESD0yb8gsNs7Ut6Rv1MfgX2meWDwB8dkpABRBIeAGcHXujeoJqlNL4GnAu3COnWxo+lOxzxrJAY/Tsh4xjS6lt5Pv8lSZhfb/dWc8jznpaPEFz+eAlhVnUcYtXBL40wBiw7TanDV1ERJWpkoPuimEcVzEMS/epRXrwq0Y+2+H0rVXQ89DT8x+Dsq9Agl6JDWFfyrtZffCAdVlScYzd+O4gPTZgQsyUGa8MKARg4EkCRD7rzdzChZ1mp2fMb+CTVhApmLOkyPC6FFhh2cvBN8lAxvSfvejBvhpAtPXcuZlsyDcLqMYWSiOHnwvsW/DkCTJkzW+PRKC2nE5QKSN2eweGWJw2Fyz5HnUXF+eEVQNg7bcCYAV8jkBaQgW+0lFcB2WdzINQ/PHesxdO6Ye+n4dhnKjlXlym1deufBfX6jc+/7yp3Veai3KcuLvJqfpswqdJ5h1zTmv67lXIcjvzMCZHKnUkCMgb85WBHBHDnMAXKGUu1IExXjhCgsiozminXygmv6GF3NPBCoGEgPVpfz5tfdXNE4rgB7UPr7vBpamJaEUo7LJ3ol+Z38ww5CtYZKL8LrFSmKIqqt3pU61CvROq/O5+LT0ELspJyvyzZs+4xhcIvHSyZBrYBTkgb1A5d4zMko0yW9YVGhwBTJk X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1affbcd1-67fb-4e91-2797-08d8ce886dee X-MS-Exchange-CrossTenant-AuthSource: BYAPR10MB3573.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Feb 2021 12:27:43.0332 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 2l6iqwEowrfbsUL2Q1pb+hy78MW/ZNhtx9gxvqcMdf/9r9ZG21OnCQbY4jpvi6xHeJ52HA0aMW21CLio3R4UO50cD/tkrkISgENTySX4/Gs= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR10MB4339 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9891 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 spamscore=0 phishscore=0 mlxscore=0 malwarescore=0 mlxlogscore=999 bulkscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2102110111 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9891 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 malwarescore=0 priorityscore=1501 bulkscore=0 spamscore=0 impostorscore=0 mlxscore=0 suspectscore=0 mlxlogscore=999 adultscore=0 clxscore=1011 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2102110111 Precedence: bulk List-ID: X-Mailing-List: target-devel@vger.kernel.org This breaks up target_submit_cmd_map_sgls into 3 helpers: - target_init_cmd: Do the basic general setup and get a refcount to the session to make sure the caller can execute the cmd. - target_submit_prep: Do the mapping, cdb processing and get a ref to the lun. - target_submit: Pass the cmd to LIO core for execution. The above functions must be used by drivers that either: 1. rely on lio for session shutdown synchronization by calling target_stop_session. 2. need to map sgls When the next patches are applied then simple drivers that do not need the extra functionality above can use target_submit_cmd and not worry about failures being returned and how to handle them, since many drivers were getting this wrong and would have hit refcount bugs. Also, by breaking target_submit_cmd_map_sgls up into these 3 helper functions, we can allow the later patches to do the init/prep from interrupt context and then do the submission from a workqueue. Cc: Bart Van Assche Cc: Juergen Gross Cc: Hannes Reinecke Cc: Nilesh Javali Cc: Michael Cyr Cc: Chris Boot Cc: Felipe Balbi Cc: "Michael S. Tsirkin" Cc: Stefan Hajnoczi Signed-off-by: Mike Christie Reviewed-by: Christoph Hellwig --- drivers/target/target_core_transport.c | 200 +++++++++++++++++-------- include/target/target_core_fabric.h | 8 + 2 files changed, 147 insertions(+), 61 deletions(-) diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c index 013f4a5e8972..a82b7da09872 100644 --- a/drivers/target/target_core_transport.c +++ b/drivers/target/target_core_transport.c @@ -1571,46 +1571,31 @@ transport_generic_map_mem_to_cmd(struct se_cmd *cmd, struct scatterlist *sgl, } /** - * target_submit_cmd_map_sgls - lookup unpacked lun and submit uninitialized - * se_cmd + use pre-allocated SGL memory. - * - * @se_cmd: command descriptor to submit + * target_init_cmd - initialize se_cmd + * @se_cmd: command descriptor to init * @se_sess: associated se_sess for endpoint - * @cdb: pointer to SCSI CDB * @sense: pointer to SCSI sense buffer * @unpacked_lun: unpacked LUN to reference for struct se_lun * @data_length: fabric expected data transfer length * @task_attr: SAM task attribute * @data_dir: DMA data direction * @flags: flags for command submission from target_sc_flags_tables - * @sgl: struct scatterlist memory for unidirectional mapping - * @sgl_count: scatterlist count for unidirectional mapping - * @sgl_bidi: struct scatterlist memory for bidirectional READ mapping - * @sgl_bidi_count: scatterlist count for bidirectional READ mapping - * @sgl_prot: struct scatterlist memory protection information - * @sgl_prot_count: scatterlist count for protection information * * Task tags are supported if the caller has set @se_cmd->tag. * - * Returns non zero to signal active I/O shutdown failure. All other - * setup exceptions will be returned as a SCSI CHECK_CONDITION response, - * but still return zero here. + * Returns: + * - less than zero to signal active I/O shutdown failure. + * - zero on success. * - * This may only be called from process context, and also currently - * assumes internal allocation of fabric payload buffer by target-core. + * If the fabric driver calls target_stop_session, then it must check the + * return code and handle failures. This will never fail for other drivers, + * and the return code can be ignored. */ -int target_submit_cmd_map_sgls(struct se_cmd *se_cmd, struct se_session *se_sess, - unsigned char *cdb, unsigned char *sense, u64 unpacked_lun, - u32 data_length, int task_attr, int data_dir, int flags, - struct scatterlist *sgl, u32 sgl_count, - struct scatterlist *sgl_bidi, u32 sgl_bidi_count, - struct scatterlist *sgl_prot, u32 sgl_prot_count) +int target_init_cmd(struct se_cmd *se_cmd, struct se_session *se_sess, + unsigned char *sense, u64 unpacked_lun, + u32 data_length, int task_attr, int data_dir, int flags) { struct se_portal_group *se_tpg; - sense_reason_t rc; - int ret; - - might_sleep(); se_tpg = se_sess->se_tpg; BUG_ON(!se_tpg); @@ -1618,53 +1603,69 @@ int target_submit_cmd_map_sgls(struct se_cmd *se_cmd, struct se_session *se_sess if (flags & TARGET_SCF_USE_CPUID) se_cmd->se_cmd_flags |= SCF_USE_CPUID; + /* + * Signal bidirectional data payloads to target-core + */ + if (flags & TARGET_SCF_BIDI_OP) + se_cmd->se_cmd_flags |= SCF_BIDI; + + if (flags & TARGET_SCF_UNKNOWN_SIZE) + se_cmd->unknown_data_length = 1; /* * Initialize se_cmd for target operation. From this point * exceptions are handled by sending exception status via * target_core_fabric_ops->queue_status() callback */ - __target_init_cmd(se_cmd, se_tpg->se_tpg_tfo, se_sess, - data_length, data_dir, task_attr, sense, - unpacked_lun); + __target_init_cmd(se_cmd, se_tpg->se_tpg_tfo, se_sess, data_length, + data_dir, task_attr, sense, unpacked_lun); - if (flags & TARGET_SCF_UNKNOWN_SIZE) - se_cmd->unknown_data_length = 1; /* * Obtain struct se_cmd->cmd_kref reference. A second kref_get here is * necessary for fabrics using TARGET_SCF_ACK_KREF that expect a second * kref_put() to happen during fabric packet acknowledgement. */ - ret = target_get_sess_cmd(se_cmd, flags & TARGET_SCF_ACK_KREF); - if (ret) - return ret; - /* - * Signal bidirectional data payloads to target-core - */ - if (flags & TARGET_SCF_BIDI_OP) - se_cmd->se_cmd_flags |= SCF_BIDI; + return target_get_sess_cmd(se_cmd, flags & TARGET_SCF_ACK_KREF); +} +EXPORT_SYMBOL_GPL(target_init_cmd); + +/** + * target_submit_prep - prepare cmd for submission + * @se_cmd: command descriptor to prep + * @cdb: pointer to SCSI CDB + * @sgl: struct scatterlist memory for unidirectional mapping + * @sgl_count: scatterlist count for unidirectional mapping + * @sgl_bidi: struct scatterlist memory for bidirectional READ mapping + * @sgl_bidi_count: scatterlist count for bidirectional READ mapping + * @sgl_prot: struct scatterlist memory protection information + * @sgl_prot_count: scatterlist count for protection information + * + * Returns: + * - less than zero to signal failure. + * - zero on success. + * If failure is returned, lio will the callers queue_status to complete + * the cmd. + */ +int target_submit_prep(struct se_cmd *se_cmd, unsigned char *cdb, + struct scatterlist *sgl, u32 sgl_count, + struct scatterlist *sgl_bidi, u32 sgl_bidi_count, + struct scatterlist *sgl_prot, u32 sgl_prot_count) +{ + sense_reason_t rc; rc = target_cmd_init_cdb(se_cmd, cdb); - if (rc) { - transport_send_check_condition_and_sense(se_cmd, rc, 0); - target_put_sess_cmd(se_cmd); - return 0; - } + if (rc) + goto send_cc_direct; /* * Locate se_lun pointer and attach it to struct se_cmd */ rc = transport_lookup_cmd_lun(se_cmd); - if (rc) { - transport_send_check_condition_and_sense(se_cmd, rc, 0); - target_put_sess_cmd(se_cmd); - return 0; - } + if (rc) + goto send_cc_direct; rc = target_cmd_parse_cdb(se_cmd); - if (rc != 0) { - transport_generic_request_failure(se_cmd, rc); - return 0; - } + if (rc != 0) + goto generic_fail; /* * Save pointers for SGLs containing protection information, @@ -1684,6 +1685,41 @@ int target_submit_cmd_map_sgls(struct se_cmd *se_cmd, struct se_session *se_sess if (sgl_count != 0) { BUG_ON(!sgl); + rc = transport_generic_map_mem_to_cmd(se_cmd, sgl, sgl_count, + sgl_bidi, sgl_bidi_count); + if (rc != 0) + goto generic_fail; + } + + return 0; + +send_cc_direct: + transport_send_check_condition_and_sense(se_cmd, rc, 0); + target_put_sess_cmd(se_cmd); + return -EIO; + +generic_fail: + transport_generic_request_failure(se_cmd, rc); + return -EIO; +} +EXPORT_SYMBOL_GPL(target_submit_prep); + +/** + * target_submit - perform final initialization and submit cmd to LIO core + * @se_cmd: command descriptor to submit + * + * target_submit_prep must have been called on the cmd, and this must be + * called from process context. + */ +void target_submit(struct se_cmd *se_cmd) +{ + struct scatterlist *sgl = se_cmd->t_data_sg; + unsigned char *buf = NULL; + + might_sleep(); + + if (se_cmd->t_data_nents != 0) { + BUG_ON(!sgl); /* * A work-around for tcm_loop as some userspace code via * scsi-generic do not memset their associated read buffers, @@ -1694,8 +1730,6 @@ int target_submit_cmd_map_sgls(struct se_cmd *se_cmd, struct se_session *se_sess */ if (!(se_cmd->se_cmd_flags & SCF_SCSI_DATA_CDB) && se_cmd->data_direction == DMA_FROM_DEVICE) { - unsigned char *buf = NULL; - if (sgl) buf = kmap(sg_page(sgl)) + sgl->offset; @@ -1705,12 +1739,6 @@ int target_submit_cmd_map_sgls(struct se_cmd *se_cmd, struct se_session *se_sess } } - rc = transport_generic_map_mem_to_cmd(se_cmd, sgl, sgl_count, - sgl_bidi, sgl_bidi_count); - if (rc != 0) { - transport_generic_request_failure(se_cmd, rc); - return 0; - } } /* @@ -1720,6 +1748,56 @@ int target_submit_cmd_map_sgls(struct se_cmd *se_cmd, struct se_session *se_sess core_alua_check_nonop_delay(se_cmd); transport_handle_cdb_direct(se_cmd); +} +EXPORT_SYMBOL_GPL(target_submit); + +/** + * target_submit_cmd_map_sgls - lookup unpacked lun and submit uninitialized + * se_cmd + use pre-allocated SGL memory. + * + * @se_cmd: command descriptor to submit + * @se_sess: associated se_sess for endpoint + * @cdb: pointer to SCSI CDB + * @sense: pointer to SCSI sense buffer + * @unpacked_lun: unpacked LUN to reference for struct se_lun + * @data_length: fabric expected data transfer length + * @task_attr: SAM task attribute + * @data_dir: DMA data direction + * @flags: flags for command submission from target_sc_flags_tables + * @sgl: struct scatterlist memory for unidirectional mapping + * @sgl_count: scatterlist count for unidirectional mapping + * @sgl_bidi: struct scatterlist memory for bidirectional READ mapping + * @sgl_bidi_count: scatterlist count for bidirectional READ mapping + * @sgl_prot: struct scatterlist memory protection information + * @sgl_prot_count: scatterlist count for protection information + * + * Task tags are supported if the caller has set @se_cmd->tag. + * + * Returns non zero to signal active I/O shutdown failure. All other + * setup exceptions will be returned as a SCSI CHECK_CONDITION response, + * but still return zero here. + * + * This may only be called from process context, and also currently + * assumes internal allocation of fabric payload buffer by target-core. + */ +int target_submit_cmd_map_sgls(struct se_cmd *se_cmd, struct se_session *se_sess, + unsigned char *cdb, unsigned char *sense, u64 unpacked_lun, + u32 data_length, int task_attr, int data_dir, int flags, + struct scatterlist *sgl, u32 sgl_count, + struct scatterlist *sgl_bidi, u32 sgl_bidi_count, + struct scatterlist *sgl_prot, u32 sgl_prot_count) +{ + int rc; + + rc = target_init_cmd(se_cmd, se_sess, sense, unpacked_lun, + data_length, task_attr, data_dir, flags); + if (rc < 0) + return rc; + + + target_submit_prep(se_cmd, cdb, sgl, sgl_count, sgl_bidi, + sgl_bidi_count, sgl_prot, sgl_prot_count); + target_submit(se_cmd); return 0; } EXPORT_SYMBOL(target_submit_cmd_map_sgls); diff --git a/include/target/target_core_fabric.h b/include/target/target_core_fabric.h index 4975c4d2a933..4b5f6687393a 100644 --- a/include/target/target_core_fabric.h +++ b/include/target/target_core_fabric.h @@ -151,6 +151,14 @@ void transport_deregister_session(struct se_session *); void __target_init_cmd(struct se_cmd *, const struct target_core_fabric_ops *, struct se_session *, u32, int, int, unsigned char *, u64); +int target_init_cmd(struct se_cmd *se_cmd, struct se_session *se_sess, + unsigned char *sense, u64 unpacked_lun, u32 data_length, + int task_attr, int data_dir, int flags); +int target_submit_prep(struct se_cmd *se_cmd, unsigned char *cdb, + struct scatterlist *sgl, u32 sgl_count, + struct scatterlist *sgl_bidi, u32 sgl_bidi_count, + struct scatterlist *sgl_prot, u32 sgl_prot_count); +void target_submit(struct se_cmd *se_cmd); sense_reason_t transport_lookup_cmd_lun(struct se_cmd *); sense_reason_t target_cmd_init_cdb(struct se_cmd *, unsigned char *); sense_reason_t target_cmd_parse_cdb(struct se_cmd *); From patchwork Thu Feb 11 12:27:19 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 12083097 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0A273C433E6 for ; Thu, 11 Feb 2021 12:33:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CB18C64E05 for ; Thu, 11 Feb 2021 12:33:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229756AbhBKMdV (ORCPT ); Thu, 11 Feb 2021 07:33:21 -0500 Received: from aserp2120.oracle.com ([141.146.126.78]:43084 "EHLO aserp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230394AbhBKMai (ORCPT ); Thu, 11 Feb 2021 07:30:38 -0500 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 11BCQ4H2051003; Thu, 11 Feb 2021 12:27:47 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2020-01-29; bh=fIz/kU7AU/Dmnv3suS4j2gfgz61wIwvzWUt9pA7gW1g=; b=VainIfV9r4DsDrjgwRuwDCD9Xh5+hQrpbaWgZ1C+ec8eJvYn5ShIJtFGoaUODAkL/J0o kZNf5GoQXFTIHZ2+pFRLhEK3Cbc3hI4aTmupsiyT3h+y+pI1tUqLKG5nS1r39eFvaIQG po0MwCV6Q8gVEADxTU0+v51IUTYtgA6FRAR9jU1s0rWHYGX4/5VoUPwO1JQ7Ug1Cg3UD UE6SXWDgFcIIvFwE37VmU+SLqTSEFnywL0jZ5qi1xJu0TY52WPpFzadrSuM7t/hckKHe sAJ1SwVDqP+SUZMKuXLipeA6b915ctSrxUkOrk7FrrZvH9C65OnHOZGZtSKXdiGC7pYC Yg== Received: from userp3030.oracle.com (userp3030.oracle.com [156.151.31.80]) by aserp2120.oracle.com with ESMTP id 36m4upws4k-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 11 Feb 2021 12:27:47 +0000 Received: from pps.filterd (userp3030.oracle.com [127.0.0.1]) by userp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 11BCP7qN052228; Thu, 11 Feb 2021 12:27:46 GMT Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2104.outbound.protection.outlook.com [104.47.55.104]) by userp3030.oracle.com with ESMTP id 36j51yxtx1-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 11 Feb 2021 12:27:46 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hgE8fbrK+BITFyZU88BqKIc0STcgO3HVlwbqH+TsIptM4BFPmHAt91QX5G1pLh336XMvsCPjDcTfslapvenfh07/LTOuYpGAu+/Wsuy0GF18F6b+cbPFSDneQQqZWg4JgL5AvzfsGMACvmd5t4HoNO8k9uahZQs10b0WRHbMNPuvyHv1Oeo4lpC4mdrs21a4tRyldwkENbX9y7yTX5PMUh4/RWRdI3rpBdsoxdYmzgRXvYgbn55LYdgcCWop+Ol3Xo8fZcvJk+b2cq4vi+LNKO6XXq3BT93wxnnoX/Js0CH37IsnVaJPVwRD1RovyUQ9J6oKaojjydbfWdw3WCkXuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=fIz/kU7AU/Dmnv3suS4j2gfgz61wIwvzWUt9pA7gW1g=; b=VmXPPdV0hI8tcaWL6jFIjmVam54ZN6iN5FwtRH42dwG4ibjxiSqHzUdssc0c0H7kdVNGqg31DGK1sinc4biXanvlO9Maxqn2W9mfdp6NLaKFY48PtsfjQevqdGdJVGZ2UO69LxkMOJ9HLuLbo2lyEERlhf69bveXI38OqIGwnwX9Ovfib/jyUfsaSW0J2/t7ke12yNp0lSw8Jqh0m6exCTtSBHAsDGEEXqXo4c9jfJwiU2MM+cdYurhszljIdYQkydYc/AvhKk7ZAv2RtiFggdkSRQFLtq+ZPh8MEEVmNYPEtKCHrlTSqs61+byFGo2Z0zJceXNvUPIaxduMFuzp/w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=fIz/kU7AU/Dmnv3suS4j2gfgz61wIwvzWUt9pA7gW1g=; b=bTiyp1LHxGBSM/e9QboI8WtQiI1jf94xYHH2ppKOg4L/1UTdTEZj1eA13BMgos1CO6T1WEBafHH0iPLYvm58mNBKZLnjdV1djMeiJaKuAZxPWE77AcJwr9QtgrzLN5wXuDKOLoRC9c6AJuCsHw8jdQGJ5DRbO8AcQoHuiYkafJ0= Authentication-Results: lst.de; dkim=none (message not signed) header.d=none;lst.de; dmarc=none action=none header.from=oracle.com; Received: from BYAPR10MB3573.namprd10.prod.outlook.com (2603:10b6:a03:11e::32) by BY5PR10MB4339.namprd10.prod.outlook.com (2603:10b6:a03:20a::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3846.27; Thu, 11 Feb 2021 12:27:44 +0000 Received: from BYAPR10MB3573.namprd10.prod.outlook.com ([fe80::1d86:b9d7:c9ef:ba20]) by BYAPR10MB3573.namprd10.prod.outlook.com ([fe80::1d86:b9d7:c9ef:ba20%7]) with mapi id 15.20.3825.030; Thu, 11 Feb 2021 12:27:44 +0000 From: Mike Christie To: hch@lst.de, loberman@redhat.com, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, target-devel@vger.kernel.org, mst@redhat.com, stefanha@redhat.com Cc: Mike Christie , Bart Van Assche Subject: [PATCH 05/14] srpt: Convert to new submission API Date: Thu, 11 Feb 2021 06:27:19 -0600 Message-Id: <20210211122728.31721-6-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210211122728.31721-1-michael.christie@oracle.com> References: <20210211122728.31721-1-michael.christie@oracle.com> X-Originating-IP: [73.88.28.6] X-ClientProxiedBy: CH0PR04CA0060.namprd04.prod.outlook.com (2603:10b6:610:77::35) To BYAPR10MB3573.namprd10.prod.outlook.com (2603:10b6:a03:11e::32) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (73.88.28.6) by CH0PR04CA0060.namprd04.prod.outlook.com (2603:10b6:610:77::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3846.25 via Frontend Transport; Thu, 11 Feb 2021 12:27:43 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0981be8f-9c8c-4c8d-e267-08d8ce886ea9 X-MS-TrafficTypeDiagnostic: BY5PR10MB4339: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3276; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: kVyRqqyq7pDxdZsl2h0kpGD3FXaqyiQDiKaLL4FgYGkAIKdPFoL+3d+lX/e+nnmBV3egUNTDSChxskHFKLVHAMCW1olUhek+fpoH2QNlovsT3Vlk9ebQccuCy5yJa6TkxYRFyFoOePiO5UDrL4Xay435AlA9uUT2U9SQjLSWLFzEmfZ0B0W8m+boAk73EbZn8F1aHWodXqmbRfukDttgq6ZtvAjyRvcWMgzgLNMlzxdSBmgsI2uapLrs4HUeRMCCgReDFPwMAZYXPrj9YJ7CA/EkEhWXinu8bhOEABdwomq2NZymwtHS1ZFvSQsbBdxcUUK96BR5PA3hR++/R4irim4UaDSWg7II9rEZJG/70VZy4qbGc2X9LVHrntnSh17xoRKX50itiF/9a5GlReRmbLpDNPYqqNG9mbdn557jHy0sGPLAasWz9RE65ULUCLUKSFlWsBtvqRsHXpTy9nIcuWqcGGBMo/VeKifUL65w7Zd/lt70Rp0GpVOcA+P0mnnr45xul7KhdtFSBjCq//GMEkwSCXhXCWz8ngDUa2cUL1g/GYfEnbCeYDG3Isq+08942VTN9ev6mLJndqsC10H80Q== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BYAPR10MB3573.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(366004)(346002)(39860400002)(136003)(376002)(396003)(83380400001)(1076003)(6512007)(16526019)(2906002)(4326008)(6506007)(478600001)(316002)(186003)(6486002)(8936002)(26005)(52116002)(66946007)(86362001)(6666004)(54906003)(8676002)(2616005)(36756003)(5660300002)(66556008)(69590400011)(956004)(66476007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: YJu2FtS0yqj+hncFHkpRIrar/Mm9Z3VBdc41jLzifTnDvLvS/YC4pcS7XFLjL0VGdBFyN4BilROhLjjKTYV9lGgXlG1f0nWjRCQe4OJTi9JwxFuA9pQnDdqOD6+RHpIRUTJhccZ2DNPPIQ2Y6uxiFu8Q8F1Nb4knEqgbcIu8a/Vzg7ahf/PiYgoaANu5zLPvasvbk+k0tA19bYaJvE0N1R1udb61ag3pQMMQgPUHhVzSCpiuSJ/CSIwGn9eck6ng+OmkuKiDzLgIa2jKRDEZ7gDJKpy3nidlMfmeNXKsadR8lnfkhW0KV6LiWZj4zxs9bdpdZ1qyFnSNasSan/RsRFWF4+NvF3r6PO5/AOfVzr6nDW8lQqigFKoia6IpZHirDmDvdnXDesdomBbNx1iu5VywsukoGOgCBv/Qv65929m59i7rsGXcielaakuOFtXrM/MjsqM6T0umQ7kaORFCmyEhs/zdErfcJgvRXo1KVaXeeXur9/Wd27AUqtZwI81oeqOR24x5M84EdGUcoBk2rec4YnkCEGdkysn+e6OHpmiUoPzmb0MhyK4JjtzDKvkZme8I0RQSxmDatYmqyUDb2MwRz/6hSW2/VZaVJ07cwt2pzGNRHrdZMJQxwNmbOn0Cj6v+x0RH/NVYIeLvxOhTOcmFyxCJw2I68qYc3IL+BVjcFy50UxIOkZE/hEa3XzhcLgN9gJd43pN6RuPSpksRHsKLg3pN9OnJrZn+VK7yxAV3TJLQ1fI1V2WYSGO5MUCWb2kTlLI15OhvKztmdL4RxJEajyTkMTSrFKq3AU2cCiU6pYv2IobATkNgEhs44pMSU3s3My5MqXSdKLZUb7AahKMmY8TZ7RjZbSSLrdNRcukmJ9KYVvKrIh0B1Ijhn62RD/r1ioA5igOGOimBAA57W+1LGCnDrjxF/4SXVwMP/rQwG2pHibupvnZIsdr74tEdXSBeMiIbJxoaQCRX4k5hCMfZyeaZ1g4OPUUcqYfefjn4CHJfK+q+5wDzSnRsKUgiGDRnIhC1tAqfBj1ggnCgWoL4b237d+yYXijJQj+Ma5lbmAw3CWzG2zPQU1I4JsiZtvhCMERmpBHIWKeQZS3lZyyZjPOWImeeDCVxLjGNcRbsmOz7LuvYZYmNAvRaHX889JDGkqYcPgKZ4+vNuhiPqPBJx8rCWJeYOk6JQhG27Nb1X3ZhpIN4qVr1JbaYLz9xOSEM805UQdisVz2I68feRAGdf0AY3YmO9EecA9sU1gNAQ+uhe/CSEnsBMQrAzq+ALk/XWVE7AJkMt6/4CsT55kn1vjN+ELlU0Ba/4Ru1K2aWLqq2kniSWqJxlerJG9F3 X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0981be8f-9c8c-4c8d-e267-08d8ce886ea9 X-MS-Exchange-CrossTenant-AuthSource: BYAPR10MB3573.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Feb 2021 12:27:44.2495 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: MDE55xBCo0M7mbupA4jnmZJQOCuHnQoPyxR+i2dVRKuHAhmlVQMUOWWU964C6tUn3uzQDUgEOJc3vx6szy4IEBPXSG/u2PCIARYgYIAG2Fk= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR10MB4339 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9891 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 spamscore=0 phishscore=0 mlxscore=0 malwarescore=0 mlxlogscore=999 bulkscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2102110111 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9891 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 mlxscore=0 mlxlogscore=999 spamscore=0 impostorscore=0 malwarescore=0 clxscore=1015 suspectscore=0 adultscore=0 bulkscore=0 lowpriorityscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2102110111 Precedence: bulk List-ID: X-Mailing-List: target-devel@vger.kernel.org target_submit_cmd_map_sgls is being removed, so convert srpt to the new submission API. srpt uses target_stop_session to sync session shutdown with lio core, so we use target_init_cmd/target_submit_prep/target_submit, because target_init_cmd will detect the target_stop_session call and return an error. Cc: Bart Van Assche Signed-off-by: Mike Christie Reviewed-by: Christoph Hellwig --- drivers/infiniband/ulp/srpt/ib_srpt.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/drivers/infiniband/ulp/srpt/ib_srpt.c b/drivers/infiniband/ulp/srpt/ib_srpt.c index 6be60aa5ffe2..87741e0b4bca 100644 --- a/drivers/infiniband/ulp/srpt/ib_srpt.c +++ b/drivers/infiniband/ulp/srpt/ib_srpt.c @@ -1528,16 +1528,19 @@ static void srpt_handle_cmd(struct srpt_rdma_ch *ch, goto busy; } - rc = target_submit_cmd_map_sgls(cmd, ch->sess, srp_cmd->cdb, - &send_ioctx->sense_data[0], - scsilun_to_int(&srp_cmd->lun), data_len, - TCM_SIMPLE_TAG, dir, TARGET_SCF_ACK_KREF, - sg, sg_cnt, NULL, 0, NULL, 0); + rc = target_init_cmd(cmd, ch->sess, &send_ioctx->sense_data[0], + scsilun_to_int(&srp_cmd->lun), data_len, + TCM_SIMPLE_TAG, dir, TARGET_SCF_ACK_KREF); if (rc != 0) { pr_debug("target_submit_cmd() returned %d for tag %#llx\n", rc, srp_cmd->tag); goto busy; } + + if (target_submit_prep(cmd, srp_cmd->cdb, sg, sg_cnt, NULL, 0, NULL, 0)) + return; + + target_submit(cmd); return; busy: From patchwork Thu Feb 11 12:27:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 12083083 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D6060C4332E for ; Thu, 11 Feb 2021 12:32:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id AEB0964D79 for ; Thu, 11 Feb 2021 12:32:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230232AbhBKMbv (ORCPT ); Thu, 11 Feb 2021 07:31:51 -0500 Received: from aserp2130.oracle.com ([141.146.126.79]:40414 "EHLO aserp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231404AbhBKM2i (ORCPT ); Thu, 11 Feb 2021 07:28:38 -0500 Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 11BCO13n097781; Thu, 11 Feb 2021 12:27:47 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2020-01-29; bh=F+aFqwutfhlKA5d+xVW2njaqXGESiPHOWifQWDUFqR4=; b=oPf7FcJEcsXizhV30c4lJibjdDl04NJCsI4/Ep/r54DN2n4VBYkFYXFPdbKksllzArtb +VzW/t5O4DDiHiiEMI2HtcP4t+sAGXnIOYq1jwfKx5tSsWvI8GiDw49OIebCexS4jXHT RMxARhYuqA+n5YTD1GG9tfJWYJ/e1JM1xynCIULiMB6eU2by1tutlKeuP1I8qeBgdKCi lM7vGKZV1HzvcGYYAleW/T1gGA39vMLPrgQP2f9Ys/FdcQwRS8GwAUrSdRb+zQw9EMXo GV/zGH8+OM7Dtp0X7veL/rpbNCWeLvx0PNPm39WNcJZzOwj6nSXDwzj54uRhVud/pMV7 4A== Received: from userp3030.oracle.com (userp3030.oracle.com [156.151.31.80]) by aserp2130.oracle.com with ESMTP id 36hgmaqby5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 11 Feb 2021 12:27:47 +0000 Received: from pps.filterd (userp3030.oracle.com [127.0.0.1]) by userp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 11BCP7qP052228; Thu, 11 Feb 2021 12:27:46 GMT Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2104.outbound.protection.outlook.com [104.47.55.104]) by userp3030.oracle.com with ESMTP id 36j51yxtx1-3 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 11 Feb 2021 12:27:46 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=D/1jDd4KJvPsxa/9tgwH1vKAXSBE7XPwdXSFc9ci0DDhoib4vjAldX3KbuR2zW1tCJSr5NmBu4tNqcgSxkeabJiT7vrJslNiWSkgFeI/PchVHXgCM6UoUhWaK057/Ikw6GQdF3FTSFt9EIoDK2Ek31+5xPlYAhskCPIkpSskPayneJoU83vuuMrCjFHJ+h3U6OQjur/cla2LjueLydW2tRK8UvNu3FXi+DQfdOthyWxMYNlkzQG421mej+UJs1gBF2L13KbWwZWsFdtntxhwKrI+fURm9iOkNI4ljD+ko1mtiUJSH+2ARAUaQRMasuiU2UJXg6+TAQXwOrt6+Y8RGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=F+aFqwutfhlKA5d+xVW2njaqXGESiPHOWifQWDUFqR4=; b=hR13FIxeCmzFBcA3kPsaB9bIlw99ooy2billsp9fRJE04045ckmi1ZSwnGp7ZCG00QfPcRap9Nk1IlQ5/14kszP/InBqDt+13RMKxq7w828cYto4uuzaUATFtuG34i/ThFoVv+bby4Hg1jEsJ5lfFPtE8CW9LWf5FeET2An3mugUNnTNSRTsqtfZ4MLDcmXueu6LXG9VX3R7uzjXe1Z8DVKmcMmey0euPb7m0JuhMGRsf0dzqphWt0A2d/1jpteK/t9esp/QfJ4Qr5Yo5dsWuhY3ATfG6Y/dof3SZM3Z2BA5eH4/YIzeBj5rI+MpT8qPKyPws2OCcDfU1LKJvKItIg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=F+aFqwutfhlKA5d+xVW2njaqXGESiPHOWifQWDUFqR4=; b=zjgJjeUxT+T7ips/sAT3Ba2+Xdit5e26Evq1N1g8pt+sBmWjCJEFcdo0MF2z9HyDDCsie+NjbeaAqE+190e0AMF7KAIPd5oCdmwCSI7C7XsCc0YPiyn3XwHMIV/HiFPWlPKLxd76t6t3WR1Bfn2a9QLQIyptNQDEBilXakNiQeo= Authentication-Results: lst.de; dkim=none (message not signed) header.d=none;lst.de; dmarc=none action=none header.from=oracle.com; Received: from BYAPR10MB3573.namprd10.prod.outlook.com (2603:10b6:a03:11e::32) by BY5PR10MB4339.namprd10.prod.outlook.com (2603:10b6:a03:20a::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3846.27; Thu, 11 Feb 2021 12:27:45 +0000 Received: from BYAPR10MB3573.namprd10.prod.outlook.com ([fe80::1d86:b9d7:c9ef:ba20]) by BYAPR10MB3573.namprd10.prod.outlook.com ([fe80::1d86:b9d7:c9ef:ba20%7]) with mapi id 15.20.3825.030; Thu, 11 Feb 2021 12:27:45 +0000 From: Mike Christie To: hch@lst.de, loberman@redhat.com, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, target-devel@vger.kernel.org, mst@redhat.com, stefanha@redhat.com Cc: Mike Christie , Michael Cyr Subject: [PATCH 06/14] ibmvscsi_tgt: Convert to new submission API Date: Thu, 11 Feb 2021 06:27:20 -0600 Message-Id: <20210211122728.31721-7-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210211122728.31721-1-michael.christie@oracle.com> References: <20210211122728.31721-1-michael.christie@oracle.com> X-Originating-IP: [73.88.28.6] X-ClientProxiedBy: CH0PR04CA0060.namprd04.prod.outlook.com (2603:10b6:610:77::35) To BYAPR10MB3573.namprd10.prod.outlook.com (2603:10b6:a03:11e::32) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (73.88.28.6) by CH0PR04CA0060.namprd04.prod.outlook.com (2603:10b6:610:77::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3846.25 via Frontend Transport; Thu, 11 Feb 2021 12:27:44 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 59699fee-181f-4603-c95c-08d8ce886f5a X-MS-TrafficTypeDiagnostic: BY5PR10MB4339: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5797; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: bqA8wYa64d7QDJBUu8eSYCI5qJNhvAdgwZTChHO/f6qYbDNF8f5ceMlPYfuFUuUINJihPQd0CxXy/fwsBrNgJPS9IULz9bPGfRWRG5uRlUb4lCFYgA3UfPera3YHD4hyjsEk3f4vSKOyJMfe6DsWpGGUmm2J08JMmFA2iKZakNbA0CcLgFVBOth/PMGQxTa59XnLUJhwxA+kXPm0jjawMFGp70t7HmSRovOCan/6qAcMaXOH+1v0GAOdtE6jjE+rVComyaobtpQHaN6pJF9Ug4Y0ffP9tvOJ34dPZzpbgF0D/z5BrC/DtrD1w8YYD08ff+6XEdCAxYgU6LRdAwpYuKV9SJIBum4aFYSk/grROg+5uhzEcqIKgB+0FdYTwmocn+eb7zg3/VPNdNnxzjz8d63jSqRbCo/eLx7SAh3+3Dpw3ZeBi46h9zMi2WydVliAWwSIro4SKx9qJLAbnSRQ9OssMMCA5DQAZCFMti/3h/pOvvp4NzWrTADaad/CyqUX2kuOonRZpSK07tA/JIlGMoAAMkjjk48pUE+KLHbR9w9pHsxF0oFeE19qQgpenfZygSLcxC9MEaKLo5YNUmchZw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BYAPR10MB3573.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(366004)(346002)(39860400002)(136003)(376002)(396003)(83380400001)(1076003)(6512007)(16526019)(2906002)(4326008)(6506007)(478600001)(316002)(186003)(6486002)(8936002)(26005)(52116002)(66946007)(86362001)(6666004)(54906003)(8676002)(2616005)(36756003)(5660300002)(66556008)(69590400011)(956004)(66476007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: TOZnqHPszNxJb5O5AVnOTC2ZSfChqQV4uj/O8JgJXvEWOGrYgXhefPEA/trU8zRhvUdTzsB1tu0u8kcGPY925WqHn3Z0R48OABYZp1HbfhBQQfNMHYznikFqZNCKSba0X4aSwFswy+R5Gu9mcUty7QRB15mP0tzaIcYzDYCC/M/kJ7rrQJYZRahvwLMZvySGjuJhqPmQBW7aNCv4EA6s4MIJP+2Cuhf659XoL9RmyBtXRg808ooevfrb6qaGpNlA+gIGd2V1ijKQGUnL2TILpNK0TTvnyaqbMVL7br0Z15RZO50m7mVJNYhczPfj3AViIBv2m9KJvARPJsvbNza9ZoJ6cB5npFxtMFdVWPiETflG9jprYDnv7w/VXiTFXJ1Kzux7ASkQuINxqMVvG5uhGDJ3Wkhdb27s8LDyali4UWR2wXHEDbZQabvYVamlpRv1E3fqxJKBKEljaPAP2t19DNWqXLzui47OiAMMm+ap4Xj2eQoy5EXN2yC6jsWZjmC1UO+whtnJJB1HVjYUEifRKWW059WrWEcXX9hC8IO+tWpk0BosEwSmncIacXsL1G0GmesD9AII66lmjTiWxRlKHIC0GPhFl2uLf6aESpIs7TUETG5y9s7VJcIa1Qu4x4mkqbZ7yXU5HhgsgqfyY7M2ME6zEvn58omup00yDCFKQjMqqeBtOzKgmjIyS6a+WYmsgalRA1q75YdD3kg4oTGLvEOUuYehqilMlOmExHLmpKmUlM30ZGXJVAyeN6tl6gGmVZjyBOay1lVbFQ+622/uvmNb+EIL4/uG5LuyqxdqQdQebjXJz/itCjV88O1tvr9Iab8Xp52LnCxKqRKIyPfpqVGIU0Smt4QEwBCZOnCmmBzUYWq35GJIRdFW3gGQjpn9wihfNCsBI1gkmgAJ30JpSfHXHNUlpI/aHFzn9yv9T7c1qRipb/Oo3JKTBAzACNDCJZSfFBOSViasN3p7DNx+LprmkC7ypvyFQ3wYd7NJ7WK5gSiM9WRmPBAFApN8/eb/exCxssSt4c/a4my+xv8XIUW/5civJkoRAVK2v4nXhRCGoNcUr5rN7ZbcMDkk+jRlMmFwFnjJ+ov0V/C+oub3JrYMTLotzocq1sPXZeyxN9+i6qcuAP7Ye9XAogdGI7nwPtCY/5yx70nwZpWjNuiWp3VklsHjnJXRgnMhD8Ep5VgqSyahytn5ktib8QnSF+4RXLoOVj7O5s/O8/+WqK80xJCRtVh+rzYu6rs6d86vi0oFk9VLxuHZLQsstKivoYmvsf4vv5wEPgglVBme4mj1bUISRVhx5+GFjyg76yYVPbOZmTWiB6hLtAuYYtRdHx0e X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 59699fee-181f-4603-c95c-08d8ce886f5a X-MS-Exchange-CrossTenant-AuthSource: BYAPR10MB3573.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Feb 2021 12:27:45.4878 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: MweyURyEpKjjiACuX/JBmSUFGdlVjmZ9AEIEoyHL7Le8t1CqAOdE+UNRE3o0ywVLrmczf0lFREzD89Ped2JgBGSLYACsAZyIg5dOGFUlkeY= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR10MB4339 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9891 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 spamscore=0 phishscore=0 mlxscore=0 malwarescore=0 mlxlogscore=999 bulkscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2102110111 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9891 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 spamscore=0 lowpriorityscore=0 phishscore=0 adultscore=0 impostorscore=0 suspectscore=0 mlxscore=0 clxscore=1015 mlxlogscore=999 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2102110111 Precedence: bulk List-ID: X-Mailing-List: target-devel@vger.kernel.org target_submit_cmd is now only for simple drivers that do their own sync during shutdown and do not use target_stop_session. It will never return a failure, so we can remove that code from the driver. Cc: Michael Cyr Signed-off-by: Mike Christie Reviewed-by: Christoph Hellwig --- drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c b/drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c index cc3908c2d2f9..cfc54532402c 100644 --- a/drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c +++ b/drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c @@ -2670,7 +2670,6 @@ static void ibmvscsis_parse_cmd(struct scsi_info *vscsi, u64 data_len = 0; enum dma_data_direction dir; int attr = 0; - int rc = 0; nexus = vscsi->tport.ibmv_nexus; /* @@ -2725,17 +2724,9 @@ static void ibmvscsis_parse_cmd(struct scsi_info *vscsi, srp->lun.scsi_lun[0] &= 0x3f; - rc = target_submit_cmd(&cmd->se_cmd, nexus->se_sess, srp->cdb, - cmd->sense_buf, scsilun_to_int(&srp->lun), - data_len, attr, dir, 0); - if (rc) { - dev_err(&vscsi->dev, "target_submit_cmd failed, rc %d\n", rc); - spin_lock_bh(&vscsi->intr_lock); - list_del(&cmd->list); - ibmvscsis_free_cmd_resources(vscsi, cmd); - spin_unlock_bh(&vscsi->intr_lock); - goto fail; - } + target_submit_cmd(&cmd->se_cmd, nexus->se_sess, srp->cdb, + cmd->sense_buf, scsilun_to_int(&srp->lun), + data_len, attr, dir, 0); return; fail: From patchwork Thu Feb 11 12:27:21 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 12083085 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BA705C433DB for ; Thu, 11 Feb 2021 12:32:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7BE6364E8A for ; Thu, 11 Feb 2021 12:32:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231396AbhBKMcA (ORCPT ); Thu, 11 Feb 2021 07:32:00 -0500 Received: from aserp2120.oracle.com ([141.146.126.78]:42108 "EHLO aserp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231439AbhBKM2i (ORCPT ); Thu, 11 Feb 2021 07:28:38 -0500 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 11BCQDZL051084; Thu, 11 Feb 2021 12:27:49 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2020-01-29; bh=Qph0xqbs6C/cp1mrm9ukKRA8oRiGuVIL99822tH8pBE=; b=n7X7/ulh8qNvMMYmKCbFoGrXBeUkbowZO5r4mnMX5mjJPp/wE3Xgca+6ztfCOls9Ndnt Roe2OeO2caK0SUVaKz2Q7OHtoU+A9DPz4ZZSndYA2Q9vLK4wVJ7sySy7qktWvSLapNo4 x9IrXBPtbY1Zr74PaT1oYxlY/h1DJXYSX1vvBIVUNfT7hZeFtXI7OzY5xXlTifVI9fi6 a98c2ombalR9vFhqSebQUiRdjAgxi/RmqmDrUcLhT1LBuo6Ozu0Tq2vB7iq0bKfxhO77 7UYMAtd/F3eB6D4Vd9NpfRTWRyv6efa+i3HM3nhPtBIJsIYCfI4xeMQkf4Y1GDcZ4+VD gA== Received: from userp3030.oracle.com (userp3030.oracle.com [156.151.31.80]) by aserp2120.oracle.com with ESMTP id 36m4upws4p-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 11 Feb 2021 12:27:49 +0000 Received: from pps.filterd (userp3030.oracle.com [127.0.0.1]) by userp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 11BCP7it052222; Thu, 11 Feb 2021 12:27:49 GMT Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2106.outbound.protection.outlook.com [104.47.55.106]) by userp3030.oracle.com with ESMTP id 36j51yxty7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 11 Feb 2021 12:27:48 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=h4IKhYJKnnhKAdEPy4HY8i16ddHNVco/aoHkgiiRGNCPVjnlNavbdIIcYMHyJ/y2SgIiD3k2m4VdDDPg0Opsw2HBDweG7+zQH0a9qYN0MvYyeWgBBIDtOyfYoyvEY2DF6GR400qOPOpdmUoga7eMG/Og4c59oV9rpJhBK/3KnVJZbkrG7XmnHkmWL4OFBPGbnjGHTEjmEGaBOI3PLwSKywuGaD8DUHy7us8Pk3HH4tNCEkNhmLso0po6FVucQQJwyH+RDGgALyRnQIzkH/Sh5Uwf0UJQKCXaNz36KO5SnIqv41uePenrhrI6b63EgTaujdXlBG1arY2qwGorof3hXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Qph0xqbs6C/cp1mrm9ukKRA8oRiGuVIL99822tH8pBE=; b=ERzkcIrD7LCkGRoBZ7889cI+RWcp4q6Pe7R2iYdtPy/ig8XyD1FsbIW8zulI2VKn76X8EE/8IaHezxkAgxtujVYQ7DyVRTS8o/wIDdhuDEr8stVuD7jZYr9b4LAc0Bj23dKYeWgJIFnU3SityS1PHBO0bW8pB4kfzWSrDQJ+t6QX4cjweXXUZK5YTacOYjtAkaBWBYNNJFsIoQwSNn7WCK8mF9YSx2BBZr668bD9k6NdMEKuc90GlBjPDMFHVKRbhEWzk2S9dkMz2awtGRryoEUHqxAVjhc1O/zVUhuUxJ3BL30TmWAVFyt2SmxUWFFQsBwp5qxuEZjRNZ2WCCJkAA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Qph0xqbs6C/cp1mrm9ukKRA8oRiGuVIL99822tH8pBE=; b=TYBUWUlwhPJewLB9N4BduAN0dw309RzPJfU8tRe+g+xOU5t/BQgu6UPsMf4MC4AKpvrQZbPnZhejL9pEGjIjqZ+c/mmmOttJ4LseJS0CFm8jFfrUr5pO3hkQnOqJn572KQaWZ24uaJfwZfZQ1EyBcYc1nJsphy+zY9d8IkrPogs= Authentication-Results: lst.de; dkim=none (message not signed) header.d=none;lst.de; dmarc=none action=none header.from=oracle.com; Received: from BYAPR10MB3573.namprd10.prod.outlook.com (2603:10b6:a03:11e::32) by BY5PR10MB4339.namprd10.prod.outlook.com (2603:10b6:a03:20a::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3846.27; Thu, 11 Feb 2021 12:27:47 +0000 Received: from BYAPR10MB3573.namprd10.prod.outlook.com ([fe80::1d86:b9d7:c9ef:ba20]) by BYAPR10MB3573.namprd10.prod.outlook.com ([fe80::1d86:b9d7:c9ef:ba20%7]) with mapi id 15.20.3825.030; Thu, 11 Feb 2021 12:27:46 +0000 From: Mike Christie To: hch@lst.de, loberman@redhat.com, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, target-devel@vger.kernel.org, mst@redhat.com, stefanha@redhat.com Cc: Mike Christie , Nilesh Javali Subject: [PATCH 07/14] qla2xxx: Convert to new submission API Date: Thu, 11 Feb 2021 06:27:21 -0600 Message-Id: <20210211122728.31721-8-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210211122728.31721-1-michael.christie@oracle.com> References: <20210211122728.31721-1-michael.christie@oracle.com> X-Originating-IP: [73.88.28.6] X-ClientProxiedBy: CH0PR04CA0060.namprd04.prod.outlook.com (2603:10b6:610:77::35) To BYAPR10MB3573.namprd10.prod.outlook.com (2603:10b6:a03:11e::32) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (73.88.28.6) by CH0PR04CA0060.namprd04.prod.outlook.com (2603:10b6:610:77::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3846.25 via Frontend Transport; Thu, 11 Feb 2021 12:27:45 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5c0bc79d-490c-481c-d62b-08d8ce88701d X-MS-TrafficTypeDiagnostic: BY5PR10MB4339: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2803; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: XS6QbrwR3cSwRGM2lnvkhUErWeXzvUv9nipadWNSelSIOmi448Da4MrSXash9kW0PFyNoRdcStFK6Bji9gKPuwt4JLcCaeBiVlNtmUSqhh3Omas5VeZ+UN1ImtsjRQCzQnRCgF6yAGksn4/LY+n7MbFnNc/QnmmTwltJF8nuXD0ZXpPXq3mCtDtPnD//QQUwo28mOxF5ytR8IUGGxSUofWay8y+zFUAteMwL+d7gNi/6Dng7b7VnoRaVIiafByZB9rK6Tu+5PQbaoNfFidFqM+tskuICCnPbNpeNMQGrN7WkLb1G0MTa65huupjtHDXlycTDm41ndGIvg7CBLWdrA4VZhmplTFVA7intk9uZ07TaQawC4+HmR+atUyJumYhB2hrA33kRzn0Ppop8myusfGaoO+CBzvXnLp605TAcO+VXghauQqQgGIzsHSbvZiIELqHLxDNWMDOpT2sQJnCCI37pCRbM/0zFjINJO4nVI5oF1y+zf/mxO6ZwS4DeQCarfKJkaZgRYCAmfNMz0AxP5YHTRhW0RcT2Nuy+HQ4+UtPpO7Fdyg17tWrnJCvUn63AyU6YKkuspxUbk8kU8g8E2Q== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BYAPR10MB3573.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(366004)(346002)(39860400002)(136003)(376002)(396003)(83380400001)(1076003)(6512007)(16526019)(2906002)(4326008)(6506007)(478600001)(316002)(186003)(6486002)(8936002)(26005)(52116002)(66946007)(86362001)(6666004)(54906003)(8676002)(2616005)(36756003)(5660300002)(66556008)(69590400011)(956004)(66476007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: o50FEnViF0QWTdmryzfTHzD7LOw83W7Pyypek3bbY5Bv+0M1WjwBBekERXxt317N3FrXhyRE1Uabamkz6GBmSH6XaSuStWcTiNbjrPjX1UOnV8ClYA6HevZOsqZSLgzxSOVyAIAaGmh73q6S9i9MOb4EEt+j8yM4tiSJu9A9U8Pc7Hfzibo55qr91DCnLkIUW4CYCcPONYBMXHd4rVq1IgZVAokxOgqu82tp4K0NmtDqNu5VcIRbsLLOB8R+5Q1fHzt8NVN84SeRiThv8v4UQ54dOnQwh29fhghOeaeJoTv/C3otMmxg283rhoQdNNhO4V0Jk1AoOnjDfOwUhtPjy8KdOYNC887x8mtNKHy6yYeICcBWn+nTEQJ18RFAffbkt32NC689AZDhsQtDjvh/Ie/HrQtEvfwzL+y+YqR895sRvZNKIb+e7wNjcX9j5PybMZIXECINqFJav/jfIZSfwH9QsuA2I68HR4d3Pn0pT5GwkRfTO9wtSg2JMLeF7avfXwIyHZkCyvzflVyUOQw7ADb76NeJkkom5yiGY3i6eIMPQgSnZoGRm6iRNhRQixMVrawBVdWSv3riyYS7aT1IruUSAEomf4M2HIIDb4bexq4oHeVdp0dwJ/IJPhdMWrmMFh9daPAXrIq2+dxwWnRrGoyuWHZS+5s8EryIilOwdVoD0S220msS6GZcSz4I6MjvElcG03zWfUgcfKYKFzPCvQjOxzfJRtq6Jltx8rnKixln8tkuK1C6GN6nqnNc+XTr0E+hYiLGN8QkwfAejvZMKNSfoieMrSFCkX+Ypg9tlrtLoOCMfMaNTMvxYiAKn3xo714eZN9XYIyeGxjyWHmWVgrmGDPYpdIQJ+GThkF55y4cPM5fxhXyV68VURqaYX3VuD8uyWnd8LLf4XvpF8P61Qwx+8mP+n8re5UVHzSXXZe07/bYpPmtX++axku23xvX8if+zUidnbizO+jOHYxh9/JhW66G+bSK9/PSj8leR3aPXwkHh5F540nrkKFMT9s0X09rtXt+SMd+xvEhtY/U42h14SqJPYVGinNqaYhErJMtVe9gYc+46p6dqibtck1GYFobhJ3ymyBHPgHeMr0Agxkmoj9kwFWny07ty2mvj2jZd5JoR7OHYVmIaFJMBVBNeLZgtgLRVZJg8hfX0RWZeY9cRgWCVG6nfprxgMyS5RMGohpf1VjvPzhdvYvpUEMXoP+smoJMqkqR9xonqlCUlbiLUhl7VZQVckMsQhN8h636/CY4QOhyfk8HFwytO1DUkrEzjXGzd3hN4b6ragGN3HwH8J0exztQyC9pJ0vlmxz8hYOku7bCBbk2ZxB9AE50 X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5c0bc79d-490c-481c-d62b-08d8ce88701d X-MS-Exchange-CrossTenant-AuthSource: BYAPR10MB3573.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Feb 2021 12:27:46.7661 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: GqNX6oRad9akKFSWUzeBjp4WLOEVstVbgaQ4O2LK0VhHDvtvjUk9hORjj/ZSVb1zEJ1korZ8FtzY/C2OQVoUDu8wIwNuhPA4movtCaXSRp0= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR10MB4339 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9891 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 spamscore=0 phishscore=0 mlxscore=0 malwarescore=0 mlxlogscore=999 bulkscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2102110111 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9891 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 mlxscore=0 mlxlogscore=999 spamscore=0 impostorscore=0 malwarescore=0 clxscore=1015 suspectscore=0 adultscore=0 bulkscore=0 lowpriorityscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2102110111 Precedence: bulk List-ID: X-Mailing-List: target-devel@vger.kernel.org target_submit_cmd is now only for simple drivers that do their own sync during shutdown and do not use target_stop_session. tcm_qla2xxx uses target_stop_session to sync session shutdown with lio core, so we use target_init_cmd/target_submit_prep/target_submit, because target_init_cmd will detect the target_stop_session call and return an error. Cc: Nilesh Javali Signed-off-by: Mike Christie Reviewed-by: Christoph Hellwig --- drivers/scsi/qla2xxx/tcm_qla2xxx.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/drivers/scsi/qla2xxx/tcm_qla2xxx.c b/drivers/scsi/qla2xxx/tcm_qla2xxx.c index b55fc768a2a7..56394d901791 100644 --- a/drivers/scsi/qla2xxx/tcm_qla2xxx.c +++ b/drivers/scsi/qla2xxx/tcm_qla2xxx.c @@ -451,7 +451,7 @@ static int tcm_qla2xxx_handle_cmd(scsi_qla_host_t *vha, struct qla_tgt_cmd *cmd, struct se_portal_group *se_tpg; struct tcm_qla2xxx_tpg *tpg; #endif - int target_flags = TARGET_SCF_ACK_KREF; + int rc, target_flags = TARGET_SCF_ACK_KREF; unsigned long flags; if (bidi) @@ -486,9 +486,17 @@ static int tcm_qla2xxx_handle_cmd(scsi_qla_host_t *vha, struct qla_tgt_cmd *cmd, list_add_tail(&cmd->sess_cmd_list, &sess->sess_cmd_list); spin_unlock_irqrestore(&sess->sess_cmd_lock, flags); - return target_submit_cmd(se_cmd, se_sess, cdb, &cmd->sense_buffer[0], - cmd->unpacked_lun, data_length, fcp_task_attr, - data_dir, target_flags); + rc = target_init_cmd(se_cmd, se_sess, &cmd->sense_buffer[0], + cmd->unpacked_lun, data_length, fcp_task_attr, + data_dir, target_flags); + if (rc) + return rc; + + if (target_submit_prep(se_cmd, cdb, NULL, 0, NULL, 0, NULL, 0)) + return 0; + + target_submit(se_cmd); + return 0; } static void tcm_qla2xxx_handle_data_work(struct work_struct *work) From patchwork Thu Feb 11 12:27:22 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 12083091 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1FB51C433E6 for ; Thu, 11 Feb 2021 12:32:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E197964E2E for ; Thu, 11 Feb 2021 12:32:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231404AbhBKMcK (ORCPT ); Thu, 11 Feb 2021 07:32:10 -0500 Received: from aserp2130.oracle.com ([141.146.126.79]:40434 "EHLO aserp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231437AbhBKM2j (ORCPT ); Thu, 11 Feb 2021 07:28:39 -0500 Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 11BCPZTB098702; Thu, 11 Feb 2021 12:27:50 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2020-01-29; bh=LRt2SeFq6N3QyPTXIiad1uZBJzKkg5h1mMnq6YX9grQ=; b=OE/s0HmCtdqjWK86kaXeQ21ajWWbdIzTd987kjP7aq8mqQTRgjEJGoreTDnPPdT7wmgf RVtTVmW11sfUNlbnvLGu9C1mn5LkR4fsn9TbmQb0n6diyye5tu2Ty2yuNBJv9+HVZSrC Rd1xmausHIFmEhPe8pgymY/4BzyuxAQtGxQrBuWwZHSOxKEug3xx+R6DCCpvVhqj/uvH yDv0ic5IZRR6cUBviqkFt99K9hyS+sBi+jgIIevDGetORoM2+AkeTn0Y14+L+UK9gZUh VBoAZpH8rqbqXgFRys4qiHk0sgeUs76xqi2fLtzbByJNr9R+TGc+EmLlapWhxnvCsXj4 zg== Received: from userp3030.oracle.com (userp3030.oracle.com [156.151.31.80]) by aserp2130.oracle.com with ESMTP id 36hgmaqby8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 11 Feb 2021 12:27:50 +0000 Received: from pps.filterd (userp3030.oracle.com [127.0.0.1]) by userp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 11BCP7iu052222; Thu, 11 Feb 2021 12:27:49 GMT Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2106.outbound.protection.outlook.com [104.47.55.106]) by userp3030.oracle.com with ESMTP id 36j51yxty7-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 11 Feb 2021 12:27:49 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dTT4X+QxZ4CBgfoDNJIfnr1+dzqBDIx8S94HJFkX0LLJGSux+SmgkfVNxpRAKj5TZ1K6NEjX32SIuFjlL/M8mEGOaqfYo+gvB1pw0+zDGqA/KT+9U0hTWESORCt29IuDvtAy0oA4mteWKF5s0EMWUJbvDQsZxkbMkBRkhURhdrGrnPflMx12jisYc3yOYj0MzxBzdcn5arTLw+sdVx0Jq6J00ltmqfGPqaiVoPz3voSMc6l+wYTzb3t5HVnET2xImJwqlF+hNJm5ztgA74WbjqurcfVx3/EsJ9Vuo8++7j3/47wIEjz2JA2xzxLNnNVyUsCLLwROGhMdOtL4IOJGhA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=LRt2SeFq6N3QyPTXIiad1uZBJzKkg5h1mMnq6YX9grQ=; b=nPUbOw5OSaSN/gnZDL9pLZ/A4BRSoiN3Fm/BtL6BANXB1NNCSPTawjrXu36EpBqeaFgQpAXeVg/M+acKM3GW4zPdH6iRyZiHLLNFo1PC7FZil5g3Ef5ISOZrZohbd0glQcBrqXiLGRYvVVJJWVW3f9ilzJtmRVYMwtUMcPW4wv9hTgVde7qHeSL5RXmISNnahenN8MjowYYz6Kg06Q0dTvlBWGMTWVWH/g4hYxTJDc2eT2/nt/UBDxYmHezCaLi2zDVAaPQlHGDQg0rTcnqKlgnW8lOVi0mS+ArARcDtS/p5O6Za8DCRiYAhifJvsjRA46AhV6yNgyyluuDH6255yw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=LRt2SeFq6N3QyPTXIiad1uZBJzKkg5h1mMnq6YX9grQ=; b=ewL+/G4vMFGO+uIWjxYTIt24a9O7DB7QFuP0jDLHHY76gBKdXfDUhVpBDyVpVZ2asBjQTXw/2Iwcl0eE/Bxew3za+uRn0JdATYmgzF09gIHDuCx6dTh2TTIb96y3jWw6FtZUOzApWqewjtJfOzSMAVx1L74IIU7wQV6ndEDKjg4= Authentication-Results: lst.de; dkim=none (message not signed) header.d=none;lst.de; dmarc=none action=none header.from=oracle.com; Received: from BYAPR10MB3573.namprd10.prod.outlook.com (2603:10b6:a03:11e::32) by BY5PR10MB4339.namprd10.prod.outlook.com (2603:10b6:a03:20a::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3846.27; Thu, 11 Feb 2021 12:27:48 +0000 Received: from BYAPR10MB3573.namprd10.prod.outlook.com ([fe80::1d86:b9d7:c9ef:ba20]) by BYAPR10MB3573.namprd10.prod.outlook.com ([fe80::1d86:b9d7:c9ef:ba20%7]) with mapi id 15.20.3825.030; Thu, 11 Feb 2021 12:27:48 +0000 From: Mike Christie To: hch@lst.de, loberman@redhat.com, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, target-devel@vger.kernel.org, mst@redhat.com, stefanha@redhat.com Cc: Mike Christie Subject: [PATCH 08/14] tcm_loop: Convert to new submission API Date: Thu, 11 Feb 2021 06:27:22 -0600 Message-Id: <20210211122728.31721-9-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210211122728.31721-1-michael.christie@oracle.com> References: <20210211122728.31721-1-michael.christie@oracle.com> X-Originating-IP: [73.88.28.6] X-ClientProxiedBy: CH0PR04CA0060.namprd04.prod.outlook.com (2603:10b6:610:77::35) To BYAPR10MB3573.namprd10.prod.outlook.com (2603:10b6:a03:11e::32) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (73.88.28.6) by CH0PR04CA0060.namprd04.prod.outlook.com (2603:10b6:610:77::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3846.25 via Frontend Transport; Thu, 11 Feb 2021 12:27:47 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: bca1d3de-03ac-487b-1e83-08d8ce8870f2 X-MS-TrafficTypeDiagnostic: BY5PR10MB4339: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5516; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: CAdk+hsOwD/orJ3bkhUfR8kCE+mhwbm6UckFyvs0PKH8b7Eptvib58ThZhNwsnE7LKd7OE9bFYFlrZyOUd4Xy0JRgHV4hUs+F1F1wlXRlkZYmqOTeDhENkccxiIv9DQ1PpSfgE0Sz15w2th568DsCDFkwYrAMWsDfFQmYX26P32FElPmzMC+EATTsJYLGoS59kXMgq6J2gpjUn7OqztLbjq3vvP3V8aOe9yXskv/wPE5EdDm+3Hb9KjomvJhmLNczrovIIJCLkcTINRs1E1gfnOX4UsJ2MJ3PAklM2A9P/TtdiXJrbEKpC1I0N1bHPWCEQzBCzzCqtEJ0uwE52X50p/bKvn+oQ/oW7088Z0b+F3iiwn6kX+R/fM6Y57McCp6X62oqS30fwzfZ8nNIg+fwuKPuiNFtrMZ2CmylXSm3Lzh6E3zpxbkgv3eMYMV/n9qY+lwz7ESa9qIUV+xGE0N4wuGgjEOmRs5dhfZbax+hr2xx0Tu2gpWdpQc/AtzcsCpLs+hGCuEHD6MVAL9wPb+iv0RwPDo2DLpgOGm61DkFMxCG47EYtxG9cjeMMVv181jYa+ZeokGJQKcU3iiDOP/8A== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BYAPR10MB3573.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(366004)(346002)(39860400002)(136003)(376002)(396003)(83380400001)(1076003)(6512007)(16526019)(2906002)(107886003)(4326008)(6506007)(478600001)(316002)(186003)(6486002)(8936002)(26005)(52116002)(66946007)(86362001)(6666004)(8676002)(2616005)(36756003)(5660300002)(66556008)(69590400011)(956004)(66476007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: HAUNBnD4YzKR1mdiZxJjSOYCjb5xpxDiWn7m8D9tO2ijngfUwsI4iuJQWDhjA6gg6kIDh3hTNXCTYa6N3QeISSZhnicWIMXP+snNl2rvJvTgO+Tc9r5doDHuE27P9SizQa2FcDnZZFCunei3SsUTXUptPb0UnydIy3Jk03InWyV1fkSgvm5lUETAJmGqd0Ll8y9wPWlDqtovaOU657YwkTi3XRDGUL5rjmCuPNdT9JyKtcG1jHNc0eOv4rtaeeYt1tcm8QFY1+nGEawsGECM8/w0dGgl5EbrN5ibN2y0yWxeRitud7yb0saJwvPWBjofU4PXCqi0e+SX1ba9tvTmCWoXCK/BdWaWuIHC9ln5Hn4vlwslry48Nudoz9IpV/Lr5wLB76Ji6R0kGP0bKAsEilioXZWw+49NXfoXKq+EADBjwvC2+O/0gVlMFRgfdikeu9IJu63efwQasRMz7ltD5he+h8s4fNhUo/0CM+lUv7tR4Du8MQpn0NMtt4tI1mx5NMXnpdl38/RpDXk8EEyQwgITUJlqko0JxP2WZsVGzaWrP6WCeAu3QF+KJuR8O7Ypv3E3iCsq6F8Jc6hyl2pbGg0VSVSRek2TtKc7ZtFIFO9Mn4rO0EvtHg5yiex/eg5TsTFLBZUu57dxXSfq26G7qLRsf1t+kDZyT405dNvpTh6nDphoh4tn2io+NCNO/813ZuVQcjKCf0hp03J/ySdHNfEtWe36MlnY9wZIoT0DzgCOspCz6beAMSWb3HH3KvYmYo0FP92d5rEbW7lx4rARzLX7JzkzZ+0Q/DviP1elVHehAdsibL/+cywtYFqzKOBz4lAUXFnT2yTL2XftqL5PdwuKMWz+DsAPSPaxP02P1Ag1EFTxn3FneG0yPQE2brDhmtS0Z5PWPtttgYj5DUiAPO2E7QlrhyRouYdgTobY5VddbnKSbDtgR+Vc0BKTD47coWiqn4CV0XMIxtq/a1ztW535xfRvUnCIsp6yB8fVKMH3b99iDZ6vwvMIOSz632e3KokbVKEQ+W4apQOaeBb2VszsOiVCqxCAFfXb1jnUkm5oG4Bv53H9ED5SASeKPisgnXXA3ap90ZmysaAOtMsTMGf8xsoJEp0+XeFstZQmcFwND45AvDrQCDimYlug531ODe/CDREEf34F2NvKu0gHa0E6yisEa0yLB9xojAj692X9e1Vy1EdvKlsivkvZ9xp5dAOhX63eRVmV08RhVIWyMKFRlB2onZpmHshVRW31VRXgRZNCQqFYN1LixIwAyAoRhzdp6wvWzFV88pEsu2Z3rkbIy5XRKvAHBXPkdTLWC3HHHczhrC4QdxFWqb99si2q X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: bca1d3de-03ac-487b-1e83-08d8ce8870f2 X-MS-Exchange-CrossTenant-AuthSource: BYAPR10MB3573.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Feb 2021 12:27:48.1403 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: r9A28PECfUN9gYsFxDrbUnkYnfARctkXl5brtN3RHis01iwnuUvx+f2tnNIRl8zRazi3erXAk3Xmg+u0+CXxR0S716vQG+QdDX4T5YC840M= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR10MB4339 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9891 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 spamscore=0 phishscore=0 mlxscore=0 malwarescore=0 mlxlogscore=999 bulkscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2102110111 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9891 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 spamscore=0 lowpriorityscore=0 phishscore=0 adultscore=0 impostorscore=0 suspectscore=0 mlxscore=0 clxscore=1015 mlxlogscore=999 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2102110111 Precedence: bulk List-ID: X-Mailing-List: target-devel@vger.kernel.org target_submit_cmd_map_sgls is being removed, so convert loop to the new submission API. Even though loop does its own shutdown sync, this has loop use target_init_cmd/target_submit_prep/target_submit since it needed to map sgls and in the final patches it will use the API to use LIO's workqueue. Signed-off-by: Mike Christie Reviewed-by: Christoph Hellwig --- drivers/target/loopback/tcm_loop.c | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/drivers/target/loopback/tcm_loop.c b/drivers/target/loopback/tcm_loop.c index badba437e5f9..461f4125fcab 100644 --- a/drivers/target/loopback/tcm_loop.c +++ b/drivers/target/loopback/tcm_loop.c @@ -113,7 +113,6 @@ static void tcm_loop_submission_work(struct work_struct *work) struct tcm_loop_tpg *tl_tpg; struct scatterlist *sgl_bidi = NULL; u32 sgl_bidi_count = 0, transfer_length; - int rc; tl_hba = *(struct tcm_loop_hba **)shost_priv(sc->device->host); tl_tpg = &tl_hba->tl_hba_tpgs[sc->device->id]; @@ -151,17 +150,16 @@ static void tcm_loop_submission_work(struct work_struct *work) } se_cmd->tag = tl_cmd->sc_cmd_tag; - rc = target_submit_cmd_map_sgls(se_cmd, tl_nexus->se_sess, sc->cmnd, - &tl_cmd->tl_sense_buf[0], tl_cmd->sc->device->lun, - transfer_length, TCM_SIMPLE_TAG, - sc->sc_data_direction, 0, - scsi_sglist(sc), scsi_sg_count(sc), - sgl_bidi, sgl_bidi_count, - scsi_prot_sglist(sc), scsi_prot_sg_count(sc)); - if (rc < 0) { - set_host_byte(sc, DID_NO_CONNECT); - goto out_done; - } + target_init_cmd(se_cmd, tl_nexus->se_sess, &tl_cmd->tl_sense_buf[0], + tl_cmd->sc->device->lun, transfer_length, + TCM_SIMPLE_TAG, sc->sc_data_direction, 0); + + if (target_submit_prep(se_cmd, sc->cmnd, scsi_sglist(sc), + scsi_sg_count(sc), sgl_bidi, sgl_bidi_count, + scsi_prot_sglist(sc), scsi_prot_sg_count(sc))) + return; + + target_submit(se_cmd); return; out_done: From patchwork Thu Feb 11 12:27:23 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 12083103 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A6545C433DB for ; Thu, 11 Feb 2021 12:34:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6FFA864E2E for ; Thu, 11 Feb 2021 12:34:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231511AbhBKMd7 (ORCPT ); Thu, 11 Feb 2021 07:33:59 -0500 Received: from userp2120.oracle.com ([156.151.31.85]:44222 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230450AbhBKMam (ORCPT ); Thu, 11 Feb 2021 07:30:42 -0500 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 11BCOSvA139843; Thu, 11 Feb 2021 12:27:52 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2020-01-29; bh=o6Hv2gBirkeYKVwgzTvTppNqSRlSbrrnR80U5rxBOBw=; b=gnG3SIqts091n6Bxnq7HEOJrioacq6svALjFG26Y5REOcjJ02502SoUIgLB3X/vEpUBc T34kbKDmzrK4lD1dP1i4JGEufvWpusZo1JrDd6YdmADVYiO/x8v0cb7OCXZ/PAfU6oNB 25VuPs69YY1A6YDmPry9snFjGQ814++4cu1p3L7Gz4+f76SxF4MzREi4SPzBnfybVhPD 11KSxCRt6ygFhrI31kASXe+dODwZ/kRbu8qFXEO2aZD8fYc4xEb/Fojny71ELKj70Q+v GEJ4noFYVcCooOnImDEZCrQx6JZzE3HNpIWaJ5fv7wkRyvwTb5ve8IvMlFEnxczNBD3C zg== Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by userp2120.oracle.com with ESMTP id 36hkrn76f0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 11 Feb 2021 12:27:52 +0000 Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1]) by aserp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 11BCQ4nH193915; Thu, 11 Feb 2021 12:27:51 GMT Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2107.outbound.protection.outlook.com [104.47.55.107]) by aserp3030.oracle.com with ESMTP id 36j4prg58e-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 11 Feb 2021 12:27:51 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FQ5n27nkSSnr7auILVMKKsnsiRayR4BJqgYpDusYntio6mHgOVA4Mdk2rM4xA+7js5UXWxi1mNRMUbLEWWwYhcI7K52E8aCIxdbNbofiCQoLSklc6OV5XEaruJv8n60sBTBQt4VRO4XX6+wuSbO6yC2pcSf4EHUoro4VyqSKSqOG9q1GGa3Af9hSybttOJOM2ow3esagj5Qj0zDUTJ64GnMw6+UH1GxndX1mhUlSnlHefpOeE1+AEjXIx/l3Az5pG9YfVHYl3e0x2VDmIfCmi1YrFj293RCHX3Cc44H4y2FNCjZA16leM9YJfJyc0X02kRypv0lVVfbHC/Y/nQniTA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=o6Hv2gBirkeYKVwgzTvTppNqSRlSbrrnR80U5rxBOBw=; b=WF9AH1o3w+K9aI8m2MaP6b05Q3e2ih1r5L618m/oFXsXOQjHg/F4Xnr3vilQnlH2u1xzW7U/km8i7tAXOtdsHfR8Zejx5Gq0v6C1rVXCt9QUTlELsJ3E59jBju9ao+oSGZ/TxWQ0ljhb2LwZbgEnnD882HHH4CYitWpyZ5UuDstdwZFQNL7IOMBEKuU6QMyqOOUnnp4JIAopa8lfi6crvJ3z//6n6Jznz9xKCGL+uREGRk9UrVt6QAAt2djrPwAVwqhtzerYHx62NNqp7gruOXu7QIWCHonVmTXUkWt5Pdedi23r6Fr0bcr9jSia5341wN72gm3dlNa3ggodW84vNQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=o6Hv2gBirkeYKVwgzTvTppNqSRlSbrrnR80U5rxBOBw=; b=y2i1FiICKNcQZVIvWWBRybuFjLj6ODoAex2HHngq3oXfNBlrwF8oBGqybSL1ZasPt1XAsCPO/wn8V14ZwDsRQN6Bv5zszne/Tu/NGlEPKLAvVY0TmE84uGbNfXueNfT9frvZzXHscSYeDYQquYxMPrZ48RAJKI8ezHmpFkcbbnQ= Authentication-Results: lst.de; dkim=none (message not signed) header.d=none;lst.de; dmarc=none action=none header.from=oracle.com; Received: from BYAPR10MB3573.namprd10.prod.outlook.com (2603:10b6:a03:11e::32) by BY5PR10MB4339.namprd10.prod.outlook.com (2603:10b6:a03:20a::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3846.27; Thu, 11 Feb 2021 12:27:49 +0000 Received: from BYAPR10MB3573.namprd10.prod.outlook.com ([fe80::1d86:b9d7:c9ef:ba20]) by BYAPR10MB3573.namprd10.prod.outlook.com ([fe80::1d86:b9d7:c9ef:ba20%7]) with mapi id 15.20.3825.030; Thu, 11 Feb 2021 12:27:49 +0000 From: Mike Christie To: hch@lst.de, loberman@redhat.com, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, target-devel@vger.kernel.org, mst@redhat.com, stefanha@redhat.com Cc: Mike Christie , Chris Boot Subject: [PATCH 09/14] sbp_target: Convert to new submission API Date: Thu, 11 Feb 2021 06:27:23 -0600 Message-Id: <20210211122728.31721-10-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210211122728.31721-1-michael.christie@oracle.com> References: <20210211122728.31721-1-michael.christie@oracle.com> X-Originating-IP: [73.88.28.6] X-ClientProxiedBy: CH0PR04CA0060.namprd04.prod.outlook.com (2603:10b6:610:77::35) To BYAPR10MB3573.namprd10.prod.outlook.com (2603:10b6:a03:11e::32) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (73.88.28.6) by CH0PR04CA0060.namprd04.prod.outlook.com (2603:10b6:610:77::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3846.25 via Frontend Transport; Thu, 11 Feb 2021 12:27:48 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4f64c7ec-f532-4301-04d9-08d8ce8871ac X-MS-TrafficTypeDiagnostic: BY5PR10MB4339: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4303; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: TrIdeI75KYrYCKUbpT/R3UvpDON7UUGCRBi5qW9+YHBMVX5U5PYq50IJnPCGrYMIrJkG3oR82MA+fLo7YY8wCiFS5cafJisoRwuM19Soq3OdxWhNV4yZOXWnSgxnPd5msfRZSwECCtAZpR+aFzF6Q9mx0bu8LTrZ/0VlLjv6vvDxyWxORXGeuwG5KkQua2utzwZ+UW7T6uUoT072TcX0Pa9a24Nan+0MowgMx5dnKPs+C+sGEETJ6oN1CLLDXNKC16yiqDqgawJEF/2cVrHjpkWu5h+uw0ycPZ3i3KOGPJ/tZv9qsKnXjlIMwSc1fkiMRXQ26tyV8s75eqtw2v/7dvWqkf/lHDwciAk4XEWBxme5nzN8BXgs2taM2C5OzC9vXlBcUKX08SyrZBrQECv2IiD3kR5jHlAMJMVrz5sc8VtqG2kimTB/7qsNdB8gdwP1HWQ8Ck9Qy+TG974danzNSbCBofIPIGRkB2/LsWuVKQdt8DuJkP2lRi4xrDIG5OhIs/P5dB2uQ2qMgs7s3EhiACw8hiQn4q3vgnBcKvMOHIEesSnqPWfkW55y/8FgIUOS/BNRQcJhBrXMhfobczEDMg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BYAPR10MB3573.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(366004)(346002)(39860400002)(136003)(376002)(396003)(83380400001)(1076003)(6512007)(16526019)(2906002)(4326008)(6506007)(478600001)(316002)(186003)(6486002)(8936002)(26005)(52116002)(66946007)(86362001)(6666004)(54906003)(8676002)(2616005)(36756003)(5660300002)(66556008)(69590400011)(956004)(66476007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: Ks/+Fm0Zq5GsVpksZoCF9p3EGvvLjilxWei/vu1Kk2HcUCCC2vBd1vGQ8MYhrSAX5dP8/7UlqCn2Wjxb6ST4sHj9Xcuribos54nDUQztn93XaoSrszNyj2oE7hB8LU8cegESF4fV9YNWb52tNvrEyFyZLaoR6WWSx5y/hXWQaDem/Vbm2MKybs4GlSsEvfm+hBpjg4I0mQRu42nspavQbsOysk6735J3lBOtqtBhcaaZMei49wfnqrdZRLGcGyfyKZu8sE9V5n5CqQajkrexPFGhnrs4zYGrqPBjFegIJYdhNKR/1AcXkr++Ggnbxqhur2aYM0c8D6ZaDR8KBrRsdwdmky71x0bhph2jReu1JxEQd3LkmS4JcelBPgOIy+288e1XzlSjsVfMsY5kn0G+iUNx1XIO/fW0C70lWOMjgS6PNG3pilrDcRyCphMMGj3CkJ9w9seElj4RaCLQxHpnTDUnZv2nlN9I7q3Vo1zvSzVVMUmEcC5oHrxK5+T+e4db4buhDU10ic3zv9oJ2YPyeFpPcNgH0s2e/I8aaHhGvillY5dw1DgrcHYHv1tZ8HleEySMArY3DMvoYbm7Dx1VdwHXwS1sw3fQfNTF0/jYCH6hRfMT8e6DiZXuqzKVql3neGTcDRKyzsGSLQ5TaSoTZ5Xm8zZDaBHPM7+O/+U/Xnne4+3s1OaavumBRupUq0HAeufCJrlQn5Sl5OIebFepaYUGN517F27ebfkvisIXAfF61HYm2+rOZZeI4kC5CfNZNnhfSXsXcD8pvDHsbaumCqUCrPs5M+iXmL0TZTgrg9RMZs1gv3hUx2fcwdvzg0LrI64nMymWai45NTr59O6IA7kygaETCIjc9n7bByrjbh3ib5oJJB1GC6TkHR6Sms3HPfzpwIV/JQBPZoYsWGfgBydsa0UT8LgfiaTCAaxhEAlXviyOmeb7QpK2QAwjMn5XioM9tV/8JV5//8v9Ui9xgzbpsaQ2VEj6UxPWbxufRdUu+++mF5ms1cHenK+w1n3dFbRVhcSmAlzBRcVm6yV77yiRQsBQKPfX5RIHzqhEpPTJsWmAmc/Ra8GWHplT+bR3Kj+16imnUA0oDTLuN8iQzE3Toy82Vp+ePDq7YZlkysMKTODKk+MehfDZ5eKdmxpfwGVM4JdJBiNBRin2Ne6SrRM2ZmhRBRGc4glg9dUI8PgNyTI1P77bqE5/aBa0iKfrSAVNTA5LnA0im93ggeMCD+rOYY6U6DSpFIw1g6IZDiEFpPx78UVd5rAnYnGACQsI1p+gqT8tmcFzNW+yoGhk92hnaKcAhpxUu/6bAuka3CjIeMLzr8fgW0k3REO6gcgd X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4f64c7ec-f532-4301-04d9-08d8ce8871ac X-MS-Exchange-CrossTenant-AuthSource: BYAPR10MB3573.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Feb 2021 12:27:49.3146 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: BQ+Ng0DIlA40BYxw1hYfPljUwLKLAswpjjhbcUb4t1MmspfXhQ0H45zVMBynLsUJkWuBEB970T+L/TiMYu3BrzYxo2ostiRsd417keWau+Y= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR10MB4339 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9891 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 adultscore=0 mlxlogscore=999 malwarescore=0 bulkscore=0 phishscore=0 spamscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2102110111 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9891 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 malwarescore=0 priorityscore=1501 bulkscore=0 spamscore=0 impostorscore=0 mlxscore=0 suspectscore=0 mlxlogscore=999 adultscore=0 clxscore=1015 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2102110111 Precedence: bulk List-ID: X-Mailing-List: target-devel@vger.kernel.org target_submit_cmd is now only for simple drivers that do their own sync during shutdown and do not use target_stop_session. It will never return a failure, so we can remove that code from the driver. Cc: Chris Boot Signed-off-by: Mike Christie Reviewed-by: Christoph Hellwig --- drivers/target/sbp/sbp_target.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/target/sbp/sbp_target.c b/drivers/target/sbp/sbp_target.c index e4a9b9fe3dfb..f467c50aee08 100644 --- a/drivers/target/sbp/sbp_target.c +++ b/drivers/target/sbp/sbp_target.c @@ -1218,11 +1218,9 @@ static void sbp_handle_command(struct sbp_target_request *req) /* only used for printk until we do TMRs */ req->se_cmd.tag = req->orb_pointer; - if (target_submit_cmd(&req->se_cmd, sess->se_sess, req->cmd_buf, - req->sense_buf, unpacked_lun, data_length, - TCM_SIMPLE_TAG, data_dir, TARGET_SCF_ACK_KREF)) - goto err; - + target_submit_cmd(&req->se_cmd, sess->se_sess, req->cmd_buf, + req->sense_buf, unpacked_lun, data_length, + TCM_SIMPLE_TAG, data_dir, TARGET_SCF_ACK_KREF); return; err: From patchwork Thu Feb 11 12:27:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 12083089 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 47A04C433E9 for ; Thu, 11 Feb 2021 12:32:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 19A3C64E79 for ; Thu, 11 Feb 2021 12:32:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231485AbhBKMcQ (ORCPT ); Thu, 11 Feb 2021 07:32:16 -0500 Received: from userp2120.oracle.com ([156.151.31.85]:43062 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231511AbhBKM2l (ORCPT ); Thu, 11 Feb 2021 07:28:41 -0500 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 11BCOGfA139808; Thu, 11 Feb 2021 12:27:53 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2020-01-29; bh=uwPzet92S7R8c6C4fWnQUmHmjuehLZix74TyPdaTFPU=; b=0hlOqY6Dx6mwGqnFtaiEwvKAJ0oWRfdYekfM7eS9ngasOLKXrKOE3GJf6sgqD6uukjaN eCweEqKRo8WaBN4QjscjcVQqAlkDdHL1ChRH/z9AxCgMdbnIJkXNc89T0wkFGm5cbzL0 DTC8uclg28EB/BzAG379Mt75nCXNmr810mbdb1aVXK3vPIvHol7eHn17D6Qagws8afYf 8yQTh9QUX9+Ju0QoVMfgebHtgn/00wz8frXQr+EAoLSigCFGyGGcA/iQwrEbNCQPSS7A O8BVzwdPu+PcKRDQGEOZdJSlZirLB4+xxU6Ok1BvNKr42VGHaZSqufR2lWP8v2ygPPBM gw== Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by userp2120.oracle.com with ESMTP id 36hkrn76f2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 11 Feb 2021 12:27:52 +0000 Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1]) by aserp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 11BCQ4nI193915; Thu, 11 Feb 2021 12:27:52 GMT Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2107.outbound.protection.outlook.com [104.47.55.107]) by aserp3030.oracle.com with ESMTP id 36j4prg58e-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 11 Feb 2021 12:27:51 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=d/8+CZzJXW4pMZDw0rNHHD8i6v8pwzAQ4qoyoXflZ3LgUR4TShgwu/Ih9DR4Cj8YtcZJA2oWHWZDulpTt6Kpw29VWqLmMUdcRLO2cK+VeDXBDuqLuDnetcy8pQH9Hqf/i99Z83nlziCQqUc1NyBGJCGvYgn73yqU395fSo3ODa3/99UISyivoUV33DUwpvEinzi46JxPLllKNv4Ne3lsnYbYYXxZ9BEdLatRf+c+Al67sGcd1mIUF/lLo0mVtDuyiXgWd6QfQEGSH+0Jf/fcvqpZi9rqRhKiCIdGVocxZyTdyEkmF4z14v21yZZiCePLUEBekazi+Bz0BlT/QPuclg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=uwPzet92S7R8c6C4fWnQUmHmjuehLZix74TyPdaTFPU=; b=MWSIFAFxU97TZDiNGpgeLvGDNdkOOJwv80q/AEPQ+wRP7Wuvy9ze7bjSRCJaH3x/M13qn/mpQmBS5j1eKZRL1JS7wm9MJyFhuMIjHKVSHf29+y/DOYVkip9zmmrPlQslByNYjf3Y0ty8pU9AkJ1pto95GoCcagj2/otkPkq2vSNQi7xOqDCRF3+ybS5IunOIdVIuTXOtN7dvFj+Pg2hOQhC9az3/Lp5A/bL/e+vkuuc4s+OZqhwG+MVQ+8uDbGt/eXVoWIGX/tr43DR6CUAQyjPfOl/CvygHXbKv2I5xcG7DYAXeqfN4MJif3NKLOppXcrTqDR9lLYyp5xv9rZQ9Zw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=uwPzet92S7R8c6C4fWnQUmHmjuehLZix74TyPdaTFPU=; b=STL3oKDEWNeET2zhOcVR5ot0ydBav93gf1k+OVATecCy8C6STKkvDABfS9GH2kSylpbQ+5qOb3neGNRteg4aTC5UXR48JDCL3B2WzzIGDX5lH4kmahNPt69nrOt76KreBRSeijBxqrCC9NJDT83rGqYxd3rqGCVyFErE98XcDXM= Authentication-Results: lst.de; dkim=none (message not signed) header.d=none;lst.de; dmarc=none action=none header.from=oracle.com; Received: from BYAPR10MB3573.namprd10.prod.outlook.com (2603:10b6:a03:11e::32) by BY5PR10MB4339.namprd10.prod.outlook.com (2603:10b6:a03:20a::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3846.27; Thu, 11 Feb 2021 12:27:50 +0000 Received: from BYAPR10MB3573.namprd10.prod.outlook.com ([fe80::1d86:b9d7:c9ef:ba20]) by BYAPR10MB3573.namprd10.prod.outlook.com ([fe80::1d86:b9d7:c9ef:ba20%7]) with mapi id 15.20.3825.030; Thu, 11 Feb 2021 12:27:50 +0000 From: Mike Christie To: hch@lst.de, loberman@redhat.com, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, target-devel@vger.kernel.org, mst@redhat.com, stefanha@redhat.com Cc: Mike Christie , Felipe Balbi Subject: [PATCH 10/14] usb gadget: Convert to new submission API Date: Thu, 11 Feb 2021 06:27:24 -0600 Message-Id: <20210211122728.31721-11-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210211122728.31721-1-michael.christie@oracle.com> References: <20210211122728.31721-1-michael.christie@oracle.com> X-Originating-IP: [73.88.28.6] X-ClientProxiedBy: CH0PR04CA0060.namprd04.prod.outlook.com (2603:10b6:610:77::35) To BYAPR10MB3573.namprd10.prod.outlook.com (2603:10b6:a03:11e::32) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (73.88.28.6) by CH0PR04CA0060.namprd04.prod.outlook.com (2603:10b6:610:77::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3846.25 via Frontend Transport; Thu, 11 Feb 2021 12:27:49 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d2fbfea1-fec0-4382-9d1a-08d8ce887265 X-MS-TrafficTypeDiagnostic: BY5PR10MB4339: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8273; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: tYucBx8aybDGZ7om8TznshbFYDecFdpD70yBkICp/XJWfOqLXeEcXMigPHoPhfABX4n+l/qh5gt7vMyblWC7V8a1JEVDMOzUY89ZijiX1XC8Oh2uvdIJPtt5tPeJgJ1lKcTIb1ZdUk+w+8Sw6dx26SNr/lxdXzM8pYqazYBo9wEg2E2nfwlJQFA3N5E0ByjrRrkZ2ak8osHQa+MeQ1ik/GFjV8Q6YLZY52LtyZegcJsqBnRr1WEiwA0IhUFWnjwF0P62URM2U0vwx2we7qbAqUiCu6h6Ce1oZTECE0DFc5PnMVT4xfTeQfovrmzvTk9tJXmJybZexFELuAx+FyNcUAKYdBJsG/YQ/YxjM0zlFys9KMLP4VgocEyOhOoU4rFG7jplCfY+88U7F5FA4rAWjsd7dD0mnYtEHh84SrURdkaimMvE1bNVWhW91DAPBVjlrCmvxCLf19h28ouKncSr8rvJqk2QrgesfDdYLEg2CXJmCBJfuL7ES9e9mViXtFITuXWADvm1q/dP5cLGh3wYy8EBmWl6NX/UGd9lsmNHm9rFzPztpcnFYYA8vHzB/AX/PbB7WG+PwYnQyUYNMtX8rA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BYAPR10MB3573.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(366004)(346002)(39860400002)(136003)(376002)(396003)(83380400001)(1076003)(6512007)(16526019)(2906002)(4326008)(6506007)(478600001)(316002)(186003)(6486002)(8936002)(26005)(52116002)(66946007)(86362001)(6666004)(54906003)(8676002)(2616005)(36756003)(5660300002)(66556008)(69590400011)(956004)(66476007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: NlAMMggqetPq+GXeaLG9X4ivl88xdZ/+GfHsfEDiCPXn1h84igJDwfUSvAT4Shd1YwmWR8Z0O8CCesED2SjQpao6KlJUXjcLdpwLnPPM3yLXAnAYN90w86wSLJUomJoHdaV6mqQPaqLrG0ddI3DMPgsy8z5s+pCK1apxOSHFLsiPbnjJFgh9bAFWJdj2zHJbN7MI5492BckE6o2tBLXaNMw5kHAozu8tBdUA5lyQYq9rUn2dcGkdWlorxobeDwhEhxVhP9QUE2E3KYycz6w5hr7vMSdZSwOQ0xhz5j23tL+QRPssTNS2xZ0bOZ+l7aS7y+cMl30wDBX3c7EYgkHQlOCgHaPRLqV1aa5+h+TXhZh0YYxNjWoJdRdmM2wM0uzCQK4Ljs/Sof3S7RSUVgaFC2KEEklgO8SMm+fMY75GknmcvuuUom1EDRtrxY2REPZqQea8s3naVbEwVkTkMQXuujEaB6bDBcUjTVTdXtYqduUpUwTKBSLL+2M7L3SHE5jwDcBtyDA1vPIEDMF7/cvbfYqbFW5tLrapJH8IIlS5qN3ZfOrLBlKRmnkeJxeTOy+9tzMOGdN08OftmCBrggsz6eKN+U9PCKEdRWE75bCkZOnLhPs8WvEUPKuUXz4ajz6g1zpsnhgRCQxN17O0+lne0vimAjkKF49MWWUe/XPrmdidWsahXROdNAwQpqG0uPd2VQLVAVH97CZbpxAC+HPdWPrP63PtsgY3VOAo04kGb9cqWdekPIAVfFJQ9Q7RNUxWrWlfIe2mJYh7i8Un5UrqQISlVICb+p/lUrhbZIxS0wVpXbThHdWHwFoMiz2d2CphvJq4MKAOzJrfqbE1GirznizO/jZUy9KVRR4D5qLOC4G+ps7Kg/ANPVy63Fn5nUvPEmDJeid6RRPVM81g4y6XlGXzvkdbWXsRp2hK59BruBhsHTG9ME5GAPhomavXbbrDvebt5r6QyMSvd7z6hw+4ZbxDwgLyTPLT+GAsaouGuEBcYIsMCGwaKnKSTQYIxDNEC4AVeCfIUssVJ8Q5iKGc5u/t3nKsP7jhjr9iLUPn9nAL4+PIcVRw3EZb2lma+j/Ow5OB0k3nTlIgA8oCXIFllreK0rW1Z5mnzFJ5aZhlsEBO90Bf5HhqSVnjNM+uCB869y5lHFFGcSxBSeshM/7gUAYBKHNMOoXcTwbH1UbFT70Ed3DAflpI/SjH542FVeLhPNZ0h5WCZL63qhpbMSYjItRWrmAgGh2sVkKOGWFvEwcv0VHF6kCB62itVDy1TPpVTcwr3rnZ0LA6PJvlcbzvvlZvZCRxoy5lziegMlnnn98nJDrikxqtdKCEGr/Xe10r X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: d2fbfea1-fec0-4382-9d1a-08d8ce887265 X-MS-Exchange-CrossTenant-AuthSource: BYAPR10MB3573.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Feb 2021 12:27:50.6469 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: v3Df94DS+WXKxitx623+cNfr5MfLlre0lpzW/5uQ/x0dwjE90gXovpg4fYiS3B9nzhwxvde3pizzoj69NwemMQVXYbDTGh171pLnjr1PQyE= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR10MB4339 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9891 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 adultscore=0 mlxlogscore=999 malwarescore=0 bulkscore=0 phishscore=0 spamscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2102110111 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9891 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 malwarescore=0 priorityscore=1501 bulkscore=0 spamscore=0 impostorscore=0 mlxscore=0 suspectscore=0 mlxlogscore=999 adultscore=0 clxscore=1015 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2102110111 Precedence: bulk List-ID: X-Mailing-List: target-devel@vger.kernel.org target_submit_cmd is now only for simple drivers that do their own sync during shutdown and do not use target_stop_session. It will never return a failure, so we can remove that code from the driver. Note: Before these patches target_submit_cmd would never return an error for usb since it does not use target_stop_session. If it did then we would have hit a refcount error here: transport_send_check_condition_and_sense(se_cmd, TCM_UNSUPPORTED_SCSI_OPCODE, 1); transport_generic_free_cmd(&cmd->se_cmd, 0); transport_send_check_condition_and_sense calls queue_status and the driver can sometimes do transport_generic_free_cmd from there via uasp_status_data_cmpl. In that case, the above transport_generic_free_cmd would then hit a refcount error. So that other use of the above error path in the driver is also probably wrong, but someone with the hardware needs to fix that. Cc: Felipe Balbi Signed-off-by: Mike Christie Reviewed-by: Christoph Hellwig --- drivers/usb/gadget/function/f_tcm.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/drivers/usb/gadget/function/f_tcm.c b/drivers/usb/gadget/function/f_tcm.c index dcce6e2605f5..7acb507946e6 100644 --- a/drivers/usb/gadget/function/f_tcm.c +++ b/drivers/usb/gadget/function/f_tcm.c @@ -1058,11 +1058,9 @@ static void usbg_cmd_work(struct work_struct *work) goto out; } - if (target_submit_cmd(se_cmd, tv_nexus->tvn_se_sess, cmd->cmd_buf, - cmd->sense_iu.sense, cmd->unpacked_lun, 0, - cmd->prio_attr, dir, flags) < 0) - goto out; - + target_submit_cmd(se_cmd, tv_nexus->tvn_se_sess, cmd->cmd_buf, + cmd->sense_iu.sense, cmd->unpacked_lun, 0, + cmd->prio_attr, dir, flags); return; out: @@ -1189,11 +1187,9 @@ static void bot_cmd_work(struct work_struct *work) goto out; } - if (target_submit_cmd(se_cmd, tv_nexus->tvn_se_sess, - cmd->cmd_buf, cmd->sense_iu.sense, cmd->unpacked_lun, - cmd->data_len, cmd->prio_attr, dir, 0) < 0) - goto out; - + target_submit_cmd(se_cmd, tv_nexus->tvn_se_sess, + cmd->cmd_buf, cmd->sense_iu.sense, cmd->unpacked_lun, + cmd->data_len, cmd->prio_attr, dir, 0); return; out: From patchwork Thu Feb 11 12:27:25 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 12083093 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1042EC433DB for ; Thu, 11 Feb 2021 12:33:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BF13C64E05 for ; Thu, 11 Feb 2021 12:33:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231487AbhBKMcT (ORCPT ); Thu, 11 Feb 2021 07:32:19 -0500 Received: from aserp2130.oracle.com ([141.146.126.79]:40482 "EHLO aserp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231519AbhBKM2m (ORCPT ); Thu, 11 Feb 2021 07:28:42 -0500 Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 11BCO5bp097881; Thu, 11 Feb 2021 12:27:54 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2020-01-29; bh=VAHnbB8xbWMLRbufWOeuFmbLGHFhYwYsOARJ6Jv4a+4=; b=JeTeNWaiN/1AnqjZWVqDSSVckHiHBuIuc3Bpnxx4n+w9jXgoTSP84L6GAJ7rEPdENeP4 460BMfuuYqsWoO+o7lwYk/csx7ZqNzi8k16cdLBxITsiBgyULwUGz4fk18nkDd8O7cPh ajrlyhDp/d2fpfvcn4gtpr5XARfw47VXIgQv2oi8dic0Gi1PsJShNCj407BNXqMVvGy2 qRi4Hi+g31iPlVVxutv9iyWaeAXYkIkXlDA+aIKqdiZYrxqpQ/XZW4dgVIW8Pk9v81fe P+SPM5dRN+FeLWvZtzH+UtCjoJo+sg0Sfw62uEzzZ6HTe29vO1LNCW+bzNYRIww4FpEK yg== Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by aserp2130.oracle.com with ESMTP id 36hgmaqbyj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 11 Feb 2021 12:27:54 +0000 Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1]) by aserp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 11BCQ2iD193594; Thu, 11 Feb 2021 12:27:54 GMT Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2107.outbound.protection.outlook.com [104.47.55.107]) by aserp3030.oracle.com with ESMTP id 36j4prg59f-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 11 Feb 2021 12:27:53 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=h23TSuvUhXhyUG9kHB3UvmvO6Dwq+EjsYtogfxy/JctaxulOel8LW4eSdm+/02ox9ngoH69UMsydBZk4FkeBXB0nAm2G0JwwfSuEDAEh1Xp8DlVr5TiE+W6coBwIcTukWM070ZugueDca9ENk93d9wQ4SYrdqJEnE6GN+Zo/0UPRTnQtherDUGEjTATE8cNY5C4pyDYiQzdUmEPLZMLia6Uin6DaMEuoU8mtjaioEyTIff2ER4HSay+ssbk7E9tUAjh7gKFvEkbvSi9ZkvFG/Zmbtfa0Hnmsq1jtOBSsarRp3ycICQicYh7V2R379WrEHT98Y4/prXvRAsQzhI2ZlQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=VAHnbB8xbWMLRbufWOeuFmbLGHFhYwYsOARJ6Jv4a+4=; b=ZK/Qz7BuCFNbM1tzLrcI2YZkSXgA4grXCWW1b7jdx3Clw8e/DTVrxxVgUxql3STibMj70VoAFKUWDX/RtdLplS+4WkG2+hGUZzGAMbhGv7ikq46O4x6Fxz5ZWRkKwpZlbS4hbwOdBOb6Eha8nch0HtBnUcwwqVsGytqlOqyxaP7RzKT0PL5haBno64mWvT2BPD3CzfHJDxfvGTRuixH2NtT01Tqrr4VnNxG7gzVsskBYz9u6L5jlyYrXTDcxpaA5pA/3n152ZSXlB9qR5wd6r7fF6UMtwjL2ZSDN3QUtv/Jj+BYHJmRqigS5Khn6RPBKJapqnSPBzDexIXzCDszZoQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=VAHnbB8xbWMLRbufWOeuFmbLGHFhYwYsOARJ6Jv4a+4=; b=dKwRD6/CQptrIp365Z2IKmtwpQ5EfWAj4HexCjZWrZlzzMP796akrUroecuDwaDq/bPUKarrBRg1kYxVxdAr5phIsKosTlhuc7iBt0LP4nqZFRLxKTD7LjQAsjnqunylqgBLJrl3CuQ0H+336SutwlMulW+XD9KfsES5zBGPCd0= Authentication-Results: lst.de; dkim=none (message not signed) header.d=none;lst.de; dmarc=none action=none header.from=oracle.com; Received: from BYAPR10MB3573.namprd10.prod.outlook.com (2603:10b6:a03:11e::32) by BY5PR10MB4339.namprd10.prod.outlook.com (2603:10b6:a03:20a::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3846.27; Thu, 11 Feb 2021 12:27:52 +0000 Received: from BYAPR10MB3573.namprd10.prod.outlook.com ([fe80::1d86:b9d7:c9ef:ba20]) by BYAPR10MB3573.namprd10.prod.outlook.com ([fe80::1d86:b9d7:c9ef:ba20%7]) with mapi id 15.20.3825.030; Thu, 11 Feb 2021 12:27:52 +0000 From: Mike Christie To: hch@lst.de, loberman@redhat.com, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, target-devel@vger.kernel.org, mst@redhat.com, stefanha@redhat.com Cc: Mike Christie Subject: [PATCH 11/14] vhost-scsi: Convert to new submission API Date: Thu, 11 Feb 2021 06:27:25 -0600 Message-Id: <20210211122728.31721-12-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210211122728.31721-1-michael.christie@oracle.com> References: <20210211122728.31721-1-michael.christie@oracle.com> X-Originating-IP: [73.88.28.6] X-ClientProxiedBy: CH0PR04CA0060.namprd04.prod.outlook.com (2603:10b6:610:77::35) To BYAPR10MB3573.namprd10.prod.outlook.com (2603:10b6:a03:11e::32) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (73.88.28.6) by CH0PR04CA0060.namprd04.prod.outlook.com (2603:10b6:610:77::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3846.25 via Frontend Transport; Thu, 11 Feb 2021 12:27:50 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: aeabae16-134c-45e6-1230-08d8ce887326 X-MS-TrafficTypeDiagnostic: BY5PR10MB4339: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:364; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: +ZfFOVLiV0pR41FR8GCxpJ6FIafySLwppmbmDFBOgPOY9cc/0EWSIKC4GDEFzeP/AxHdZVj+79umYxVqyufV0IdrGt1K2Yk5fLLlsgDPY9VYPhPeL4sIhg2jt7fJW/oNUJNTazZgmMcYpOZzDOwkyJmzePujf5eQxBqhQvaOdP8A/U4OkIaXi0zr586rVhy5O7og5ntnZV7aPs6utfSu+L/sIBm0I4KcHuIVxW3ZCfeQUkX3YEvlxkh7ZQIgXkEn0ZSXZ5gP4mYx3xN0xX/EMpmULfNfLuZYia/Roc2pfUIc4X6Ly6G3PNsDzzmSSSsIslsV1xnOa6qSDdVmZg5331NSBES1ooXjgKYr++SRjuTz6E/dNxmN8nbi+rw1MeU8/7/HIvwIvHPo0UGMYvdnPO1EZwaFR7Mcgkg168mOVQ0YQ3K4zeP8z2beACrDWBZAhlsR/Jv17mh1tyRnTHUkb9+diFec0Pa1UYH5fd3lTt4sZfnoF4qkrTPlO0Y9sPc//1aGdFVjPZTVor/ggQ8FdJNiUcJK9XkwXlfgfDWmFjDnG7g2Y18EK5XEDKH178Nt X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BYAPR10MB3573.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(366004)(346002)(39860400002)(136003)(376002)(396003)(83380400001)(1076003)(6512007)(16526019)(2906002)(107886003)(4326008)(6506007)(478600001)(316002)(186003)(6486002)(8936002)(26005)(52116002)(66946007)(86362001)(6666004)(8676002)(2616005)(36756003)(5660300002)(66556008)(69590400011)(956004)(66476007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: tjTZewwwBDixktlD2TiMgSinnnq/J2vmuTbhcEDhv858YuEGCbthkDn8IHn+zTTscUG9NfAHBr6qfII8l4na51R870xOKe0+ab8OzAh4Nkc/bsOJJ9h57qp+bqfOVCt3/MWIUg4g1hGGCdE3HzfkbNBydSaCBc54QoQ+ruLXEf0/TJksyjfZj6rfE8jGMyEUGh22PE5ro6YAtkBZuFHbxRsE8iDoytXt4QNiFOsCAZE9BF2OdOlBcrRFBkla2eJwHbyPUsO0Lslq3MF1Hjcqj0rQLPEHwUGkJ8tWIfVzoVXV9HRFAvmY9HrHbtzqWLXwSH0iSivPR80/S3d0vY4tFrCij762qALI0Y9jK//35kau1aG8rvEmCJK9sMo3yA38oM7+U2NplWV6zjwTmzHauuRzqAoac/LN5rdkJEDFkmRC1jTYLcnbRzJLP0mIlj+XxED6ynIMRC6GUMxjJ3BAKWAyo6LKlYDWOK/vycATKH8omUOKlZI2l2CUxfB/ppBrqDxAX8CZAz+fU8qvvdLHXc7m5L8YGOQlkm2WBr2lrgVzTIicA0zHnGSH37VZLUhO38MMqkOXLUXmeCEH7LnPQPkK7POof5TQNwLjdZ5u7roqVQTFfIvbQXk22pQNKmns+C5FOUuG7N30bqZKj7TuXFgzbBLjPVr5tA4yMmid+XDvv9RqcKl9mud9nvLYfeQrlxTHA9v77H/S2AUeCnRsXKUuyAp6QXBMjBwfo0QXNBdZLOkZ+5cwlVYg5pAE1lvqjrHyWxqDJGxj+qXkwUxdODZBTSU0O3qiXUXkxdYmxiBn6k6Fvgg5Re50pdbbLZGVEjH3rFPPq0S7ZFocsX01YweObJ7QoMvCzf6LcMnIxqJWizDlULuTxiZ3AGc+cdNJM/YiK8duIifz/fJJ7IbneloY7bbdPq6lgruNhd9VgXbGpyozuf53P5bG8SZ7f0KyEBUNkYKhBRjgv62m2en4JV4gXaXAUw4FBlknfJcl7VOpVliHZ6FGQZP73hgafOxhGsmpU0zc92sMjo/TUbTg/KNgn1SsJnerrSk24CZL9vGP4B5BPaw4Ij5x+mKkLE3Wb+aEAeOTyKynhQhsiQ2xRp8kQEMvfu+w3EHasqqVAOLAbcK0/xZaVrOdAfG/Dso/D+nl3aXrJQ7TmaIqMunrUWpcqmcWLbCtgPKV5PA87wHrofYBamq7aGQhj79n2OAyVUpRawM4GPbOY0b+G3/yL++m0CMGpdz7V68+CV6qq137wC3CjAVSJI+JK2OcW2dStJ1hXDK8QLn4AMylOmrSwZbC4VLzSZB+9m3+SEzhJfPGsKavO3NgOhat0UYWtxE1 X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: aeabae16-134c-45e6-1230-08d8ce887326 X-MS-Exchange-CrossTenant-AuthSource: BYAPR10MB3573.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Feb 2021 12:27:51.9541 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 4obilOcjh8hQiJlY1F7iBkazWwxEQZQeUiB9P4cOXJPVjL3zBGefj+NSEbZT5PTAzEmL9bXWrb8Nv8vgMFSV/zZAMH0bfdXaT1SDXB6CSVk= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR10MB4339 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9891 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 adultscore=0 mlxlogscore=999 malwarescore=0 bulkscore=0 phishscore=0 spamscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2102110111 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9891 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 spamscore=0 lowpriorityscore=0 phishscore=0 adultscore=0 impostorscore=0 suspectscore=0 mlxscore=0 clxscore=1015 mlxlogscore=999 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2102110111 Precedence: bulk List-ID: X-Mailing-List: target-devel@vger.kernel.org target_submit_cmd_map_sgls is being removed, so convert vhost-scsi to the new submission API. This has it use target_init_cmd/target_submit_prep/target_submit because we need to have lio core map sgls which is now done in target_submit_prep, and in the last patches we will do the target_submit step from the lio workqueue. Note: vhost-scsi never calls target_stop_session so target_submit_cmd_map_sgls never failed (in the new API target_init_cmd handles target_stop_session being called when cmds are being submitted). If it were to have used target_stop_session and got an error, we would have hit a refcount bug like xen and usb, because it does: if (rc < 0) { transport_send_check_condition_and_sense(se_cmd, TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE, 0); transport_generic_free_cmd(se_cmd, 0); } transport_send_check_condition_and_sense calls queue_status which does transport_generic_free_cmd, and then we do an extra transport_generic_free_cmd call above which would have dropped the refcount to -1 and the refcount code would spit out errors. Cc: "Michael S. Tsirkin" Cc: Stefan Hajnoczi Signed-off-by: Mike Christie --- drivers/vhost/scsi.c | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/drivers/vhost/scsi.c b/drivers/vhost/scsi.c index 4ce9f00ae10e..76508d408bb3 100644 --- a/drivers/vhost/scsi.c +++ b/drivers/vhost/scsi.c @@ -789,7 +789,6 @@ static void vhost_scsi_submission_work(struct work_struct *work) struct vhost_scsi_nexus *tv_nexus; struct se_cmd *se_cmd = &cmd->tvc_se_cmd; struct scatterlist *sg_ptr, *sg_prot_ptr = NULL; - int rc; /* FIXME: BIDI operation */ if (cmd->tvc_sgl_count) { @@ -805,18 +804,17 @@ static void vhost_scsi_submission_work(struct work_struct *work) tv_nexus = cmd->tvc_nexus; se_cmd->tag = 0; - rc = target_submit_cmd_map_sgls(se_cmd, tv_nexus->tvn_se_sess, - cmd->tvc_cdb, &cmd->tvc_sense_buf[0], + target_init_cmd(se_cmd, tv_nexus->tvn_se_sess, &cmd->tvc_sense_buf[0], cmd->tvc_lun, cmd->tvc_exp_data_len, vhost_scsi_to_tcm_attr(cmd->tvc_task_attr), - cmd->tvc_data_direction, TARGET_SCF_ACK_KREF, - sg_ptr, cmd->tvc_sgl_count, NULL, 0, sg_prot_ptr, - cmd->tvc_prot_sgl_count); - if (rc < 0) { - transport_send_check_condition_and_sense(se_cmd, - TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE, 0); - transport_generic_free_cmd(se_cmd, 0); - } + cmd->tvc_data_direction, TARGET_SCF_ACK_KREF); + + if (target_submit_prep(se_cmd, cmd->tvc_cdb, sg_ptr, + cmd->tvc_sgl_count, NULL, 0, sg_prot_ptr, + cmd->tvc_prot_sgl_count)) + return; + + target_submit(se_cmd); } static void From patchwork Thu Feb 11 12:27:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 12083095 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 41F0EC4332B for ; Thu, 11 Feb 2021 12:33:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0B33164E23 for ; Thu, 11 Feb 2021 12:33:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230285AbhBKMc0 (ORCPT ); Thu, 11 Feb 2021 07:32:26 -0500 Received: from userp2120.oracle.com ([156.151.31.85]:43096 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231618AbhBKM2n (ORCPT ); Thu, 11 Feb 2021 07:28:43 -0500 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 11BCNxaX139125; Thu, 11 Feb 2021 12:27:55 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2020-01-29; bh=+IvQR5zqlrgeoGPiEmEK6qTv1WxOD4Xt6+pPgvpzIWo=; b=WGm290YhZKQg3VjY5E8zk2Dju7AhZ8lCldke/NWLXgubJ+a8rqzTJIyNHnBEz0NxnyBk qnUnw6yUQIQ+eDGjUrUE7YIOlL3EYyKySFCf8rIUD/5VtVLd68xrhyX8hQn0KCmdB7Q2 qrqt1RRj8T+ZXMVM7/wle6TsiaeJbMNpUAheFc7Al4BXKp4M4zv7TGy3amrFtA0AtLXR bFOvSgU8lueD3CqK3+Rb7Z6s+lQ2kLBV4PJKaehRkM8nJFuU0xYdeOvPApi5Zt4eGPUS rwwvpQlWt0qtHNGQj/2vPdJF/m8L5WGXyPfT8G+7zEq+DiXQ481kAk384VIMi0GuTeyW 9w== Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by userp2120.oracle.com with ESMTP id 36hkrn76f4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 11 Feb 2021 12:27:55 +0000 Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1]) by aserp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 11BCQ2iE193594; Thu, 11 Feb 2021 12:27:54 GMT Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2107.outbound.protection.outlook.com [104.47.55.107]) by aserp3030.oracle.com with ESMTP id 36j4prg59f-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 11 Feb 2021 12:27:54 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=k62/e5S31BidUppTZJyWfRIv4wRFstSRfVAsE14AwKIRZjN5cFg1DUWbfkUx9HOEORgYYZ2Ybyj1sASnO5N+da+q346XRvqxcI60HvgDZkCBaUeo+kjFQfnojgOJUt2MbiNXt+dITyVZkYXaHXtUbcngmvgniiXct3mssWYNkZc7CXHFt9NDoEJU0OvoHxblS0sY4mssRv8nhxiKzSh3UdCVBX9v5FV/d7Qd2rXWgyRRs/YIhl7x43E730bGcOWBaxI3w+YnR/MXjpphSfWbcA3AifpVGODfkOsuIjr6iUyAGdBjpd683W1yDL7tJAUAJ0rI9JYbwy/IU8CQ1QXqGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+IvQR5zqlrgeoGPiEmEK6qTv1WxOD4Xt6+pPgvpzIWo=; b=KgWFlYpL+Lt3ineha389HcWVgplF4GsML/hO8t1nMGLMSjQCxyL+hbq6gfks/GccN4oSeLY6b0ILt/ZMpRL8xKjnvB22mDOM6DLBbqKQ13sqPLy7vxFkWgmBloqYI4oxdf8XKr2PcAcs2uXfkD7GbmqC4RlkTek6bp8wG6FBQG1LZB7m+rfXlWZQ03SGnh0UkK1xQ/YgkY3EeKG1TQMbKHRmCSBsJheVh8xwBLZ8xgmYpM1Q9DwGx41VZjSxuWRdxbvBeGjsfCrQzQ+4zauYGczmqfgRZJ3hoI09ZZuR8Mzb6JvRX3BF8upoezIQNgmoX5gK5grF6v/lnyyJx/8RIA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+IvQR5zqlrgeoGPiEmEK6qTv1WxOD4Xt6+pPgvpzIWo=; b=AUNX/lFGWuUsm8s8friD5zGcmioOGoeNNqBx2+BATszM31n/orfFx5hShB0MHYd32zKPFQIih9DvTK6z+eDz76N0Bb8yvLZOkqGCPeUKdzOPCfqVNjxMs6a8221gjZCp3an8qoVzaAiid+n83dcxBVyDH79RYKIAeva6KO9wj2M= Authentication-Results: lst.de; dkim=none (message not signed) header.d=none;lst.de; dmarc=none action=none header.from=oracle.com; Received: from BYAPR10MB3573.namprd10.prod.outlook.com (2603:10b6:a03:11e::32) by BY5PR10MB4339.namprd10.prod.outlook.com (2603:10b6:a03:20a::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3846.27; Thu, 11 Feb 2021 12:27:53 +0000 Received: from BYAPR10MB3573.namprd10.prod.outlook.com ([fe80::1d86:b9d7:c9ef:ba20]) by BYAPR10MB3573.namprd10.prod.outlook.com ([fe80::1d86:b9d7:c9ef:ba20%7]) with mapi id 15.20.3825.030; Thu, 11 Feb 2021 12:27:53 +0000 From: Mike Christie To: hch@lst.de, loberman@redhat.com, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, target-devel@vger.kernel.org, mst@redhat.com, stefanha@redhat.com Cc: Mike Christie Subject: [PATCH 12/14] xen-scsiback: Convert to new submission API Date: Thu, 11 Feb 2021 06:27:26 -0600 Message-Id: <20210211122728.31721-13-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210211122728.31721-1-michael.christie@oracle.com> References: <20210211122728.31721-1-michael.christie@oracle.com> X-Originating-IP: [73.88.28.6] X-ClientProxiedBy: CH0PR04CA0060.namprd04.prod.outlook.com (2603:10b6:610:77::35) To BYAPR10MB3573.namprd10.prod.outlook.com (2603:10b6:a03:11e::32) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (73.88.28.6) by CH0PR04CA0060.namprd04.prod.outlook.com (2603:10b6:610:77::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3846.25 via Frontend Transport; Thu, 11 Feb 2021 12:27:52 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d27c5ee6-1ea6-426e-5bc7-08d8ce8873e8 X-MS-TrafficTypeDiagnostic: BY5PR10MB4339: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:415; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: f4/3wNj8K3h1VrvL7ryrUDqUg6AQFCJekvh7gPgucOUl9AESA1Q7pN3tiICbu2BsE0wlzzCCsJzsCTRiynzgKXsOyWxGKapiS/JAl7CSPgl8FyZUXsZZRSGgHAiw7S1lo65YcxpjNWG6XDIprT5H4PR5t/tFzRndbKvT9XRmWhtmGKnEiGNEc8j/HhNQ+IS602z0GRplnPk7ZVrtVxVGgOZAKctvgMwc+kR6y6GwRlIOBWKmtvlUw+0fwej4Ex9rlkFMjvplKT/g6eCqkviFHPiCJxFN8HXdtTd9PxeRfwFE2cqVkQPkhaAXgf52QFFMe/rfsB1jFtHpLUBlaRt6C+yLmoX5P7syddAjvXhIceqjF7wIY1XpY/chT4hxpKNI4GzKLpBMD5/sX0LjDiULETUJAz5i7zRTxNNFynJx3pS0qshCKg7DmUU1HRBHm8eJo8l6HzLaqLxZJTsP5DPntiQ2InBV0Uyn7dvt5VX9J0kwBwYr1Y39n1P7AB2J2OgG9uD7wmqfNsZQBTz4EU871pwCP2dHI56D1nF15fBhwV+yRPy/19xKWDPL3ahnqW+bny0TmOPuYu1cD4SfhE+c7A== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BYAPR10MB3573.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(366004)(346002)(39860400002)(136003)(376002)(396003)(83380400001)(1076003)(6512007)(16526019)(2906002)(107886003)(4326008)(6506007)(478600001)(316002)(186003)(6486002)(8936002)(26005)(52116002)(66946007)(86362001)(6666004)(8676002)(2616005)(36756003)(5660300002)(66556008)(69590400011)(956004)(66476007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: f80awwCajoa5GURkqTOy9StPvxuyLyFFc9yoXOzAUj+TsOD+V9343+NaLyvXEfiy1UzG5bi6jv9UGWoV65Zkbvt/CqCEnnGRxSYYtEHRfb3CoSopASJYsFd3ujF5Rfa8Bl5C6AhhESRAe1I9CVKYqZDfvvrquz34KYqPm2Wq6QmnPWpo2SaTT6TCBeVgk08eVauH8UPX6UNwpw1Kl6iqYlmn/cJ6kc2FhRUgATj8BIiYNjDkXLj3sm+b2NTFqwNJ0OyEWwY8N+SdChvwR3+EJBwfgdLwRwCrR4M/QUwMYYpHZD7MsrxFy+vsYWo81/nu7UBaH0uCi5VXAYZ184IjavB0b+f3HzAZ3JErIahYG583w/XO3uJw+jW68FgTjBDV9Ok2J1ZOIdzzuTZCsvHU7oNCpgtgVQ1EZ7oNQUAsXw7PzqUyt5BNC+8R46nOiwxf3Xbh/EGXHm5fC9ljEp/FcZtP27nAuVEI4g+iF1EvSm9qSa4R7d9MB8tyd10VvhCKgNp9FcYn0mrlMyRIyy0AKV1Ws6IbeVtXTCUCO8lrlLiNE5sK7w+35YoctqYE2HGoW7A/LK+Fg9kwo5PlZzDZTuAoCaXEap1MGbPwrBNAOkYUkMHL13wGJK9NBGhbSAZUPoeTPEwzYDtAe3o7ehmn40jV8CyKUjoG1jW3ZS9fO3zFRn0iyH7B8CGfLg8cSz5W2wHSC0KRB1/7UZCQmzZgmQwzXZ7cNU3JoULzKD55xYICCRMVtiFMa+/1Ydv/B/Jsl5h7Xay6ZeYkW0aFYdrRoqfo1nzzhJUM7w4BAo52eZdI5u6Pver8O7IKyAmp8vL7/ExqCJpJAz6uI0C0KJ35OUMeThxhJGsYGvOS/dGuIp710O9mvWu4IP2DrrqI4aATqU59Lge/U7ANlfbfGEmIreSEUtIkBkZH96JO4i0fF+x5JQOtwkuCEnKZpXZvsqUCCWey0pulvbi918wsxlVOsJNYBtweegnwCKM8HA+Gw/IAoEfDAcV117eUixgmDOImZP3Syyu+QOzzsk8rCKh8c/toSgY1jsX4TanPcnBfbuFiDO8VhmaRnwhzlt40xT/1myl+e9aGRnh/GUbnXuHKe9JTD32nJej4lm9qqirRfHE5cL9ny+eLI/uUHEkt3PglK7tEjyKGmnt9R24oV5opkyOwF5cNY/3z+2sEY31oNc8iFRftiI3b9FFq2JkYPtT752ZdnscYHQa90e9ZsUh4tWBDG0sfetODd2yhQlMqogs73cxZpLJkzmuJHguELCzbb7fD1PYqNab64dUmHQhxsuxWMfR4g7vlfytPhYdo0KxRQL+GSOB99BvY+Hd5DH3b X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: d27c5ee6-1ea6-426e-5bc7-08d8ce8873e8 X-MS-Exchange-CrossTenant-AuthSource: BYAPR10MB3573.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Feb 2021 12:27:53.0735 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 2RvhDXMsWCQrBTHL6ouU4qVo3bYJsBchywuxNPp/7mzp5ufD1MLcDmTq0C67Eu2XQDcPG/O/v0E7kvXg9kVs8xOzA4sB8tvHjZdITFnbr/A= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR10MB4339 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9891 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 adultscore=0 mlxlogscore=999 malwarescore=0 bulkscore=0 phishscore=0 spamscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2102110111 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9891 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 malwarescore=0 priorityscore=1501 bulkscore=0 spamscore=0 impostorscore=0 mlxscore=0 suspectscore=0 mlxlogscore=999 adultscore=0 clxscore=1015 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2102110111 Precedence: bulk List-ID: X-Mailing-List: target-devel@vger.kernel.org target_submit_cmd_map_sgls is being removed, so convert xen to the new submission API. This has it use target_init_cmd/target_submit_prep/target_submit because we need to have lio core map sgls which is now done in target_submit_prep. target_init_cmd will never fail for xen because it does it's own sync during session shutdown, so we can remove that code. Note: xen ever calls target_stop_session so target_submit_cmd_map_sgls never failed (in the new API target_init_cmd handles target_stop_session being called when cmds are being submitted). If it were to have used target_stop_session and got an error, we would have hit a refcount bug like xen and usb, because it does: if (rc < 0) { transport_send_check_condition_and_sense(se_cmd, TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE, 0); transport_generic_free_cmd(se_cmd, 0); } transport_send_check_condition_and_sense calls queue_status which calls scsiback_cmd_done->target_put_sess_cmd. We do an extra transport_generic_free_cmd call above which would have dropped the refcount to -1 and the refcount code would spit out errors. Signed-off-by: Mike Christie Reviewed-by: Christoph Hellwig --- drivers/xen/xen-scsiback.c | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/drivers/xen/xen-scsiback.c b/drivers/xen/xen-scsiback.c index 862162dca33c..cf6d45f2931b 100644 --- a/drivers/xen/xen-scsiback.c +++ b/drivers/xen/xen-scsiback.c @@ -360,21 +360,18 @@ static void scsiback_cmd_exec(struct vscsibk_pend *pending_req) { struct se_cmd *se_cmd = &pending_req->se_cmd; struct se_session *sess = pending_req->v2p->tpg->tpg_nexus->tvn_se_sess; - int rc; scsiback_get(pending_req->info); se_cmd->tag = pending_req->rqid; - rc = target_submit_cmd_map_sgls(se_cmd, sess, pending_req->cmnd, - pending_req->sense_buffer, pending_req->v2p->lun, - pending_req->data_len, 0, - pending_req->sc_data_direction, TARGET_SCF_ACK_KREF, - pending_req->sgl, pending_req->n_sg, - NULL, 0, NULL, 0); - if (rc < 0) { - transport_send_check_condition_and_sense(se_cmd, - TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE, 0); - transport_generic_free_cmd(se_cmd, 0); - } + target_init_cmd(se_cmd, sess, pending_req->sense_buffer, + pending_req->v2p->lun, pending_req->data_len, 0, + pending_req->sc_data_direction, TARGET_SCF_ACK_KREF); + + if (target_submit_prep(se_cmd, pending_req->cmnd, pending_req->sgl, + pending_req->n_sg, NULL, 0, NULL, 0)) + return; + + target_submit(se_cmd); } static int scsiback_gnttab_data_map_batch(struct gnttab_map_grant_ref *map, From patchwork Thu Feb 11 12:27:27 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 12083101 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 96FF3C433E0 for ; Thu, 11 Feb 2021 12:34:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6E34A64E05 for ; Thu, 11 Feb 2021 12:34:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230385AbhBKMdt (ORCPT ); Thu, 11 Feb 2021 07:33:49 -0500 Received: from aserp2120.oracle.com ([141.146.126.78]:43142 "EHLO aserp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230433AbhBKMam (ORCPT ); Thu, 11 Feb 2021 07:30:42 -0500 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 11BCPtFL050954; Thu, 11 Feb 2021 12:27:56 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2020-01-29; bh=bRMukegXz2fmJibGm1wRff10RRcD80Mk3Pklmn95x/s=; b=o3MnCDfen2XDbHWtD0uKZAuQUcDVlvjX56EULqb3yNK5R/Hh+Hs+LuF4JoBrR9rPMnel 4Jd39/0QflZkisCAXHCHLZtMoPKD2pk4i7ajkyrCemdt5WQLUB5aYZvt11yCqIp7dOwy RUOUe4tugtvytJKjgbKopouQCQXYjXyefXKURVfTeu9hMZvXBKNaSbyoIoA9hBM15h6q aPL6/3jsvgqj0pqAFi+ieg2ta8m1S5kKtq3t4KG7g33bevnnn1pHLhEWD9GpfDhDYWUb K1EhECeJVg7MKPbT34ecO3CpfynWi9B8nXoL38IZ+3QD7HLAtGmSM/7coQZSeC4YrfG0 mQ== Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by aserp2120.oracle.com with ESMTP id 36m4upws4v-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 11 Feb 2021 12:27:56 +0000 Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1]) by aserp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 11BCQ2iF193594; Thu, 11 Feb 2021 12:27:56 GMT Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2106.outbound.protection.outlook.com [104.47.55.106]) by aserp3030.oracle.com with ESMTP id 36j4prg5ak-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 11 Feb 2021 12:27:56 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dyiRRjfkWZK0d7uArGHQi1wjSoYujRpmAyCttgiweIaDns8chAcr6b8vKviRp+jMK0/J8PgeYsKqnRYkJVZmCGps6VSRc+cnv8FvOieeYMzwHstWDoN/x7ogVHD/0qpgbdKrN+5z9X8TL3VFCn0ClDQQeIclBz9/PWxNC8BkqAUPq6fWwz+ZTe24CBBRTbEwM1bTHMJyjRiIEMxj7IR4+OZm+waq5slZHtVSrPnZSnpqUeG98tXi6mPn7YPcEddXnfOKx78XKEPmNzF0CnbfoI3+K9zJg/6ReGLzxSuDtrvrhkruyrfK4wl8DKJtL8vcGL4gjqgwMUW/+0R+VyFAWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=bRMukegXz2fmJibGm1wRff10RRcD80Mk3Pklmn95x/s=; b=glj3pW2TN1ALqVbhVBZ5GOygPRX496HnPasvw7v/CnD8wfEiFpzl3QgaQ/nzmd40ZYVmLUZ8un6Ch8rJbS+XWULUk9q1DkQm57KSMjHuSqP9lba3/h2PY3SQV9zt0S3moBMwXUHdRq4K8gzXfQ8NjHMWSTrVjqTXvDbdaQtKoERitnRNy3yNnl9qDuUmNxasUpiI7GMZXZn/3C4zEt3r55dMO6ejWqqHTDyuOEF4St2433VW9j+aAusLxp9a/QdyB221BqNOsVqP7/9iEi+9w5IjAvcB5ZdfPrzcqEvTD/CWqGqci0Vu9a3NFyaCc+ncozt9cbPwcZq/ReiSqTRvqQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=bRMukegXz2fmJibGm1wRff10RRcD80Mk3Pklmn95x/s=; b=Paf6sDkyPWgsPni2dcv4JoaknZXxJJJPeS88/dA6UZ+QlijrAAY107gXm7HyA/03yqoOyl6+LPO6qoqzwjb6KGRwlwkd7hvS538Aiks6O4RyYdV/VXSy/6SKSbP03jzso6AHHrMpzVUX6syPNNV8TvMN45Ei6jodUDIgR4XqYkE= Authentication-Results: lst.de; dkim=none (message not signed) header.d=none;lst.de; dmarc=none action=none header.from=oracle.com; Received: from BYAPR10MB3573.namprd10.prod.outlook.com (2603:10b6:a03:11e::32) by BY5PR10MB4339.namprd10.prod.outlook.com (2603:10b6:a03:20a::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3846.27; Thu, 11 Feb 2021 12:27:54 +0000 Received: from BYAPR10MB3573.namprd10.prod.outlook.com ([fe80::1d86:b9d7:c9ef:ba20]) by BYAPR10MB3573.namprd10.prod.outlook.com ([fe80::1d86:b9d7:c9ef:ba20%7]) with mapi id 15.20.3825.030; Thu, 11 Feb 2021 12:27:54 +0000 From: Mike Christie To: hch@lst.de, loberman@redhat.com, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, target-devel@vger.kernel.org, mst@redhat.com, stefanha@redhat.com Cc: Mike Christie Subject: [PATCH 13/14] tcm_fc: Convert to new submission API Date: Thu, 11 Feb 2021 06:27:27 -0600 Message-Id: <20210211122728.31721-14-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210211122728.31721-1-michael.christie@oracle.com> References: <20210211122728.31721-1-michael.christie@oracle.com> X-Originating-IP: [73.88.28.6] X-ClientProxiedBy: CH0PR04CA0060.namprd04.prod.outlook.com (2603:10b6:610:77::35) To BYAPR10MB3573.namprd10.prod.outlook.com (2603:10b6:a03:11e::32) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (73.88.28.6) by CH0PR04CA0060.namprd04.prod.outlook.com (2603:10b6:610:77::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3846.25 via Frontend Transport; Thu, 11 Feb 2021 12:27:53 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5391b207-7031-44eb-f401-08d8ce8874a1 X-MS-TrafficTypeDiagnostic: BY5PR10MB4339: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4303; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: jJ/Oz4bv8E83KrU9d9IUbB5hjhmLzapJSvvO7bTh7k9u8Hw3QUJqFAuBe90HMS9sOcfk5KRFzNqJLgKC9I4YPinh/N3DMs/Z/CiS/UO3lj7DMiPeX8MXeAXEsyrYz3lRHLIY1Xy6KLuPi1dV2+nStaP77tdbdl6KwS7mgcvydnl6GrGLymRNuIScqmukeXbt9EyhDE5DxGvO+rPPgYu/c69QLjOg2DmhNOmioGtSAWwPkjc8sEireciacD5Cz7zSbYdb6+sxIQYxzCJ7HpnnaZQzqd5B2toQO/6oFV9qhsEd7oOqSkNERmfRlUrJdve3F0DKzc63G1ZKOF6WVOwCJZjImsXHpMk/citA2WAy7Y/GSlQ2Uttbj+af5O4siJFQlpvb9ItgV8wfTJD9zPhni1O77GUSmd4x9Ga14TeFfTR3UTSeSecnfanjFB/f+lWcCEN5Bz43i+voua+6Ty809QgIjVuj/lcKwd/DMfVSK5t1yhd3rhwlY2xMjw7yrGH68y9TfJWzgizeHnLHvD3+5hMcCPlapJc6cYBl1K6H1lVgv84uXUmrIRfqwPUbcG1m2EDlMP16+MtGaAuMN9tP5A== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BYAPR10MB3573.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(366004)(346002)(39860400002)(136003)(376002)(396003)(83380400001)(1076003)(6512007)(16526019)(2906002)(107886003)(4326008)(6506007)(478600001)(316002)(186003)(6486002)(8936002)(26005)(52116002)(66946007)(86362001)(6666004)(8676002)(2616005)(36756003)(5660300002)(66556008)(69590400011)(956004)(66476007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: 6ZDHEy0S9hiZG5OAd4nbnu69ADr9oN56Q1lp7VtSemXG5pxQrXbXIlDdgFX5EDzAyjNUogvR9GJ+f7ThyUR6T1ZOzFV/zD2CuWiw8PtvYOlU3B3TxxTjnNfikL9ePxmCXqI4f8qCfq8fTEuu0vr+L4eEw6EGRG90ce2gWjj292SKoTcQdVJ6L88z37e1TXwZyQ5hHoOAba6XNHHh9mgjUAQgF1WHFcC97ktcwFWmaY+9QC8yWZ2dSB3rOuKCgCYssREzVfj7DmNujYEPNVHFJ+ls/9XmlereWcWq+65r+1EYIvdaK6MA9ZzPRvkSDk8Re63s2VZEwGs8GiFlprK5AwQ5iSCZwIhxXqdO2ovzsAgogLE8yx73WWaYFI3jecuVzdBwkLue+T1QmV32pmLPV18/8Hxv9fRateBq6gzhWiZmgdqTLJlpJvQ4ZLAGz8h3zzpzphaRfabx6lIEO93d/799JR3xtk9Ky9lrRu13K1A/PoL0WN+j/Ix5ZTfzjBgtHd/YMRqDIlPCT5XWZ0jmlh1wgbE2lwI0GC+x/6IX0/2D81c2YrCJLMUWgglHAKCdErizVUNvbjHBoYoeTnfzMpNK1BrWIKzf5czxfyhpRFhdWEu6AVcQTZvTOtf5c6VuowhraEqiV1PNlwtgsSCPbstqjuv3hLK/ZE8AVv8UfbeLyUSe/eE3IqRUclg/WKsj4S7c90QqnSaMcb1yLXM+KkqIvhf/0ATNzPTLLVaTq8RnttJwtHxmYY9x4pjAySIa5f2DOzHuyzU4rdGLNU+islfWoXnEETNl3wqUi3e+aCOrQsZXAYCf0S8tiSHhmwlMwVkOYFFaODDaBg18+MUAjpMENeJNo0Bnj5XkDTEJN90lDKriAIesQAnhBs/Cwiqa2KkcmNT5Wtdok22w3mHoCrpgFQcvOxjcs9W+55plBCPuPb3jUua4PGCPFSlDoTHsaq9fhI8lxQ47n3AthDNbPw8S4To54mv5eO24BdW2c82SAkAA1vOpgXrn77Nefz9YxZBJ7aTwF/bKD+riJzZU3YH3tDzJZwFlYq6DS78uDTDJmpp0f5VMWiJgpkpPP8LnN4nsnFfShIOY2AlhxW/H6a2OzRcNFLB5QzOoU/wzaP7eOGF5xLEf8Xj3Lp/jBUGt/4BMmkNcYoLV68X81WzkUke74GFBO9vRtKKrSLYzddisJgz6uLPNWoYahKFoPHJ2j08fSm8Wo1dJEe635YW7dgqZMu4gHLiI9LJnSOi5EBlQFWpWUHFQWoxEojK82YLTR+8xYkOFpjqukluXuYLKGr2qCI+OuzIvdthA9O0oHpH8XU7fNsNG1P9SvN/JUeCN X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5391b207-7031-44eb-f401-08d8ce8874a1 X-MS-Exchange-CrossTenant-AuthSource: BYAPR10MB3573.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Feb 2021 12:27:54.2209 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: /xQSMi4C4A56Jnv8oTWsDISwaT7kDaM/wqgq532+KlpK7I12joWMCKM1NsuDrzGNtw0oPYRnq7wU0O/kgN21uKDDsif6Ys6PWjWfWuI8AbE= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR10MB4339 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9891 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 adultscore=0 mlxlogscore=999 malwarescore=0 bulkscore=0 phishscore=0 spamscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2102110111 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9891 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 mlxscore=0 mlxlogscore=999 spamscore=0 impostorscore=0 malwarescore=0 clxscore=1015 suspectscore=0 adultscore=0 bulkscore=0 lowpriorityscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2102110111 Precedence: bulk List-ID: X-Mailing-List: target-devel@vger.kernel.org target_submit_cmd is now only for simple drivers that do their own sync during shutdown and do not use target_stop_session, tcm_fc uses target_stop_session to sync session shutdown with lio core, so we use target_init_cmd/target_submit_prep/target_submit, because target_init_cmd will now detect the target_stop_session call and return an error. Signed-off-by: Mike Christie Reviewed-by: Christoph Hellwig --- drivers/target/tcm_fc/tfc_cmd.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/drivers/target/tcm_fc/tfc_cmd.c b/drivers/target/tcm_fc/tfc_cmd.c index 768f250680d9..75b258fb727e 100644 --- a/drivers/target/tcm_fc/tfc_cmd.c +++ b/drivers/target/tcm_fc/tfc_cmd.c @@ -543,16 +543,22 @@ static void ft_send_work(struct work_struct *work) fc_seq_set_resp(cmd->seq, ft_recv_seq, cmd); cmd->se_cmd.tag = fc_seq_exch(cmd->seq)->rxid; + /* * Use a single se_cmd->cmd_kref as we expect to release se_cmd * directly from ft_check_stop_free callback in response path. */ - if (target_submit_cmd(&cmd->se_cmd, cmd->sess->se_sess, fcp->fc_cdb, - &cmd->ft_sense_buffer[0], scsilun_to_int(&fcp->fc_lun), - ntohl(fcp->fc_dl), task_attr, data_dir, - TARGET_SCF_ACK_KREF)) + if (target_init_cmd(&cmd->se_cmd, cmd->sess->se_sess, + &cmd->ft_sense_buffer[0], scsilun_to_int(&fcp->fc_lun), + ntohl(fcp->fc_dl), task_attr, data_dir, + TARGET_SCF_ACK_KREF)) goto err; + if (target_submit_prep(&cmd->se_cmd, fcp->fc_cdb, NULL, 0, NULL, 0, + NULL, 0)) + return; + + target_submit(&cmd->se_cmd); pr_debug("r_ctl %x target_submit_cmd %p\n", fh->fh_r_ctl, cmd); return; From patchwork Thu Feb 11 12:27:28 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 12083099 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E1135C433E0 for ; Thu, 11 Feb 2021 12:34:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9F21664E2E for ; Thu, 11 Feb 2021 12:34:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230263AbhBKMdf (ORCPT ); Thu, 11 Feb 2021 07:33:35 -0500 Received: from aserp2120.oracle.com ([141.146.126.78]:43144 "EHLO aserp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230418AbhBKMan (ORCPT ); Thu, 11 Feb 2021 07:30:43 -0500 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 11BCPwwP050964; Thu, 11 Feb 2021 12:27:57 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2020-01-29; bh=QSXy+u4wfxMoiI3PlQFsQTziZQjSgeni3stxI0PcGdE=; b=YYfR6Oin3/O7gwSZFZdf4cqZOLVkfOwI/ax/70tXd4JKUs7WB8M/FGyYm665nqigGJDq CBzXIG1G9s6AOZHnmR8gX4S8W16nrVQZTWMX5Ps91aSa/+IqFeSOftC/dhZ/sZw+OpsV zQjfQzDVy64a8GGIN2DP2sWifGiTil8DXCGF8wC9XGscJtrK4k3tg6jjvGuLkSxmAeqg AqApRqzeHm26nBYWMIQIO6Mjnj2QdAUd7aos1J2oGXIW30kbnfo+vskYzgbqeuMxAFqk qK4qME2JXnjVZYiqLtnj285KAXs3ggz74WL1LqSU+Tq9vPZHbFa7hLBzzLKEDUCfsq5F tA== Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by aserp2120.oracle.com with ESMTP id 36m4upws4y-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 11 Feb 2021 12:27:57 +0000 Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1]) by aserp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 11BCQ2iG193594; Thu, 11 Feb 2021 12:27:57 GMT Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2106.outbound.protection.outlook.com [104.47.55.106]) by aserp3030.oracle.com with ESMTP id 36j4prg5ak-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 11 Feb 2021 12:27:56 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Q8kjf84axy5SbsmYLWpQ8KOw8dUPSMx5MWhCEOnUXBFla2FHq/673jYXqtvQ6PfF4LrJWoxiGycgHcHWwYlSms8vw/BrIpIXj9SFvLKgeo2Fo16Qt2bMnPAT2gP1RNhGsdvFa3JiQ9pVGVbXt0hl78J27oHTLA2n3FBo1tdVJ0Ae1XcizmUl2KLZijz4tdefhLq1LcJlnHVNtfQGV+BwECLhw72kzJ8tEMgu3/cfQF9WmyiUeI7Pv50vYodM8IxvVZEo1MdeVbmshFUnyOqU0R+AnMiS6tn3QSWv//xpaXbhR/Y3UIRcMfq21TyCum+3cGxFBxVEQD1BdQo1gr0RdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=QSXy+u4wfxMoiI3PlQFsQTziZQjSgeni3stxI0PcGdE=; b=eBPE7HcYqgwy30dNXbWoVrZ0uZqhWrQO8s66U8WvZHOaliw40VNBqvjVtw2rcYOVhotzE/mMjGVMD1q1a+w9DLFODIPC+EhD5lx9Tgwa/AsBnlbfFcrynFRt9Lu5Nu5sscWlX364dHXhYJkEkewo/dI3lSosYrWcOw+kDnY2sRaAldUWJTtcSRG4qIfUbK8nCEWR9SO0Wtt9M0Sbdq0QXxdQqwf3L00i7DO5JB239N58AMSC7KF2IcUQOViAOmLjhaU6mcwG/RyvTS03fC4fhuhMMTQDaC0G+dpQtynLSfZGNvi0YY/Y5PKt5BCPC/Ah0BMmetoELnZHhSMMVDp2hg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=QSXy+u4wfxMoiI3PlQFsQTziZQjSgeni3stxI0PcGdE=; b=KzC3Kg81ghkImhUO1u6yYWOpK6lnBSEhviRy2WVWsDXMEXxegD2QAqfvRLUo/A3CfM6UEvuqUPM2OfPVEXZzR/rC/dfFdaW7dtHdQjal+3cVI+z4F0msRzJjA1xFX/pWlpKojtVQ7wMSjiBSTD4+b41zRJEjfpYapCrD0ewKROU= Authentication-Results: lst.de; dkim=none (message not signed) header.d=none;lst.de; dmarc=none action=none header.from=oracle.com; Received: from BYAPR10MB3573.namprd10.prod.outlook.com (2603:10b6:a03:11e::32) by BY5PR10MB4339.namprd10.prod.outlook.com (2603:10b6:a03:20a::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3846.27; Thu, 11 Feb 2021 12:27:55 +0000 Received: from BYAPR10MB3573.namprd10.prod.outlook.com ([fe80::1d86:b9d7:c9ef:ba20]) by BYAPR10MB3573.namprd10.prod.outlook.com ([fe80::1d86:b9d7:c9ef:ba20%7]) with mapi id 15.20.3825.030; Thu, 11 Feb 2021 12:27:55 +0000 From: Mike Christie To: hch@lst.de, loberman@redhat.com, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, target-devel@vger.kernel.org, mst@redhat.com, stefanha@redhat.com Cc: Mike Christie Subject: [PATCH 14/14] target: remove target_submit_cmd_map_sgls Date: Thu, 11 Feb 2021 06:27:28 -0600 Message-Id: <20210211122728.31721-15-michael.christie@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210211122728.31721-1-michael.christie@oracle.com> References: <20210211122728.31721-1-michael.christie@oracle.com> X-Originating-IP: [73.88.28.6] X-ClientProxiedBy: CH0PR04CA0060.namprd04.prod.outlook.com (2603:10b6:610:77::35) To BYAPR10MB3573.namprd10.prod.outlook.com (2603:10b6:a03:11e::32) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (73.88.28.6) by CH0PR04CA0060.namprd04.prod.outlook.com (2603:10b6:610:77::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3846.25 via Frontend Transport; Thu, 11 Feb 2021 12:27:54 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 48a133f4-0ff6-4660-7cd8-08d8ce88753f X-MS-TrafficTypeDiagnostic: BY5PR10MB4339: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8273; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: b+UtDyH/BRZo3sNVfpC3sqIJ6ZzexeRZWZBWvRqkJuxLSLCwCpGS8yMm241qTLVqsrHeukdxmeuIbEYbnGZJMtRd56CGG4MFIqRQsf6U8KEVIfjX1xN11hDsdLnZUCDYf6Sne+z8FCDfXsiRYr9fuNe33ZmWiracVwHAAqW3TDa8AllLfac446d2bstyY/Lc9ot61T8LXdBXEm2ovIZgIcLyEQrzeZiC66Ibow7gQ+x8O1zgIP0z4nUZoh49VmIN+TTGDbnDqn+ru22Q74TK10QEVAYxGq1xJ2t/mbx6hQnNAifNPuZUseLqjY2kXz9zYser4SPx89KHZY4jsaxYJvc8Idanrv0p/EukVZeOB2EEN59CmkFO6NVxPjQ6Ng3iqSDW2AnYZhOdsIBxGmNOeYyuClP1hU3gJM4MZ01YaFRCMzIbUJNIwsWWv+PCWtXLXJrtjnblsGJjGh1pFZRCrfJoFxekQU2/gF+nLyDFF4ec3htcIxBcgbEBhkCKmSVXUWgp4P/rZnRSJ4DuKeXMGTHbLvI1Hnm68eLIsMrPqNsMkww8QbM+wJy0Is15glb802+Nn8pvSb40srN2PKH7xg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BYAPR10MB3573.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(366004)(346002)(39860400002)(136003)(376002)(396003)(83380400001)(1076003)(6512007)(16526019)(2906002)(107886003)(4326008)(6506007)(478600001)(316002)(186003)(6486002)(8936002)(26005)(52116002)(66946007)(86362001)(6666004)(8676002)(2616005)(36756003)(5660300002)(66556008)(69590400011)(956004)(66476007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: fdJLrVr5UwBK8qfKhQbAodlCSAVWkr0TE6s7F2cvoqxzCuMo0juqZHzG6RlaD2K80Lega97q7iym9nTfrAlhcFP/1JtBVI1KTOj1KUt6GiFSKLf+oq5wZlvaSVRrRbuAkgqTRteoZnoqiBMdizqLmTJ3eBqgZQNCAus6Mq+V4hFFU9RPJfrdAOHsn5kfAYWZ53sJ7jL7QLNyhgl6UVoOzCE/YRnNA3tJtk6qGHs5mUIK3/jaNXkF8/tinodv2B1ySHimq3/bMmRF9WGe1lq8NHhGqQhIq4acUSt4PhrVqcQ0wZnrnmvmj1MwGJqFAgGFA6qKUDMyG8ffWa3GnfWLtnNNJMuVyH6EQIUZGC3w09I6Fz9b+ybef3WU0XQH3o8x7HolmQIg0X+hLH/hhQmQezUmtmVWUdHjEx0j+CGNuf6gXwgxFTy/UPsvFNzOEG1S4XIudFt/ZygyG1qmS+w0kT9NDIjTNbe6AP8KvCZsQXKpUJ4Zck5/1+C/dmMD0nYHbpFu/mJvInYM07EYmaj5VlvUENoaezdydpluOwTd4LV4HZCXc2UoMeMT+tE9uevmOAnSXRrJoLkdZJj27XsGMtdfmIJhDHfKfdqqIq99O9MwVwn1uK+Jo3yEiPTORljPMJNZcICckPTcmBdTd9Er659eGnarrfZt3PteM3eR9M4cDZ92iJoE252r9zTl9svT9FFeF8pPk2i9GwmQSUdrckX1N5TA6KulMl2ACmvEP0tPuYO0ajhvjxqnlgZzKLkZEmNHAvh/1U3bwJLHsdpcs1djIBCY/JppOz2oF9VwmyC6Y2+GXgUwmYlpdwPOMeKnva9Z4HQ9IrOgtScPbNS73E+gfpetNvkqzepkqVW/xTdfy2GEqrwaqkWHuBuZ8GH0UATi/wF58oQ7MrX9BcscVmPWpJCd0NRZ4iTVFmRlDORloZDYnKbIdG/WHigldIeZF7ItsmsdfxCOYPbFZomCoUVgKYJ+TZzo8fs3vuDxGmA/7HVV47s2sCSa030aL5q2lum+9I+aOXW2w2TNiqJEK4jDoI2vPLORQETNLad1gd5oqnLjCwrPGtt4Wd1z+Fx3TtsLjGX5VS/kZoPTX2TZQAbOdzqrXYQx8I5FWJROo3wZPZ1XNpQ5mLudEoTiIdV16m8z/7zUFgjX+DMxvG+W1WRUv+Uk60xYi92ZPdkiDzxUbV3EPRLKlf7Cdxq9iySUcg7XlaMQBO/Y7C9SgndLWye/Q5iRdyF0yTliC+eBMYOzXZ4WSAIazjHvyxE597Ifrfu4Q7mmfwRwkpEYFteqMjOnJBoWxfn2FFzPf/C8qcvn+UoeZdEJARqmgXPI3OlH X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 48a133f4-0ff6-4660-7cd8-08d8ce88753f X-MS-Exchange-CrossTenant-AuthSource: BYAPR10MB3573.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Feb 2021 12:27:55.3033 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: EhDYrCWvS56abdnSAYpDJBJhx/iZLglHu+KVvYegwpop4muEWLG/Qb5qudnBsSuJb5pDRwYRjinA/zKDLtfS64ylZM3MrRJ87d/OTZMfFuY= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR10MB4339 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9891 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 adultscore=0 mlxlogscore=999 malwarescore=0 bulkscore=0 phishscore=0 spamscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2102110111 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9891 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 mlxscore=0 mlxlogscore=999 spamscore=0 impostorscore=0 malwarescore=0 clxscore=1015 suspectscore=0 adultscore=0 bulkscore=0 lowpriorityscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2102110111 Precedence: bulk List-ID: X-Mailing-List: target-devel@vger.kernel.org Convert target_submit_cmd to do its own calls and then reomve target_submit_cmd_map_sgls since no one uses it. Signed-off-by: Mike Christie --- drivers/target/target_core_transport.c | 69 ++++---------------------- include/target/target_core_fabric.h | 6 +-- 2 files changed, 11 insertions(+), 64 deletions(-) diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c index a82b7da09872..ad30a99a5cb2 100644 --- a/drivers/target/target_core_transport.c +++ b/drivers/target/target_core_transport.c @@ -1751,57 +1751,6 @@ void target_submit(struct se_cmd *se_cmd) } EXPORT_SYMBOL_GPL(target_submit); -/** - * target_submit_cmd_map_sgls - lookup unpacked lun and submit uninitialized - * se_cmd + use pre-allocated SGL memory. - * - * @se_cmd: command descriptor to submit - * @se_sess: associated se_sess for endpoint - * @cdb: pointer to SCSI CDB - * @sense: pointer to SCSI sense buffer - * @unpacked_lun: unpacked LUN to reference for struct se_lun - * @data_length: fabric expected data transfer length - * @task_attr: SAM task attribute - * @data_dir: DMA data direction - * @flags: flags for command submission from target_sc_flags_tables - * @sgl: struct scatterlist memory for unidirectional mapping - * @sgl_count: scatterlist count for unidirectional mapping - * @sgl_bidi: struct scatterlist memory for bidirectional READ mapping - * @sgl_bidi_count: scatterlist count for bidirectional READ mapping - * @sgl_prot: struct scatterlist memory protection information - * @sgl_prot_count: scatterlist count for protection information - * - * Task tags are supported if the caller has set @se_cmd->tag. - * - * Returns non zero to signal active I/O shutdown failure. All other - * setup exceptions will be returned as a SCSI CHECK_CONDITION response, - * but still return zero here. - * - * This may only be called from process context, and also currently - * assumes internal allocation of fabric payload buffer by target-core. - */ -int target_submit_cmd_map_sgls(struct se_cmd *se_cmd, struct se_session *se_sess, - unsigned char *cdb, unsigned char *sense, u64 unpacked_lun, - u32 data_length, int task_attr, int data_dir, int flags, - struct scatterlist *sgl, u32 sgl_count, - struct scatterlist *sgl_bidi, u32 sgl_bidi_count, - struct scatterlist *sgl_prot, u32 sgl_prot_count) -{ - int rc; - - rc = target_init_cmd(se_cmd, se_sess, sense, unpacked_lun, - data_length, task_attr, data_dir, flags); - if (rc < 0) - return rc; - - - target_submit_prep(se_cmd, cdb, sgl, sgl_count, sgl_bidi, - sgl_bidi_count, sgl_prot, sgl_prot_count); - target_submit(se_cmd); - return 0; -} -EXPORT_SYMBOL(target_submit_cmd_map_sgls); - /** * target_submit_cmd - lookup unpacked lun and submit uninitialized se_cmd * @@ -1817,22 +1766,24 @@ EXPORT_SYMBOL(target_submit_cmd_map_sgls); * * Task tags are supported if the caller has set @se_cmd->tag. * - * Returns non zero to signal active I/O shutdown failure. All other - * setup exceptions will be returned as a SCSI CHECK_CONDITION response, - * but still return zero here. - * * This may only be called from process context, and also currently * assumes internal allocation of fabric payload buffer by target-core. * * It also assumes interal target core SGL memory allocation. + * + * This function must only be used by drivers that do their own + * sync during shutdown and does not use target_stop_session. If there + * is a failure this function will call into the fabric driver's + * queue_status with a CHECK_CONDITION. */ -int target_submit_cmd(struct se_cmd *se_cmd, struct se_session *se_sess, +void target_submit_cmd(struct se_cmd *se_cmd, struct se_session *se_sess, unsigned char *cdb, unsigned char *sense, u64 unpacked_lun, u32 data_length, int task_attr, int data_dir, int flags) { - return target_submit_cmd_map_sgls(se_cmd, se_sess, cdb, sense, - unpacked_lun, data_length, task_attr, data_dir, - flags, NULL, 0, NULL, 0, NULL, 0); + target_init_cmd(se_cmd, se_sess, sense, unpacked_lun, data_length, + task_attr, data_dir, flags); + target_submit_prep(se_cmd, cdb, NULL, 0, NULL, 0, NULL, 0); + target_submit(se_cmd); } EXPORT_SYMBOL(target_submit_cmd); diff --git a/include/target/target_core_fabric.h b/include/target/target_core_fabric.h index 4b5f6687393a..86b0d4a7df92 100644 --- a/include/target/target_core_fabric.h +++ b/include/target/target_core_fabric.h @@ -162,11 +162,7 @@ void target_submit(struct se_cmd *se_cmd); sense_reason_t transport_lookup_cmd_lun(struct se_cmd *); sense_reason_t target_cmd_init_cdb(struct se_cmd *, unsigned char *); sense_reason_t target_cmd_parse_cdb(struct se_cmd *); -int target_submit_cmd_map_sgls(struct se_cmd *, struct se_session *, - unsigned char *, unsigned char *, u64, u32, int, int, int, - struct scatterlist *, u32, struct scatterlist *, u32, - struct scatterlist *, u32); -int target_submit_cmd(struct se_cmd *, struct se_session *, unsigned char *, +void target_submit_cmd(struct se_cmd *, struct se_session *, unsigned char *, unsigned char *, u64, u32, int, int, int); int target_submit_tmr(struct se_cmd *se_cmd, struct se_session *se_sess, unsigned char *sense, u64 unpacked_lun,