From patchwork Mon Jul 10 21:44:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 13307681 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 160F8EB64DA for ; Mon, 10 Jul 2023 21:44:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229564AbjGJVo4 (ORCPT ); Mon, 10 Jul 2023 17:44:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45706 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229450AbjGJVow (ORCPT ); Mon, 10 Jul 2023 17:44:52 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C0E1EE0; Mon, 10 Jul 2023 14:44:51 -0700 (PDT) Received: from pps.filterd (m0246630.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 36AHEkNF014126; Mon, 10 Jul 2023 21:44:51 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-2023-03-30; bh=Exk/UTQVHft5PNvs3T/b88CdOsrZPbvupBPycvFeLLY=; b=bLvSIQ7AnQkSwxz401MkhaSxI5KXr52Unk+0V/lLrDMTeQIEB+cr0uGZeoAAOdqG8rI5 Jx48gnYS0TNLGaLnoUlysdIGI2VbwnRX0LK94HwbmAUwNPYXT4wtGVvMk8Qk/Ukiwaf6 MXT3xuH7CNIrlZ5JMzPy5WiCSGAu+rWXnK+fUeavhljYom826Ba9gGoUrXXrZUYz908D gJ3Yb8ysOxigq/7rN9sgnDIoxTeIFwcn2eM9HCr+tcUnk/oRiQioZxzQqRR927dZVXI7 jZ5RXYvNkfG0pLmpl7Wjofb+AcJxcimYcQ5TB3hahUCFwAlq0jZeBdjzImZcgQcrp7g1 2g== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3rrea2skhe-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 10 Jul 2023 21:44:50 +0000 Received: from pps.filterd (phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 36ALDtCH022849; Mon, 10 Jul 2023 21:44:49 GMT Received: from nam02-bn1-obe.outbound.protection.outlook.com (mail-bn1nam02lp2045.outbound.protection.outlook.com [104.47.51.45]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3rpx841rq4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 10 Jul 2023 21:44:49 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=l2M2aT3E7DR4UeAiXcwiiUi9M5HD4mmFPe1vpv26ihAN66CdGM/P9Wlrr6Krq6iEi31zdUlPFpcjlitjhPIEH+eY3bLDplTWGSbruwKD4fJyRA9W6jeaUJiqvZYbPbiBpVAuvXtjnKXqFzDesHUsgZ5giU0n+36eyygr8Y3u4tIQGnoLLe7FsJkPC21sfWnTZw+SOb1RPf9978lN8sNluZBDtJUPicEZzNJSeu4Oy0UsmVwIRmyXqCgcem0ADABPyiIhj+MF0LgPDC1j7RaXyf/hxRS78i+7jEDTJ7yXY52yOweim0xYQx6HbX8t6basdu0dgOiIzdlvf1VNZN19CQ== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Exk/UTQVHft5PNvs3T/b88CdOsrZPbvupBPycvFeLLY=; b=k4b8kVMck+iQP2qG57Oa5HlZeWL/PoJDovcvDBIsn0d5LXrdjMmbE+ObsrZkpw+aJnAaVrV/jYRRw1YLQqjkmehKZd7fm0a+lt7gBPo5LlFm7OGJ1+2w5Dgf+NVnnEgt9OFEJNJaErsVsk6CB4q0ho4tFojr8ovruN0pEgOnyoEo0ubOU6IgNIKG9j9tnr4sxFqytlrCINouD1rhnn1vj316z4dWDSfpZBKOoQr4DW+flUt/e5ylFmgM8bxwukZ/00W/CtwE5H9zb9JMB3sEuoLNinmW5n5x9WNsYzwugub2y16AK0aq4MvVHJEsTNClTTdB8K2MTGYGl+fmO7+P4g== 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=Exk/UTQVHft5PNvs3T/b88CdOsrZPbvupBPycvFeLLY=; b=qqt1ESYNNhuhRvHhepVYV/POUmJ8u8FCPYwZg0qyL741j2Er++niZizFrflY+CY/1lZOuI6ykFe7uJ+Pr8i/LHesifIISPmTj0C3o5yArDZCjLZVEgpu6n4eevMFasf0V3p9oWiwXEuEixsRBNQkMyRObrW/XT+MRi6gHkA3K04= Received: from IA0PR10MB7255.namprd10.prod.outlook.com (2603:10b6:208:40c::10) by CH2PR10MB4117.namprd10.prod.outlook.com (2603:10b6:610:ac::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.30; Mon, 10 Jul 2023 21:44:47 +0000 Received: from IA0PR10MB7255.namprd10.prod.outlook.com ([fe80::e2b1:1376:2375:ef71]) by IA0PR10MB7255.namprd10.prod.outlook.com ([fe80::e2b1:1376:2375:ef71%6]) with mapi id 15.20.6565.028; Mon, 10 Jul 2023 21:44:47 +0000 From: Mike Christie To: martin.petersen@oracle.com, linux-scsi@vger.kernel.org, target-devel@vger.kernel.org Cc: Mike Christie Subject: [PATCH 1/5] scsi: target: Make write_pending_must_be_called a bit field Date: Mon, 10 Jul 2023 16:44:38 -0500 Message-Id: <20230710214442.6718-2-michael.christie@oracle.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230710214442.6718-1-michael.christie@oracle.com> References: <20230710214442.6718-1-michael.christie@oracle.com> X-ClientProxiedBy: CH0PR03CA0228.namprd03.prod.outlook.com (2603:10b6:610:e7::23) To IA0PR10MB7255.namprd10.prod.outlook.com (2603:10b6:208:40c::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: IA0PR10MB7255:EE_|CH2PR10MB4117:EE_ X-MS-Office365-Filtering-Correlation-Id: e45a7e61-95d2-403f-f432-08db818ee1b9 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: IgNFhZt8AkFKrgC+pFPN1osLJ6rjmykVcpXPUakeQbBykioSDsmGmC/vN2jDBTppu5p00qgwUWw+xuh0cYIqsHe++OlH0gbQ4Pr046y7CbvDMZuzvZ2oLZ/eMPhk5v/TRYUeF1bOVnSSuo70rtqZ+V3Q5jlfDJQ7tNFWDnr4HyXnZJkK0TmzLzSR8J6Aa8leP7/DUaKdTa+UWX2/9a1COOF7cAI9K+ZQYoA0m0ufKsyj4AzfXg0HpYCZpcL/8bPJouf+1QTTds892KOPHU1mU0aAWgorApZaNXKji92Myfw0y8LwSUgaGf/ckLOL1CE16BF3C9ozvohSOMW/6xm8RF942T43FW+x1DmmAx27KnSPL65iDP1RpL+khAw/RWykrSosUtOy615zkcMz1l0P6FHwmNHuaXC0qEj9JlLoggVQDbD0TKjSCXtinvxtA58Wj0Lm1GYb2RUEjkkdTY/FRC1EsN8vjprZwps5YGcmUqBS0fkpIWONzvUfl7lvXTbHWfDvo2GDYdYUavo8Sd3cvnYS7uR/73cDJGQwdYVoSBTbWgo2UhMCBZrfMfKvdf+L X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:IA0PR10MB7255.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(366004)(346002)(376002)(136003)(396003)(39860400002)(451199021)(6486002)(6666004)(478600001)(450100002)(6506007)(1076003)(26005)(107886003)(186003)(6512007)(66946007)(2906002)(66476007)(41300700001)(5660300002)(4326008)(316002)(8936002)(66556008)(38100700002)(8676002)(86362001)(36756003)(83380400001)(2616005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: pb5K3kUUHWfnyExXiPGQaxhxsNd+7gxb5d7pu3PazfFLGQe0zwnJrwB6ZBc08x+jRvIC91TNj001wPKn8SXr4HS4PkWn2UzaaCvuGdsOs87CqKOrxDl7mPwXSCYD6FEQu3TPBVnmVy5Aj3zF3Taloywg6B8+sOqifMa7LBiQA7uqin0kbAZcHFnfuuAbR7lT7i3wagZzDWFYD01QNV7Bgr2HtsKDTWUCEuIvhty1Y2OsTOC0TakHPsawb9S7j6+I2ZgKEIqsBNA5QN9UUvpAlT2bdKjkq3cME6cX5VbY1GpQU5hGmnJI0FFT2f3QcPuL6Qyd0AliX8wtK+8E82yhpPGgQyBmVSB8ic1922SAepc/Vm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ange-CrossTenant-Network-Message-Id: e45a7e61-95d2-403f-f432-08db818ee1b9 X-MS-Exchange-CrossTenant-AuthSource: IA0PR10MB7255.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jul 2023 21:44:47.6942 (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: DPvnJsLhEY6PWiU9u+/gbm249uPXi8lly/HHqocR3g1/OUnzLSi5fNl/iCxa0cWTk11nwAt5p4w5LfuCr6KohX1t3qXYtzU7/4I33+2J2u4= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR10MB4117 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26 definitions=2023-07-10_16,2023-07-06_02,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 mlxlogscore=999 adultscore=0 mlxscore=0 spamscore=0 phishscore=0 malwarescore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2305260000 definitions=main-2307100198 X-Proofpoint-GUID: 2IGgM-KFqpm6gsJyHBoTD9lqBJA-giQq X-Proofpoint-ORIG-GUID: 2IGgM-KFqpm6gsJyHBoTD9lqBJA-giQq Precedence: bulk List-ID: X-Mailing-List: target-devel@vger.kernel.org The next patches add more on/off type of settings to the target_core_fabric_ops struct so this makes write_pending_must_be_called a bit field instead of a bool to better organize the settings. Signed-off-by: Mike Christie --- drivers/target/iscsi/iscsi_target_configfs.c | 2 +- include/target/target_core_fabric.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/target/iscsi/iscsi_target_configfs.c b/drivers/target/iscsi/iscsi_target_configfs.c index 5d0f51822414..620a04e23be1 100644 --- a/drivers/target/iscsi/iscsi_target_configfs.c +++ b/drivers/target/iscsi/iscsi_target_configfs.c @@ -1591,5 +1591,5 @@ const struct target_core_fabric_ops iscsi_ops = { .tfc_tpg_nacl_auth_attrs = lio_target_nacl_auth_attrs, .tfc_tpg_nacl_param_attrs = lio_target_nacl_param_attrs, - .write_pending_must_be_called = true, + .write_pending_must_be_called = 1, }; diff --git a/include/target/target_core_fabric.h b/include/target/target_core_fabric.h index b188b1e90e1e..2a6c4c935666 100644 --- a/include/target/target_core_fabric.h +++ b/include/target/target_core_fabric.h @@ -113,11 +113,11 @@ struct target_core_fabric_ops { struct configfs_attribute **tfc_tpg_nacl_param_attrs; /* - * Set this member variable to true if the SCSI transport protocol + * Set this member variable if the SCSI transport protocol * (e.g. iSCSI) requires that the Data-Out buffer is transferred in * its entirety before a command is aborted. */ - bool write_pending_must_be_called; + unsigned int write_pending_must_be_called:1; }; int target_register_template(const struct target_core_fabric_ops *fo); From patchwork Mon Jul 10 21:44:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 13307683 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 40DBEC001DC for ; Mon, 10 Jul 2023 21:45:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229517AbjGJVpA (ORCPT ); Mon, 10 Jul 2023 17:45:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45724 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229538AbjGJVoz (ORCPT ); Mon, 10 Jul 2023 17:44:55 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DFA5911B; Mon, 10 Jul 2023 14:44:53 -0700 (PDT) Received: from pps.filterd (m0333520.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 36AJFoUW022897; Mon, 10 Jul 2023 21:44: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-2023-03-30; bh=phfv+F1fGAVDfZsBq2qq4pCE73sAAAiuvnOIvupp9bU=; b=GeHHrQ+idnU0R7kr00ZA2liXHK/PieVlgsaPWRVDzz3urFbdQ1ulNqukwjvn0kolJgqE 6MirKHXCJU/YzB/xBh5z77qVU9YAVZ4brQOlOweB54RAe6kiAUHyOZF/+zDGgCuq1cu+ bcTBz7HEXZlK3d3WYU0k1PckjLxbLXs+I2Pu91UVyNZgBRb2gzOR8FokmX35BzXBoeig ACvAXUoLkcWpQb/WLZTJ/xzKRSOIxbxMnc8iayok+tYupcukm4ngf8ARg3XWL7pPlwPA Zi3BArCyOzyIJa/+4c8L2l1NEU+raMBolMLe/kiGWYB3XgmRPVY9892ltk9/AeI1GQTT Zw== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3rpyud3npm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 10 Jul 2023 21:44:52 +0000 Received: from pps.filterd (phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 36ALJZIg022812; Mon, 10 Jul 2023 21:44:52 GMT Received: from nam10-bn7-obe.outbound.protection.outlook.com (mail-bn7nam10lp2101.outbound.protection.outlook.com [104.47.70.101]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3rpx841rqk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 10 Jul 2023 21:44:52 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jTbRohyr5lsn49W0ej3s77O6+TRD9odmLP7nl5+TcKvJX0UxmuB6vCLxKoQroTSTYIKxQWlm7VbVQLqATT739V+jJ8fcKGEZzBGCtWntX8lBe40jb22ePGuA6I5D7+nqs3t4LyDqk0Ff8aI1Y0mQtVb5qn5idT8Dm1JFWTeUpa1dOMtBTZdGu2nKtlbwYWUxPn/z4nbaxN5KL6s8f/OMG0PW29/ENV2fFxOBpU/L+3Gy38N6gAGehfVPjWclCxjjjJ18dzOtag/UFp39S7gDXtW1S8QdsijvYIlpCqtmymvgNDV2vXqbZ+fv0Z/H6qFrrow5YqF02LYvvhiTHKdfOw== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=phfv+F1fGAVDfZsBq2qq4pCE73sAAAiuvnOIvupp9bU=; b=KOik2JObK/qiGHYZmoN+mLD9qAtmNJMPHKOVrHjWsToSSyTOK5u/JxB/UQAZEaiBIEOx0lrb+OHmpnQxCBLVCI+G8Mbk2HqrAHHsQO6Ai4GF4zqk2GDgg4DdhoMyBDXFVnR5XYTbAYSFuOcCiQc+crxxb2Syicp5aDpcj14++HOt/gWHuo9se1K+Dd6fO1QWSY3N0QEqVjzPtpT6K4TV4Zq86bbAefklJO4QjvLFJzx695OVbi/wxcmBckwUBSHWG7+OcjRC20i/1gediBmNylTUBDZS54x5deS7I1tI8kqLthTKjKo1eu1Mgmuhb+y97e+iOFEP3sIFmyibZEocKA== 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=phfv+F1fGAVDfZsBq2qq4pCE73sAAAiuvnOIvupp9bU=; b=WeA2lICvQasJyo90RbUVZa/nXCEIvh7hg8eqtHbFSJux8rZUUhV1Ce1AiafdQYE/0CVrpqsD7LtV0BZ+jI7+KZ3diI/Cy1dp35ZdfIH3o+RgxYbEC14bBkqFjDtDH0/4wF2aBIJTM6o7f+eZ1RCsgIh/EP6L7n/QwQ/5EId8dvs= Received: from IA0PR10MB7255.namprd10.prod.outlook.com (2603:10b6:208:40c::10) by BN0PR10MB5080.namprd10.prod.outlook.com (2603:10b6:408:114::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.31; Mon, 10 Jul 2023 21:44:49 +0000 Received: from IA0PR10MB7255.namprd10.prod.outlook.com ([fe80::e2b1:1376:2375:ef71]) by IA0PR10MB7255.namprd10.prod.outlook.com ([fe80::e2b1:1376:2375:ef71%6]) with mapi id 15.20.6565.028; Mon, 10 Jul 2023 21:44:49 +0000 From: Mike Christie To: martin.petersen@oracle.com, linux-scsi@vger.kernel.org, target-devel@vger.kernel.org Cc: Mike Christie Subject: [PATCH 2/5] scsi: target: Have drivers report if they support direct submissions Date: Mon, 10 Jul 2023 16:44:39 -0500 Message-Id: <20230710214442.6718-3-michael.christie@oracle.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230710214442.6718-1-michael.christie@oracle.com> References: <20230710214442.6718-1-michael.christie@oracle.com> X-ClientProxiedBy: CH0PR03CA0083.namprd03.prod.outlook.com (2603:10b6:610:cc::28) To IA0PR10MB7255.namprd10.prod.outlook.com (2603:10b6:208:40c::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: IA0PR10MB7255:EE_|BN0PR10MB5080:EE_ X-MS-Office365-Filtering-Correlation-Id: 59cbb6b8-98ef-4a5b-17ea-08db818ee29a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: P5FIxXRO3U+QAXfz6GRFE9tdUTIrNn0sh0BeEwe+QwNhwMXKgFuV6hc8skU24Tyii5lJpVt/f10WsATtZZaO3OQT7v3jm51tAOEOP5TGae7cBtggRUPTTJYFT3fv4q9NPTr28XZEx5fO7pJcass5r9uCbB5ZBS/4j41KsjnO67eeViUHvcaGjYKvNvamXSlnMdVnWKnkjG6SQgco5AJhpdFyONS71+P227kvrGhlUyJ1B4GUanfVO8SyzzOqXpIX/N1TNP3zT0S808Qz7ISP0Rthc7Xdl0eUhphtm+1jd15Mi4jJhcyOkQiJwbMCWIMIINvWuExiGN9vuoMDisF342HC2teptx7zYflEldbPt1c679kqBx5oaBAfNmUGzRF//kja2G12Sv+PZPUJsOImf1Jew4friVNytF0zUmCAB2Kn3vfdbK9Xief9A/DgkeOByecBwEUWtNSN8yPNM41oj5LD4PwHo7zsXZVnw12pYAIW+5PY/VD3PGFrNQBy9m0eWjbjVBOVETtPYi+noakVA7YAEQ2VSnKShy5QIfdPakJBF+AeqnZaam4AMN88qMRl X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:IA0PR10MB7255.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(396003)(366004)(376002)(39860400002)(136003)(346002)(451199021)(478600001)(6666004)(6486002)(8936002)(83380400001)(8676002)(41300700001)(2906002)(316002)(38100700002)(6512007)(5660300002)(26005)(186003)(86362001)(36756003)(107886003)(2616005)(1076003)(6506007)(66946007)(4326008)(66556008)(66476007)(450100002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: pItZc5R+oznUOO1FSj4EXnZq6QEZMB9HMLazx/QjwWOmJ7Ze495SBxTwl6siiulOroo8Rb1MZ1k2JeJHGruWUkbkzX2zxlW5jc4jzaCg1T1bY6PW4w3nX2eL9x2kmiWMpECFt98z6cCj1NI8h74UVAm0OHSrDT9O9f+bjTIvHbd1YOb27er32QUAZ4U56WcN9U2+U6Ea07H9ZBbUTbgipCofHTSCcs3k0egDXMp+vKfZ9J8rDjs5uhVrsi8jNhTzwXL9J7jobK0yEfrR502a2bYi9AIViH4K5fxZe0euz4eDuhNCdOYf0mrJKSE6rVNTFwrt9fqqZYVlKUlj0cclQZavafCoO+5xy37RBgxLHNY0fuv7lS7CY0vwV5Hbre2Lns06Q9NxfYc3/UyoqRrNUKUHg6zCd68E+nR4HkVtd4Ep+J5ZOlsZnB/0bzv5pw+cZajDSehdNZ21J5vQ9TmfPV31V/hl+ozjCsmCSaX5Z+HbJOXdpeEU3XzMth++JHmTDmwlabWhMUWB1kQ/W7lSg2eNCqIq8/xF+BXOctPhx5pqBPpWDnes43h6Rso/qPDoPq5dHrOBRUDyuGM95buguEqGMYTwshvIy9BZQ8gM8DvUiQo6Gx1lpne/9qKLdHUJOYPR9fIUjUChm6dZWiRSh4sf1BQUHe42HugCvN00SQ3yu3EckEuLhfXFR5Gbbafr3/tUwNNbMlQeJszVEXrw5/CT6VdnRrGOI/nATqigofHm8eevRxHLJdyESrIsdReF9ERp9ipg0Qy6QYREGGYgkR6EDhwA88LQfJaO2DU2jI0A9UdqR8jYrXmKENuI7eFxFEdMsDmYywn9KJV/Sn/FB/dn5VJZYlHYln1n7rCRktnG+5vGwo+IjiBiQRcikErlQcmvVRe5xdX1KohRkv98Xh6rw5S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KY/0PcHxqEhnK2WqMD5XvDXHxmlPIAUoYIlxppl58wOYJrB3Hn5w7DVaLcEVi2aRfgc64ZfufqYjh7tXLIb0QrynhtY5hhG32NuUWA6n1rDjpaHAalRA5PUo1eI7bi5REJmtwIdLh6UvGC6yF/AkrBv0yVBnqZcTsLttg6U5H0FFc73wIvE1zJKySXZ3yCspmA6kqKyNQOB3SNA3wNvmbNXiL5UZ9YhC/w9i7PDo6F3XMjQuVnZy82pVcEjqfq9eiYRQbph/wiP30x9LZg8agj877v3MtC7173EClXJXnSRs0i8PRogw6DrDBhhQrDGGVXBFKmJaDJR1KqMMef69MmEKigAa7El7BzJicvc95KGHcj/1eUleP/EUO26zbdQxHs09ItGJQM6bD3qwN9S/nvY3xpZX+qAYH+VVLcwF/VX27zSIlZqsaUhmdn8Wf3fUqoxPCnbjDX64o1yq4Nb5isvUGRWqJuluZ6L8A== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 59cbb6b8-98ef-4a5b-17ea-08db818ee29a X-MS-Exchange-CrossTenant-AuthSource: IA0PR10MB7255.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jul 2023 21:44:49.1918 (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: ydC3sMDdzkdV5jKIrbivb7Mk54H6bkP80K4cxVJdj+dbqyPf4qLXUC1XIovcQX4VTEixvUcT7de3sOcS1yo5luER02kCvFs0G6P/frSkRtU= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN0PR10MB5080 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26 definitions=2023-07-10_16,2023-07-06_02,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 mlxlogscore=999 adultscore=0 mlxscore=0 spamscore=0 phishscore=0 malwarescore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2305260000 definitions=main-2307100198 X-Proofpoint-ORIG-GUID: u80hIwsO33cW8o7IgzqMXCsUxSV8kSQP X-Proofpoint-GUID: u80hIwsO33cW8o7IgzqMXCsUxSV8kSQP Precedence: bulk List-ID: X-Mailing-List: target-devel@vger.kernel.org In some cases, like with multiple LUN targets, it can be better to defer the cmd submission to a helper thread, because if the backend driver blocks on something like request/tag allocation it can block the entire submission path for all LUNs. In other cases like single LUN targets with fast storage that can support all the commands that the target can queue, then it's best to submit the cmd to the backend from the target's cmd recv context. The next patch will allow the user to config what they prefer, but drivers like loop can't directly submit because they can be called from a context that can't sleep. And, drivers like vhost-scsi can support direct submission, but need to keep their default behavior of deferring execution to avoid perf regressions for the multiple LUN case. This patch has the drivers tell LIO core if they support direct submissions and their current default, so in the next patch we can prevent users from misconfiguring the system and initialize devices correctly. Signed-off-by: Mike Christie --- drivers/infiniband/ulp/srpt/ib_srpt.c | 3 +++ drivers/scsi/elx/efct/efct_lio.c | 5 +++++ drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c | 3 +++ drivers/scsi/qla2xxx/tcm_qla2xxx.c | 6 ++++++ drivers/target/loopback/tcm_loop.c | 1 + drivers/target/sbp/sbp_target.c | 3 +++ drivers/target/tcm_fc/tfc_conf.c | 3 +++ drivers/usb/gadget/function/f_tcm.c | 3 +++ drivers/vhost/scsi.c | 3 +++ drivers/xen/xen-scsiback.c | 3 +++ include/target/target_core_fabric.h | 10 ++++++++++ 11 files changed, 43 insertions(+) diff --git a/drivers/infiniband/ulp/srpt/ib_srpt.c b/drivers/infiniband/ulp/srpt/ib_srpt.c index c12005eab14c..a7e21d0cca0f 100644 --- a/drivers/infiniband/ulp/srpt/ib_srpt.c +++ b/drivers/infiniband/ulp/srpt/ib_srpt.c @@ -3867,6 +3867,9 @@ static const struct target_core_fabric_ops srpt_template = { .tfc_discovery_attrs = srpt_da_attrs, .tfc_wwn_attrs = srpt_wwn_attrs, .tfc_tpg_attrib_attrs = srpt_tpg_attrib_attrs, + + .default_direct_submit = 1, + .direct_submit_supp = 1, }; /** diff --git a/drivers/scsi/elx/efct/efct_lio.c b/drivers/scsi/elx/efct/efct_lio.c index a982b9cf9870..b7df6fadae9c 100644 --- a/drivers/scsi/elx/efct/efct_lio.c +++ b/drivers/scsi/elx/efct/efct_lio.c @@ -1611,6 +1611,8 @@ static const struct target_core_fabric_ops efct_lio_ops = { .sess_get_initiator_sid = NULL, .tfc_tpg_base_attrs = efct_lio_tpg_attrs, .tfc_tpg_attrib_attrs = efct_lio_tpg_attrib_attrs, + .default_direct_submit = 1, + .direct_submit_supp = 1, }; static const struct target_core_fabric_ops efct_lio_npiv_ops = { @@ -1646,6 +1648,9 @@ static const struct target_core_fabric_ops efct_lio_npiv_ops = { .sess_get_initiator_sid = NULL, .tfc_tpg_base_attrs = efct_lio_npiv_tpg_attrs, .tfc_tpg_attrib_attrs = efct_lio_npiv_tpg_attrib_attrs, + + .default_direct_submit = 1, + .direct_submit_supp = 1, }; int efct_scsi_tgt_driver_init(void) diff --git a/drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c b/drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c index 385f812b8793..d345cf14196e 100644 --- a/drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c +++ b/drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c @@ -3975,6 +3975,9 @@ static const struct target_core_fabric_ops ibmvscsis_ops = { .fabric_drop_tpg = ibmvscsis_drop_tpg, .tfc_wwn_attrs = ibmvscsis_wwn_attrs, + + .default_direct_submit = 1, + .direct_submit_supp = 1, }; static void ibmvscsis_dev_release(struct device *dev) {}; diff --git a/drivers/scsi/qla2xxx/tcm_qla2xxx.c b/drivers/scsi/qla2xxx/tcm_qla2xxx.c index 3b5ba4b47b3b..a005eb4e347a 100644 --- a/drivers/scsi/qla2xxx/tcm_qla2xxx.c +++ b/drivers/scsi/qla2xxx/tcm_qla2xxx.c @@ -1822,6 +1822,9 @@ static const struct target_core_fabric_ops tcm_qla2xxx_ops = { .tfc_wwn_attrs = tcm_qla2xxx_wwn_attrs, .tfc_tpg_base_attrs = tcm_qla2xxx_tpg_attrs, .tfc_tpg_attrib_attrs = tcm_qla2xxx_tpg_attrib_attrs, + + .default_direct_submit = 1, + .direct_submit_supp = 1, }; static const struct target_core_fabric_ops tcm_qla2xxx_npiv_ops = { @@ -1859,6 +1862,9 @@ static const struct target_core_fabric_ops tcm_qla2xxx_npiv_ops = { .fabric_init_nodeacl = tcm_qla2xxx_init_nodeacl, .tfc_wwn_attrs = tcm_qla2xxx_wwn_attrs, + + .default_direct_submit = 1, + .direct_submit_supp = 1, }; static int tcm_qla2xxx_register_configfs(void) diff --git a/drivers/target/loopback/tcm_loop.c b/drivers/target/loopback/tcm_loop.c index 4ec99a55ac30..75804303b175 100644 --- a/drivers/target/loopback/tcm_loop.c +++ b/drivers/target/loopback/tcm_loop.c @@ -1102,6 +1102,7 @@ static const struct target_core_fabric_ops loop_ops = { .tfc_wwn_attrs = tcm_loop_wwn_attrs, .tfc_tpg_base_attrs = tcm_loop_tpg_attrs, .tfc_tpg_attrib_attrs = tcm_loop_tpg_attrib_attrs, + .direct_submit_supp = 0, }; static int __init tcm_loop_fabric_init(void) diff --git a/drivers/target/sbp/sbp_target.c b/drivers/target/sbp/sbp_target.c index 2a761bc09193..1cac139af3e3 100644 --- a/drivers/target/sbp/sbp_target.c +++ b/drivers/target/sbp/sbp_target.c @@ -2278,6 +2278,9 @@ static const struct target_core_fabric_ops sbp_ops = { .tfc_wwn_attrs = sbp_wwn_attrs, .tfc_tpg_base_attrs = sbp_tpg_base_attrs, .tfc_tpg_attrib_attrs = sbp_tpg_attrib_attrs, + + .default_direct_submit = 1, + .direct_submit_supp = 1, }; static int __init sbp_init(void) diff --git a/drivers/target/tcm_fc/tfc_conf.c b/drivers/target/tcm_fc/tfc_conf.c index 6ac3fc1a7d39..e66fd7131da5 100644 --- a/drivers/target/tcm_fc/tfc_conf.c +++ b/drivers/target/tcm_fc/tfc_conf.c @@ -432,6 +432,9 @@ static const struct target_core_fabric_ops ft_fabric_ops = { .tfc_wwn_attrs = ft_wwn_attrs, .tfc_tpg_nacl_base_attrs = ft_nacl_base_attrs, + + .default_direct_submit = 1, + .direct_submit_supp = 1, }; static struct notifier_block ft_notifier = { diff --git a/drivers/usb/gadget/function/f_tcm.c b/drivers/usb/gadget/function/f_tcm.c index 79ed2e6e576a..eb618ff72165 100644 --- a/drivers/usb/gadget/function/f_tcm.c +++ b/drivers/usb/gadget/function/f_tcm.c @@ -1687,6 +1687,9 @@ static const struct target_core_fabric_ops usbg_ops = { .tfc_wwn_attrs = usbg_wwn_attrs, .tfc_tpg_base_attrs = usbg_base_attrs, + + .default_direct_submit = 1, + .direct_submit_supp = 1, }; /* Start gadget.c code */ diff --git a/drivers/vhost/scsi.c b/drivers/vhost/scsi.c index c83f7f043470..ed6cc84c0b85 100644 --- a/drivers/vhost/scsi.c +++ b/drivers/vhost/scsi.c @@ -2461,6 +2461,9 @@ static const struct target_core_fabric_ops vhost_scsi_ops = { .tfc_wwn_attrs = vhost_scsi_wwn_attrs, .tfc_tpg_base_attrs = vhost_scsi_tpg_attrs, .tfc_tpg_attrib_attrs = vhost_scsi_tpg_attrib_attrs, + + .default_direct_submit = 0, + .direct_submit_supp = 1, }; static int __init vhost_scsi_init(void) diff --git a/drivers/xen/xen-scsiback.c b/drivers/xen/xen-scsiback.c index 8b77e4c06e43..fc41f936b84b 100644 --- a/drivers/xen/xen-scsiback.c +++ b/drivers/xen/xen-scsiback.c @@ -1832,6 +1832,9 @@ static const struct target_core_fabric_ops scsiback_ops = { .tfc_wwn_attrs = scsiback_wwn_attrs, .tfc_tpg_base_attrs = scsiback_tpg_attrs, .tfc_tpg_param_attrs = scsiback_param_attrs, + + .default_direct_submit = 1, + .direct_submit_supp = 1, }; static const struct xenbus_device_id scsiback_ids[] = { diff --git a/include/target/target_core_fabric.h b/include/target/target_core_fabric.h index 2a6c4c935666..5b2367c0839e 100644 --- a/include/target/target_core_fabric.h +++ b/include/target/target_core_fabric.h @@ -118,6 +118,16 @@ struct target_core_fabric_ops { * its entirety before a command is aborted. */ unsigned int write_pending_must_be_called:1; + /* + * Set this if the driver supports submitting commands to the backend + * from target_submit/target_submit_cmd. + */ + unsigned int direct_submit_supp:1; + /* + * Set this if the driver wants to default to directly submitting + * commands. + */ + unsigned int default_direct_submit:1; }; int target_register_template(const struct target_core_fabric_ops *fo); From patchwork Mon Jul 10 21:44:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 13307682 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1B9EBEB64D9 for ; Mon, 10 Jul 2023 21:45:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229450AbjGJVo5 (ORCPT ); Mon, 10 Jul 2023 17:44:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45720 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229517AbjGJVoy (ORCPT ); Mon, 10 Jul 2023 17:44:54 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7A381F4; Mon, 10 Jul 2023 14:44:53 -0700 (PDT) Received: from pps.filterd (m0333521.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 36AHqb7e024185; Mon, 10 Jul 2023 21:44: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-2023-03-30; bh=TZcmWkwppHOTgwEw40D5F6qGsMUpTMVQjjTMrBGj/Nw=; b=WWfOskzNpPPzB4oGbf6z+lmvKdkNSt3HJ+izrDWf526Hwl6otf9/E0FjMoNRDEm5nXZs 78sHHbjfGHJfKuj31HatnIf4euBuN1SOJjH4WE/wpF4sT9QQSWVh0v8fILdV4/XYmNky amTuIxapNgK1Y8WHyQ9Y3BKSjN54qxC3gcLRfpuG7JtsJI2Nc9y7qngr3iFs+tDjpfTh KWNxgTQ07MRFMfahypGol72FXoZbqag0g6Rpsv0TLxP2zoIAa83FoiIYfU7CK2XfED4g ENqoEm201cbowRGFRrk2CoDxeR2g6p8FRoDK2sDnud3rLe6TI9T2OjqQFCX30Fs8q4+1 bQ== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3rrgn7sc81-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 10 Jul 2023 21:44:53 +0000 Received: from pps.filterd (phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 36ALJZIh022812; Mon, 10 Jul 2023 21:44:52 GMT Received: from nam10-bn7-obe.outbound.protection.outlook.com (mail-bn7nam10lp2101.outbound.protection.outlook.com [104.47.70.101]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3rpx841rqk-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 10 Jul 2023 21:44:52 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DlD242uME2l07wNImz3eyelxtbebaNEuLov34A999cvBViL0jnAe6kQVJ4dKbBKwz6REyYH4I6u4Qdu5TPwAy+Q3hzUQQkFMmypgeheNawHIZqZzGIB7ype0ttA1yrGmikEtGtjFXJfWgBsk4sI3Sv+mrzuusjgA9L5Nxo1hrnZD7lsRmvMAafqirDxPfNBlOMCYMyBNUpa9QQ8Mc+2wWH0iFG+YB1XctW18TsFKxQDaa/Z8y5d4VnUQTwX2c6Lhfz6VyqFxySauX1nYrjQyw+it50NNTtzG2z7DUx8V5+T8Hp+UdGr6zMsxkzSRfErUDSE1N+A29/Jg+Wxz7VeILg== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=TZcmWkwppHOTgwEw40D5F6qGsMUpTMVQjjTMrBGj/Nw=; b=QB1gPy6DK7lGE8+t7bg+a3EmaKs7HyIE0sXboazcGprP6/4WsSVS6xLXPMEroSjcmutnMUgF/t5SnfbknNHnWKmF2QEkSygY46jSYvYIFoQI9SI9SQBcO2Gqoz4yTOYYXmr8500Q0W9eUPosCHCtJmNA68ryCDCWyukuyZbDejgYg+hfRknLJ9qlsq3Uho6xPhpZvIH/ffd3e4mGfRaAH5z/In93aThtnGe/7xlKy7JgiVhyedzRoWc2vFimMY/zydHbyX/MFzUmGEtzKC9UgUNF+wO5P9mbyciPn16C/460L8DvyVOpRrw3GO0mX3PMChHJiw3g+kbpfgZgqyZDew== 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=TZcmWkwppHOTgwEw40D5F6qGsMUpTMVQjjTMrBGj/Nw=; b=F5saBIIQb4QT6PH/9QrnX7k//SKk+Gh9XTr77FQSh+0YVXRf6y+olBmnkVX4HoCqchczQAB2eXMvoRT4j8mTQofEZyicypOJvx0wWIUp3oa4Gjn2Pg7Snwf7x7Q+vgfdsbdDHQ4oRHZW38dfEfR5mkbC+AGfagu0GAvPzTcyfpU= Received: from IA0PR10MB7255.namprd10.prod.outlook.com (2603:10b6:208:40c::10) by BN0PR10MB5080.namprd10.prod.outlook.com (2603:10b6:408:114::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.31; Mon, 10 Jul 2023 21:44:51 +0000 Received: from IA0PR10MB7255.namprd10.prod.outlook.com ([fe80::e2b1:1376:2375:ef71]) by IA0PR10MB7255.namprd10.prod.outlook.com ([fe80::e2b1:1376:2375:ef71%6]) with mapi id 15.20.6565.028; Mon, 10 Jul 2023 21:44:51 +0000 From: Mike Christie To: martin.petersen@oracle.com, linux-scsi@vger.kernel.org, target-devel@vger.kernel.org Cc: Mike Christie Subject: [PATCH 3/5] scsi: target: Allow userspace to request direct submissions Date: Mon, 10 Jul 2023 16:44:40 -0500 Message-Id: <20230710214442.6718-4-michael.christie@oracle.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230710214442.6718-1-michael.christie@oracle.com> References: <20230710214442.6718-1-michael.christie@oracle.com> X-ClientProxiedBy: CH0PR04CA0076.namprd04.prod.outlook.com (2603:10b6:610:74::21) To IA0PR10MB7255.namprd10.prod.outlook.com (2603:10b6:208:40c::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: IA0PR10MB7255:EE_|BN0PR10MB5080:EE_ X-MS-Office365-Filtering-Correlation-Id: 79e75a8d-440d-4d75-9d02-08db818ee3ba X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: dWhqL61kjJmFtez2X0KNV+c5VGw2lhStGgousMYnoHDZ959laTiu/Zvh1khr2gw6zOx50/TkSu/1wQpLlM4M2tSo6WA9RjCOg93GEAv0x7ooUB1XyuDcekY+7Y7yeR8x0kITjCw8wYR33ejouafItTt+11McEqYUuvcEXM37ErhD2hkMguTUCBZ9ZLP2hjXKOBBomH/9VPBpx7FysBCOgxwc69Dnwa4Svd0DNaX7DOm6oS/Vx0jYw8UfuQz1omQUoFWasH7GfPh0Zi4/4p1KLmPeUj05aVSE4AbpG4H66wGpgo0g3VQuJbGULU8zQ1Ep/yk5/YYq17oJUpOZiFH0WmEWBQlz4WtIE4/S89we8M7W3+tbOI4GuYMsHksQvZv2EHRnwf+WNLboIOIy4siMXpM2C8SK9NzuA5MBNmnPGqR899bNN8pCMVAdlgjsoB8CMXV9KSDUzfLVezwQ62fZoo67+MKPPpsaCwywfkx1+iU/7kWkc+L6Ty4YTXOIzqAu1LbnjowfGCNwoLj3LRZfKfs90dvG7ypyvHvRfHdshv8apb5o8VW/UJli/8KvUhmh X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:IA0PR10MB7255.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(396003)(366004)(376002)(39860400002)(136003)(346002)(451199021)(478600001)(6666004)(6486002)(8936002)(83380400001)(8676002)(41300700001)(2906002)(316002)(38100700002)(6512007)(5660300002)(26005)(186003)(86362001)(36756003)(107886003)(2616005)(1076003)(6506007)(66946007)(4326008)(66556008)(66476007)(450100002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-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L6WBcq7omfxLw3+YzKKhb+Z2e35D09+ZBlUFmHSCDo1EXjvaVw7iSTEnBsNNsboM2hWYJ6YTFjygXElxqDDhc7CesFLs5DFgMUTuaAFcvlhshn7OqC7DKpfnb5eLaHlvLbWzJYjXiC6CcsvjUVYHgSImUtXMCKs9sDiCn4hIRVvz3P38a8QukgLCgB3SbP0F2FLzZj0rdpFNammOZQbGS1KqhEelQBY+7sLqaqba4zJiQo7J2qtYPyABgN3FyhJ7hpvwrLe08hptGs4rmVGUzKNmYX0dzRC0qMTEsbROxKrkT1ydpmM6BHzezclP8uz9kZnOXQptmf6zkNp9/uDb6c7H31jbxXywQTErhAWMk5eKXq/jAcokXyVNqo2sfoG46eipJJLR226hD1SqU4/vgpIYlEBO3NC0eeVy+QfIeG13i+1Htdi2NrqLhvYJvejjINOCjRnlqB/0ZUTysCj+R5vK8OlG3LE6dsRbj/jnRijJ+tOdGusexm7n3dPnlDDxG87Thpz88Iwha0cf4idcmipnnfIqGOMr2eQ== X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: B6T4fJoIwSfbXooy16yT0Yv1XDwYKjZlpyKpbYj/aGqLw67JA5qOrp8W+Abz81nxYn+VHgCcyQGFdBYDDMafM0XUaY7nkRI/EtwFBXaqNaIRq6rHp7YTOylYIxcizO1egzDK8OMm2786ysd0wg8rA0ELTZ8MS655Ji94a30BhTZzFmb4X00NvOYWF427oyr9zt0isM1A/5N99J09hVIrAX5MmwFBUovGfHKZt8Vnj5nzkwET07JbppWWkljYkl69eSJMyjQ6dBwRewi9dDYj9/dsiTMm/pL8g8JgBszRjsp8FWR/fyrTclnTpCQomFlrkY3O5QFZCSKtyr6JyUDzp3WzL3gZ1dMYYSbT5CttO8UcaH9orHyHsc4qTQuakKiY4vseRpTvTfo916ycqOoo/1yAOnHwUhRDkRSsyAWbeTu0S7XnbieoetnV5Igu2krFHTxECZT7JC3fhHyG5vwSMwUlzMTJU6AjW3N23glL0tnfqkSTLL4O3atniUfaavShm45xtqRFihza/6I2LqTDEdEXAMUx57XjJEX5oDi6jsy1a1sMwXXUzm7IY+o77tpQrDgHqIiLp2jVi5vT3bBCRJuAF9W9QTN3FE8dFLus/HYymZTJjoJZR73+kvBjzGzcAvDlOQIXP9hBDCdhSBD4IcsWSTug+GGAsV3ZlTnRsYh26MHr0nrmkhT8alx1qWQWoT8IfTBpXuiBJkJzQSd4//n2kJzgRMl1H6Za4ExY3d3812CbxkNQva0NK/9S06INeb0VVTTpjLp6GZq3iQpKaQ== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 79e75a8d-440d-4d75-9d02-08db818ee3ba X-MS-Exchange-CrossTenant-AuthSource: IA0PR10MB7255.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jul 2023 21:44:51.0632 (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: Jf4i2d5FmJLvQJcUazKj8QWLpRteHSbNIrpWlYnw/Up3reb6iakbHfW4KRKrgce1jqcEYBGS0NpPfFjpffMzVMXRfDYwD5AKLN6qSuf/QB0= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN0PR10MB5080 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26 definitions=2023-07-10_16,2023-07-06_02,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 mlxlogscore=999 adultscore=0 mlxscore=0 spamscore=0 phishscore=0 malwarescore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2305260000 definitions=main-2307100198 X-Proofpoint-ORIG-GUID: vtTRgY0StzYrzSBWW94c_STnl8kWFivR X-Proofpoint-GUID: vtTRgY0StzYrzSBWW94c_STnl8kWFivR Precedence: bulk List-ID: X-Mailing-List: target-devel@vger.kernel.org This allows userspace to request the fabric drivers do direct submissions if they support it. When using a nvme drive and vhost-scsi we see around a 20% improvement in 4K IOs: fio jobs 1 2 4 8 10 -------------------------------------------------- defer 94K 190K 394K 770K 890K direct 128K 252K 488K 950K - Signed-off-by: Mike Christie --- drivers/target/loopback/tcm_loop.c | 2 +- drivers/target/target_core_configfs.c | 5 ++++ drivers/target/target_core_device.c | 1 + drivers/target/target_core_transport.c | 33 +++++++++++++++++++++++--- drivers/vhost/scsi.c | 2 +- include/target/target_core_base.h | 5 ++++ 6 files changed, 43 insertions(+), 5 deletions(-) diff --git a/drivers/target/loopback/tcm_loop.c b/drivers/target/loopback/tcm_loop.c index 75804303b175..fbbf80ae9766 100644 --- a/drivers/target/loopback/tcm_loop.c +++ b/drivers/target/loopback/tcm_loop.c @@ -154,7 +154,7 @@ static void tcm_loop_target_queue_cmd(struct tcm_loop_cmd *tl_cmd) GFP_ATOMIC)) return; - target_queue_submission(se_cmd); + target_submit(se_cmd); return; out_done: diff --git a/drivers/target/target_core_configfs.c b/drivers/target/target_core_configfs.c index 936e5ff1b209..e4ddd8882f83 100644 --- a/drivers/target/target_core_configfs.c +++ b/drivers/target/target_core_configfs.c @@ -577,6 +577,7 @@ DEF_CONFIGFS_ATTRIB_SHOW(unmap_granularity_alignment); DEF_CONFIGFS_ATTRIB_SHOW(unmap_zeroes_data); DEF_CONFIGFS_ATTRIB_SHOW(max_write_same_len); DEF_CONFIGFS_ATTRIB_SHOW(emulate_rsoc); +DEF_CONFIGFS_ATTRIB_SHOW(direct_submit); #define DEF_CONFIGFS_ATTRIB_STORE_U32(_name) \ static ssize_t _name##_store(struct config_item *item, const char *page,\ @@ -598,6 +599,7 @@ DEF_CONFIGFS_ATTRIB_STORE_U32(max_unmap_block_desc_count); DEF_CONFIGFS_ATTRIB_STORE_U32(unmap_granularity); DEF_CONFIGFS_ATTRIB_STORE_U32(unmap_granularity_alignment); DEF_CONFIGFS_ATTRIB_STORE_U32(max_write_same_len); +DEF_CONFIGFS_ATTRIB_STORE_U32(direct_submit); #define DEF_CONFIGFS_ATTRIB_STORE_BOOL(_name) \ static ssize_t _name##_store(struct config_item *item, const char *page, \ @@ -1266,6 +1268,7 @@ CONFIGFS_ATTR(, unmap_zeroes_data); CONFIGFS_ATTR(, max_write_same_len); CONFIGFS_ATTR(, alua_support); CONFIGFS_ATTR(, pgr_support); +CONFIGFS_ATTR(, direct_submit); /* * dev_attrib attributes for devices using the target core SBC/SPC @@ -1308,6 +1311,7 @@ struct configfs_attribute *sbc_attrib_attrs[] = { &attr_alua_support, &attr_pgr_support, &attr_emulate_rsoc, + &attr_direct_submit, NULL, }; EXPORT_SYMBOL(sbc_attrib_attrs); @@ -1325,6 +1329,7 @@ struct configfs_attribute *passthrough_attrib_attrs[] = { &attr_emulate_pr, &attr_alua_support, &attr_pgr_support, + &attr_direct_submit, NULL, }; EXPORT_SYMBOL(passthrough_attrib_attrs); diff --git a/drivers/target/target_core_device.c b/drivers/target/target_core_device.c index b7ac60f4a219..b4c3e17ebfc9 100644 --- a/drivers/target/target_core_device.c +++ b/drivers/target/target_core_device.c @@ -779,6 +779,7 @@ struct se_device *target_alloc_device(struct se_hba *hba, const char *name) dev->dev_attrib.unmap_zeroes_data = DA_UNMAP_ZEROES_DATA_DEFAULT; dev->dev_attrib.max_write_same_len = DA_MAX_WRITE_SAME_LEN; + dev->dev_attrib.direct_submit = DA_FABRIC_DEFAULT_SUBMIT; xcopy_lun = &dev->xcopy_lun; rcu_assign_pointer(xcopy_lun->lun_se_dev, dev); diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c index 687adc9e086c..5349a2dd8187 100644 --- a/drivers/target/target_core_transport.c +++ b/drivers/target/target_core_transport.c @@ -1781,13 +1781,13 @@ int target_submit_prep(struct se_cmd *se_cmd, unsigned char *cdb, EXPORT_SYMBOL_GPL(target_submit_prep); /** - * target_submit - perform final initialization and submit cmd to LIO core + * __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) +static void __target_submit(struct se_cmd *se_cmd) { struct scatterlist *sgl = se_cmd->t_data_sg; unsigned char *buf = NULL; @@ -1825,6 +1825,33 @@ void target_submit(struct se_cmd *se_cmd) transport_handle_cdb_direct(se_cmd); } + +/** + * target_submit - submit cmd to LIO core or queue it's submission + * @se_cmd: command descriptor to submit + */ +void target_submit(struct se_cmd *se_cmd) +{ + struct se_dev_attrib *da = &se_cmd->se_dev->dev_attrib; + u32 direct_submit; + + if (da->direct_submit == DA_FABRIC_DEFAULT_SUBMIT) { + if (se_cmd->se_sess->se_tpg->se_tpg_tfo->default_direct_submit) + direct_submit = DA_DIRECT_SUBMIT; + else + direct_submit = DA_QUEUE_SUBMIT; + } else if (da->direct_submit == DA_DIRECT_SUBMIT && + se_cmd->se_sess->se_tpg->se_tpg_tfo->direct_submit_supp) { + direct_submit = DA_DIRECT_SUBMIT; + } else { + direct_submit = DA_QUEUE_SUBMIT; + } + + if (direct_submit == DA_DIRECT_SUBMIT) + __target_submit(se_cmd); + else + target_queue_submission(se_cmd); +} EXPORT_SYMBOL_GPL(target_submit); /** @@ -1922,7 +1949,7 @@ void target_queued_submit_work(struct work_struct *work) se_plug = target_plug_device(se_dev); } - target_submit(se_cmd); + __target_submit(se_cmd); } if (se_plug) diff --git a/drivers/vhost/scsi.c b/drivers/vhost/scsi.c index ed6cc84c0b85..e2603eb1b638 100644 --- a/drivers/vhost/scsi.c +++ b/drivers/vhost/scsi.c @@ -772,7 +772,7 @@ static void vhost_scsi_target_queue_cmd(struct vhost_scsi_cmd *cmd) cmd->tvc_prot_sgl_count, GFP_KERNEL)) return; - target_queue_submission(se_cmd); + target_submit(se_cmd); } static void diff --git a/include/target/target_core_base.h b/include/target/target_core_base.h index 159567359bbb..4f37324ada5d 100644 --- a/include/target/target_core_base.h +++ b/include/target/target_core_base.h @@ -103,6 +103,10 @@ #define DA_IS_NONROT 0 /* Queue Algorithm Modifier default for restricted reordering in control mode page */ #define DA_EMULATE_REST_REORD 0 +/* Command submission settings */ +#define DA_FABRIC_DEFAULT_SUBMIT 0 +#define DA_DIRECT_SUBMIT 1 +#define DA_QUEUE_SUBMIT 2 #define SE_INQUIRY_BUF 1024 #define SE_MODE_PAGE_BUF 512 @@ -717,6 +721,7 @@ struct se_dev_attrib { u32 unmap_granularity; u32 unmap_granularity_alignment; u32 max_write_same_len; + u32 direct_submit; struct se_device *da_dev; struct config_group da_group; }; From patchwork Mon Jul 10 21:44:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 13307685 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8C5D8EB64DC for ; Mon, 10 Jul 2023 21:45:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229585AbjGJVpL (ORCPT ); Mon, 10 Jul 2023 17:45:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45738 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229591AbjGJVpD (ORCPT ); Mon, 10 Jul 2023 17:45:03 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9376CE0; Mon, 10 Jul 2023 14:44:56 -0700 (PDT) Received: from pps.filterd (m0246629.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 36AJov8a005792; Mon, 10 Jul 2023 21:44: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-2023-03-30; bh=anQEW8blyeriNRm/Tg1WF0CZEElPTk1mRGx8P5qa3Wg=; b=eWQbFJvhmNWHqkRtgi8FAfAu73ri8b59j4DxHK9tGtJGRFnbMVNjjx1Z3yYwYAafu19A w4yv67M3JO8uGQNhfRK/7PaHY2qlR05rdqv3lBJTM7kdNpapkhKm+fNS8w7cvTZSVot9 t4L8wrSsBpVEXo+vji4pnSr/RSbPaO+x6uyuU8LqKoFm4Eq8uX5NUZMlxsWR+eFXpAzT OPINAjr7NIpeYPkyy1DZ/idJIcebaB/JJp5L4K0gH/CtlRWFuvEQkJ3F6STev3h16fQZ nP5bY+PKqZgW1b5rDCcVjz0+hKEYr2Oriw6girHkznAyOvt5dYS3xFz277DZc6T0Hvx6 Fw== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3rrjmh94gn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 10 Jul 2023 21:44:56 +0000 Received: from pps.filterd (phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 36ALO3nU022877; Mon, 10 Jul 2023 21:44:55 GMT Received: from nam10-bn7-obe.outbound.protection.outlook.com (mail-bn7nam10lp2101.outbound.protection.outlook.com [104.47.70.101]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3rpx841rrj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 10 Jul 2023 21:44:55 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VsTowHiJmJx3ac+5QLoA6rUSI8h/wZEz9uVSv2w369+DLHYgKVo9L7UAM1SDkk6kGDqd2UXGnmt76qQsMH2n66Dm/b5hFPQyD0oVXFZ3QEXWRhQryi7HA9kOpZgU/KdNWKtZF4FRk/vdfeZICs02hkJDMM51n8wzcwRKFurEGQ6Xo5kx5RtiHrlDDhUJ75DjSJV747Q/bWIl6N9c1KHxItucdrE2lCkxoWj2LjfHxjG3uScSZD4lB1vlL39cwY02dQDfd9YdNUdQ+2QCTxCN92pj25fiZQ9hZvfF+Q9oyrFKjA8DHMY63WnOAF5Te7gzu4gqdXQAmGM6oMcpyUxO7A== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=anQEW8blyeriNRm/Tg1WF0CZEElPTk1mRGx8P5qa3Wg=; b=ku1NBjLixEQIdaPATZ64XTL/ZO4I2wpBJ/F8jbVLu7AmUe4iadQNs45wmWpPgmMnB9C5dzKjfzWtO3+4ldMsWj+b+ya67Me2dQU9Ev5BoXbEmyxYrVMFI3095M4rt26lwv8uKVyom6IxQFR9TvskZtJBR+/1mqJmaGmNAca2VDwWx9wCzrSfE0S8HPWxSYSAOd8CyJe4kpv0kn5pO5JeuvIpkqA746YqYy3cSfEyUOJu77u61FZwS73cDzletLY5rATxRZNcPws4R9uwEOdxyAEJfSU34ljg79AyEx6r0W/MRuElyVDHf4RfFIC3jc2holvkGHqJqiRos32xzx1CqQ== 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=anQEW8blyeriNRm/Tg1WF0CZEElPTk1mRGx8P5qa3Wg=; b=rfli7PuCQW18ccp6ZwFw6ibsrreOcsDI2CTfBqjhiZzfns0TJe2/52C0UvPk5y8KxN1AZ9ENX1VX2/ao/HxoHZyN9xkPzBuVdXosF8O5D3PLWPbybNG2ehg5saOLfBPApNwCHsxHLXIxy125qyvDdeZJxnn2G8fpBQjuYyjxE+w= Received: from IA0PR10MB7255.namprd10.prod.outlook.com (2603:10b6:208:40c::10) by BN0PR10MB5080.namprd10.prod.outlook.com (2603:10b6:408:114::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.31; Mon, 10 Jul 2023 21:44:53 +0000 Received: from IA0PR10MB7255.namprd10.prod.outlook.com ([fe80::e2b1:1376:2375:ef71]) by IA0PR10MB7255.namprd10.prod.outlook.com ([fe80::e2b1:1376:2375:ef71%6]) with mapi id 15.20.6565.028; Mon, 10 Jul 2023 21:44:53 +0000 From: Mike Christie To: martin.petersen@oracle.com, linux-scsi@vger.kernel.org, target-devel@vger.kernel.org Cc: Mike Christie Subject: [PATCH 4/5] scsi: target: Unexport target_queue_submission Date: Mon, 10 Jul 2023 16:44:41 -0500 Message-Id: <20230710214442.6718-5-michael.christie@oracle.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230710214442.6718-1-michael.christie@oracle.com> References: <20230710214442.6718-1-michael.christie@oracle.com> X-ClientProxiedBy: CH0PR03CA0232.namprd03.prod.outlook.com (2603:10b6:610:e7::27) To IA0PR10MB7255.namprd10.prod.outlook.com (2603:10b6:208:40c::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: IA0PR10MB7255:EE_|BN0PR10MB5080:EE_ X-MS-Office365-Filtering-Correlation-Id: 50795320-6b82-441c-abdc-08db818ee4e4 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: TliOKdy9J+fKJtd5kfRbJu8fqb2bXu+5Cov++KgWT3QaxoTOuRdrpmJudjLbsnbWBx9IqiI/MNM4S7fEoqs7tzrsCQL0mOXX3OnLc6w50i2x5fV26TF4IshPIGLY73IeaqN6bM9CNBWO5djKoSpLaWJN5yGUkZ5EvAGLrIc5xxVfdzoYdctSs4GqlEEQFFOu3IcXng5pk/8zwVUpBYIoXzd0MMThQpZkudFBoZcIEY5lqRUAE5Nj8eljWkZQw9nQf/Vj1pk4kbiTPfo5ikqTseHlcYolRNh52D1+oTeOTIicuJkK7OEDj6pZPklGZt890tjPzxjhjD4XQJfgwn/0rHiW9KYyzQfTPXTJzWhSQER+sT2MeBZjUA4onXWN6mxUyubS8zh2bdES67okH5dfkVIgEZq8V2Do3c7AZG9behO45EUGRDlcvudKSZRW4zFlIYxb4wU/TS+0sSWFqqZQqqZCf5j6mMJOWpdC2tlKfwb3x9dnHYUk0sWmpH2QUjq6TPMh1KC5sSEi7PgDE4RMHUy0sYczCm108Ht3xQurXWZ+OP4ms/GtA6Lqj+Me5dq5 X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:IA0PR10MB7255.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(396003)(366004)(376002)(39860400002)(136003)(346002)(451199021)(478600001)(6666004)(6486002)(8936002)(83380400001)(8676002)(41300700001)(2906002)(316002)(38100700002)(6512007)(5660300002)(26005)(186003)(86362001)(36756003)(107886003)(2616005)(1076003)(6506007)(66946007)(4326008)(66556008)(66476007)(450100002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-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xi4y4YFzJb6RZ3YrNKbWJ0xiOLys0npxWM/Ma0w5qindFW8seFu1Czoe8Dw5K2iDBrzHZat3TqY/+sjPdW1AcBLfWmiBegtb1vBqNppVWVNErQVUZ5+/wsqvnekzm11WhB/+zSmE0bfDYgOxtuUWmGzf0/Lz4ThCwcFYD1IalTNY86wqK/brw/Eol+NPUpySJKf3e4DfiZNDEB4JPKuRJRVwUX5VJCCZ5o6veslWTtyGySMCT9gVm3gNrMVfRmm3JkjAposTfupadxjw8QpqOq4VBdgQ/gZkyutZz6SNWsgaSvV2vlp15x0SYlPYE4Yhs+10fLNgwDf4QB1BHvs2U97I6sgxEVfg== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 50795320-6b82-441c-abdc-08db818ee4e4 X-MS-Exchange-CrossTenant-AuthSource: IA0PR10MB7255.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jul 2023 21:44:53.0627 (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: aZtWbmdZez7uyx+W7Az+bHBB+wos1cSZ2oOMmhw33muXWeijCA67fKIn0XkVCyS33srEMxtPv4tonGRMSygrXYtRxv/Hp6FMjfGOyowQ9Zk= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN0PR10MB5080 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26 definitions=2023-07-10_16,2023-07-06_02,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 mlxlogscore=999 adultscore=0 mlxscore=0 spamscore=0 phishscore=0 malwarescore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2305260000 definitions=main-2307100198 X-Proofpoint-ORIG-GUID: CWQPMWpUBkOsrLMfnW-_YFpQJuHLZvI_ X-Proofpoint-GUID: CWQPMWpUBkOsrLMfnW-_YFpQJuHLZvI_ Precedence: bulk List-ID: X-Mailing-List: target-devel@vger.kernel.org target_queue_submission is not called by drivers anymore so unexport it. This moves target_submit to before target_queue_submission so we can easily call it. It does not change any behavior. Signed-off-by: Mike Christie --- drivers/target/target_core_transport.c | 59 +++++++++++++------------- include/target/target_core_fabric.h | 1 - 2 files changed, 29 insertions(+), 31 deletions(-) diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c index 5349a2dd8187..701ca3593599 100644 --- a/drivers/target/target_core_transport.c +++ b/drivers/target/target_core_transport.c @@ -1826,34 +1826,6 @@ static void __target_submit(struct se_cmd *se_cmd) transport_handle_cdb_direct(se_cmd); } -/** - * target_submit - submit cmd to LIO core or queue it's submission - * @se_cmd: command descriptor to submit - */ -void target_submit(struct se_cmd *se_cmd) -{ - struct se_dev_attrib *da = &se_cmd->se_dev->dev_attrib; - u32 direct_submit; - - if (da->direct_submit == DA_FABRIC_DEFAULT_SUBMIT) { - if (se_cmd->se_sess->se_tpg->se_tpg_tfo->default_direct_submit) - direct_submit = DA_DIRECT_SUBMIT; - else - direct_submit = DA_QUEUE_SUBMIT; - } else if (da->direct_submit == DA_DIRECT_SUBMIT && - se_cmd->se_sess->se_tpg->se_tpg_tfo->direct_submit_supp) { - direct_submit = DA_DIRECT_SUBMIT; - } else { - direct_submit = DA_QUEUE_SUBMIT; - } - - if (direct_submit == DA_DIRECT_SUBMIT) - __target_submit(se_cmd); - else - target_queue_submission(se_cmd); -} -EXPORT_SYMBOL_GPL(target_submit); - /** * target_submit_cmd - lookup unpacked lun and submit uninitialized se_cmd * @@ -1960,7 +1932,7 @@ void target_queued_submit_work(struct work_struct *work) * target_queue_submission - queue the cmd to run on the LIO workqueue * @se_cmd: command descriptor to submit */ -void target_queue_submission(struct se_cmd *se_cmd) +static void target_queue_submission(struct se_cmd *se_cmd) { struct se_device *se_dev = se_cmd->se_dev; int cpu = se_cmd->cpuid; @@ -1970,7 +1942,34 @@ void target_queue_submission(struct se_cmd *se_cmd) llist_add(&se_cmd->se_cmd_list, &sq->cmd_list); queue_work_on(cpu, target_submission_wq, &sq->work); } -EXPORT_SYMBOL_GPL(target_queue_submission); + +/** + * target_submit - submit cmd to LIO core or queue it's submission + * @se_cmd: command descriptor to submit + */ +void target_submit(struct se_cmd *se_cmd) +{ + struct se_dev_attrib *da = &se_cmd->se_dev->dev_attrib; + u32 direct_submit; + + if (da->direct_submit == DA_FABRIC_DEFAULT_SUBMIT) { + if (se_cmd->se_sess->se_tpg->se_tpg_tfo->default_direct_submit) + direct_submit = DA_DIRECT_SUBMIT; + else + direct_submit = DA_QUEUE_SUBMIT; + } else if (da->direct_submit == DA_DIRECT_SUBMIT && + se_cmd->se_sess->se_tpg->se_tpg_tfo->direct_submit_supp) { + direct_submit = DA_DIRECT_SUBMIT; + } else { + direct_submit = DA_QUEUE_SUBMIT; + } + + if (direct_submit == DA_DIRECT_SUBMIT) + __target_submit(se_cmd); + else + target_queue_submission(se_cmd); +} +EXPORT_SYMBOL_GPL(target_submit); static void target_complete_tmr_failure(struct work_struct *work) { diff --git a/include/target/target_core_fabric.h b/include/target/target_core_fabric.h index 5b2367c0839e..77f69b75e851 100644 --- a/include/target/target_core_fabric.h +++ b/include/target/target_core_fabric.h @@ -183,7 +183,6 @@ sense_reason_t target_cmd_init_cdb(struct se_cmd *se_cmd, unsigned char *cdb, sense_reason_t target_cmd_parse_cdb(struct se_cmd *); void target_submit_cmd(struct se_cmd *, struct se_session *, unsigned char *, unsigned char *, u64, u32, int, int, int); -void target_queue_submission(struct se_cmd *se_cmd); int target_submit_tmr(struct se_cmd *se_cmd, struct se_session *se_sess, unsigned char *sense, u64 unpacked_lun, From patchwork Mon Jul 10 21:44:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 13307684 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B5959EB64DA for ; Mon, 10 Jul 2023 21:45:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229538AbjGJVpF (ORCPT ); Mon, 10 Jul 2023 17:45:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45746 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229590AbjGJVpD (ORCPT ); Mon, 10 Jul 2023 17:45:03 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AB70B11B; Mon, 10 Jul 2023 14:44:58 -0700 (PDT) Received: from pps.filterd (m0246631.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 36AK66on002883; Mon, 10 Jul 2023 21:44:58 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-2023-03-30; bh=rEv0onX3fW5jMnxA3neUiq/z5bDsGdbzPE+gq+sG0lk=; b=wtFt6OvJScY+EE1kh0HDh4PZETSrxXrRWvT5LXxtWEIrdqlX75/x3JjLwFyo/ygDuc6u iT8bPfqTbmVOxUVpvq5WjXQXK3UVHvkT8l9oDvBpxVD9eul4aHnzKRhsDXHzQr+I6RpS la7QCTnd+s/WVxeGwlhE5MSaOLgTYyt+MwjGMzvFc17Wq2WqpuCj/b3Bfti7EZXxr6Wi nto8Dj1D6IUGvSE9u8OtFnuQEjjZKc/pozjLzLjnjMe6v34cQDYAE86MrCRiRIDcvcO7 qn/rMVyrhpYhGqPNoUyvfDy7LmQXLfDg4TpmF0VLPIkwuAbRa3Ug9H1xsmtuN7WYvZsc SA== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3rr8xuj0vd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 10 Jul 2023 21:44:57 +0000 Received: from pps.filterd (phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 36ALBLIr035522; Mon, 10 Jul 2023 21:44:56 GMT Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2106.outbound.protection.outlook.com [104.47.55.106]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3rpx841g2t-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 10 Jul 2023 21:44:56 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jOkArik3Zk4od41rS9v8pRilSFpKNKb25PMYORJ89C+OH6QVJX2kpUH3zbDkaimhT/ybmLLcoTtWHxO+tLEXv+Lo9FlPZug4DUm2WJZFy+ihjW6a97DeC9xCnU4uW+lbAdrHLclr7q+wwdUIBGCmvO5ksuqEp3s0M2bqWMw2pCaeOO/t2tqdZJnbAPZy9o98/3Bm3xkw89NE3b50PKh0XxjynTm/YrgPy3FUGA0uRLo0FSoO1tquX205xFQcCWCdy+J9MgS2BrBzCrqG6EQu1Aq5J+pxjBRQ/PN7SLEqEUIxryy4Qav/0Ha7CsxAPx1dfOWhS5e6sq0vsuJ83wqY0w== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=rEv0onX3fW5jMnxA3neUiq/z5bDsGdbzPE+gq+sG0lk=; b=g2qPb3w3Bl1IRe6u3eyWcFv409UrtTK3ilhOh0OUAy5n/e9+ATwbel6bG/YOuktYDdTLqR9V+E1jrvSOJkIc1BQy/pq7z7vAvC9LFeE4cVDmR5BkKhu+cjRaDmvmeOAmD93OdNXMlTx/cJa6ZH6+FiwXyLMiMTNaUGBnSchhkp+Dwo0OSYOT2/7wQe2Te6Q0ZhZtZGerbRvqXy1/my9iWSB15p9bd+MUOgIF0b7v80CKFIo0UIoRntmqJiOzsE4v14eIjm/0aKQJkC2wlO/NL68XRPkKiJ2umk5TyUtQXQ16SdBpGzPjxzebNizNywA7yKHUBSHwcc/LqCdCwVhbVQ== 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=rEv0onX3fW5jMnxA3neUiq/z5bDsGdbzPE+gq+sG0lk=; b=BPFb/+AGVVpDVb46Ll89XSTmtBOTEWihgjCeNi9Vpv+lhynp50FAu7PZNiIehtCKB/lNJN1xA7pe77aCCJ8gvN89oF8TdyrD157dgWIEE5Qx5QQon0vOZ1PJ+SEBzlK4QdKmZSEqgYTN7SFZC8l53M+qDSETED1Ydn3Ehli396M= Received: from IA0PR10MB7255.namprd10.prod.outlook.com (2603:10b6:208:40c::10) by BN0PR10MB5080.namprd10.prod.outlook.com (2603:10b6:408:114::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.31; Mon, 10 Jul 2023 21:44:55 +0000 Received: from IA0PR10MB7255.namprd10.prod.outlook.com ([fe80::e2b1:1376:2375:ef71]) by IA0PR10MB7255.namprd10.prod.outlook.com ([fe80::e2b1:1376:2375:ef71%6]) with mapi id 15.20.6565.028; Mon, 10 Jul 2023 21:44:54 +0000 From: Mike Christie To: martin.petersen@oracle.com, linux-scsi@vger.kernel.org, target-devel@vger.kernel.org Cc: Mike Christie Subject: [PATCH 5/5] scsi: target: Export fabric driver direct submit settings Date: Mon, 10 Jul 2023 16:44:42 -0500 Message-Id: <20230710214442.6718-6-michael.christie@oracle.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230710214442.6718-1-michael.christie@oracle.com> References: <20230710214442.6718-1-michael.christie@oracle.com> X-ClientProxiedBy: CH2PR02CA0011.namprd02.prod.outlook.com (2603:10b6:610:4e::21) To IA0PR10MB7255.namprd10.prod.outlook.com (2603:10b6:208:40c::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: IA0PR10MB7255:EE_|BN0PR10MB5080:EE_ X-MS-Office365-Filtering-Correlation-Id: a4f7c69e-6255-4099-936c-08db818ee607 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: bZDr+SOhEJmhmDtWI23SC0fdkr5XZq3/UULdsKTb7LeA9NSSHNU6j251scB8dArqkQASamUkoZBEI46+ZMwAbt+rgzP70+sDaheCcsTECag/rXzhQKRXKdc49yckGJdbU1YBsDkAG19M9dvcRxu7hhHsDaMMmxE8cq7c2wYuSVm3St+RmtxCBOm05J430Cqt7ua5XkKlXHYh8rQ0fkBhfy74pGwTmYoLRArzh1sEv7UWKKHYJoe6JxfytePuelaboC+wXLM0n98xFinbl9PBso6TnFNXjEknAYyuK3pRg9SEplz8ByJITlmPhhH1SjovEaDjA8molCAjVCmEp/tpuKhir8saMIxJkNWZWUg5xMo069QQHKW7Mxat1FsHKwra8aNCJAPK1ag9BnEUOwxXEHGNFs2aZCpM97sXSRpNjdEVcS414V+PjAADvAv8BM15INoOpx22Z7VFv+jfYTiHbMpwuH9uCe6xJHhVdvb6YUyfdzZuEmrm2B1pQrmE1Zu656JwvQ0dWeM3OD2HB+PRH8vzurAhmHFoOKcyfhL2ChnyhvUuMMRh44jaM0Qw7igQ X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:IA0PR10MB7255.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(396003)(366004)(376002)(39860400002)(136003)(346002)(451199021)(478600001)(6666004)(6486002)(8936002)(8676002)(41300700001)(2906002)(316002)(38100700002)(6512007)(5660300002)(26005)(186003)(86362001)(36756003)(107886003)(2616005)(1076003)(6506007)(66946007)(4326008)(66556008)(66476007)(450100002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Uri2svEyNGvAewRIovQWiQQlo6eVUIDBfF1GjB7F2KIhLE2gCTrYjrcjfCefQNVHhntIrRAZ7JglHuFhabBujGbirQZEgk1bEM5QGKIMPWQob4o9jnUbQzsI6amHQykQB2siz+AlsLf7+PxhsJ8r+2jqPiHaEQeTJlp0BFdXie+iGLptpkPzkxUuBUxFWQEuR/MVlPyEhGXCa/69oL29Z2Vzj53MoKD7kAUTVxAUuWVMWvvO39UaG71QcY6lvWC5FG3klnMSVoXxZIGsPrwIkELIR4EZNR4B3JLLaS+4B5S3R+8J+IhDxTW3jlOneiWL9oyRiq4zrsRKfn+1uX+wg6ebcfRpQg11WNvjNDRRVevw0pGzo+4TCne3qo2hh8JSvsicyRD8zTq4npQZ/kBohmFdFBfv+dDJMspcbfSmIThyyWYrkd/QAVZSYm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GQ6ThJ3BIIPzuqJxWhXrVEB+fv1gFK576tHryd4ZcBNGFuy6JhLF61Vl/CP8f7YEELfDdpTHAkcJ+gQ== X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: 5nCGWM2mhU+SoGPr1M3nodJ48cadBH+8Z4/SXxAaDuFATq16mqUexpWXqWqKMoFqoz/yEuePRlenk8QE9xIlc0oiO8o/+EstMjf1QPonX1g8JQX7ZPpToV7tKq+byzoeu+pTZmYxCJsP+rJN3AiCkp+3IrYBxERxXmoxuDREyOOOYqVFLzcajf4go5aOVxt2pnklPmvZXdAZj8FTpMle7o4g5w1P8uI/ACHAos5Ko47hjOqamRQJIX6alcOAMG9tltMzX3DgYHehFUcjjMiE2hdSEu3w1e0ENSUD5t8wD4JSkO/yPZM3VYPzGJW9tCXg5n3/KK1fr+qYwb86PQTK9aXG1uPTsj3KJshjaBmycS554HAdtxiAaD5rgIHv3VJURjMbJZdDgvH5GdQLrpPcf4x1GsJm4reyCT6pJle7qApX/w4QODQzQn0Y2LaqrnKMDv4SgnAPCg/WC+l3+BxqZ8APwO9l5q+i4/vYrPvJaZplHhYludodrsi3e2NkNstTvR5qONDn3WMyG7VNbIRHVv8qF3K2efiHhOdaY8eWmMD9On/WH2j/PAZrWYu91huFhi7nrZ2lxzw85K/YUWPtEzHRd9jyF+Q8jm/O4BOnCP2XK028EpwcM18mDhUXOiESM8Ex/PXWIPo5amz6Z0xeTGQy2lrwDuPxbSRh8+TOEknIkSbZrtGHqVQ+at7IprLkjgS7JOmmgct2sB2noSxZaKNEWFoyhh1RvPQ8coLdCYSC7jFJLezLGDSjH3eJaKzbSex0z0LJ0CzINoMJ0BG7Hg== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: a4f7c69e-6255-4099-936c-08db818ee607 X-MS-Exchange-CrossTenant-AuthSource: IA0PR10MB7255.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jul 2023 21:44:54.9565 (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: h1WI7Cz3P62dcJ1rDBoyhrD+pYRsiMq6ZVMdoVjCZMag3OZ5dYMEEPwqyixxBW9p9fLwXMCQiKIFSeCpHXiGroT1vaFh+z5x36L94kQINds= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN0PR10MB5080 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26 definitions=2023-07-10_16,2023-07-06_02,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 mlxscore=0 bulkscore=0 suspectscore=0 spamscore=0 phishscore=0 mlxlogscore=999 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2305260000 definitions=main-2307100198 X-Proofpoint-GUID: NepdpNVmOBNZpHteInS2gnPOSaMyMRK6 X-Proofpoint-ORIG-GUID: NepdpNVmOBNZpHteInS2gnPOSaMyMRK6 Precedence: bulk List-ID: X-Mailing-List: target-devel@vger.kernel.org This exports the fabric driver's direct submit settings, so users know what the driver supports. It will be helpful when they are exporting a device through different targets and one doesn't support direct submission. Signed-off-by: Mike Christie --- drivers/target/target_core_fabric_configfs.c | 22 ++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/drivers/target/target_core_fabric_configfs.c b/drivers/target/target_core_fabric_configfs.c index b7c637644cd4..6fd6a9135dca 100644 --- a/drivers/target/target_core_fabric_configfs.c +++ b/drivers/target/target_core_fabric_configfs.c @@ -1065,8 +1065,30 @@ target_fabric_wwn_cmd_completion_affinity_store(struct config_item *item, } CONFIGFS_ATTR(target_fabric_wwn_, cmd_completion_affinity); +static ssize_t +target_fabric_wwn_default_to_direct_submit_show(struct config_item *item, + char *page) +{ + struct se_wwn *wwn = container_of(to_config_group(item), struct se_wwn, + param_group); + return sprintf(page, "%u\n", wwn->wwn_tf->tf_ops->default_direct_submit); +} +CONFIGFS_ATTR_RO(target_fabric_wwn_, default_to_direct_submit); + +static ssize_t +target_fabric_wwn_direct_submit_supported_show(struct config_item *item, + char *page) +{ + struct se_wwn *wwn = container_of(to_config_group(item), struct se_wwn, + param_group); + return sprintf(page, "%u\n", wwn->wwn_tf->tf_ops->direct_submit_supp); +} +CONFIGFS_ATTR_RO(target_fabric_wwn_, direct_submit_supported); + static struct configfs_attribute *target_fabric_wwn_param_attrs[] = { &target_fabric_wwn_attr_cmd_completion_affinity, + &target_fabric_wwn_attr_default_to_direct_submit, + &target_fabric_wwn_attr_direct_submit_supported, NULL, };