From patchwork Thu Sep 28 02:09:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 13401871 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 6AF39E810DF for ; Thu, 28 Sep 2023 02:09:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229493AbjI1CJP (ORCPT ); Wed, 27 Sep 2023 22:09:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55282 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229437AbjI1CJO (ORCPT ); Wed, 27 Sep 2023 22:09:14 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E22A2AC; Wed, 27 Sep 2023 19:09:12 -0700 (PDT) Received: from pps.filterd (m0246632.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 38RL7HFV020994; Thu, 28 Sep 2023 02:09:12 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : content-transfer-encoding : content-type : mime-version; s=corp-2023-03-30; bh=LksiKq3xV5vyyzccUTIyw9eUH1MabWrvGSZxWp1Gg8s=; b=vRqy+xV/sA64wxw74yUF6mpWXyAWQZlSTq08AG0jOqJxZKp/Fflkh11wL0f+0AtkstjM sQdz/7kAs14cyaMJ8P+IstMW5NBsbAFGSwPLMoXattHc9IeDy0E/Y99ZPnoq4nKshgbQ EA2L0rRa+skDo1vTd/QhOjOYKYfojwqG1cn6e8eUasDWy14KloyX/m+WqW1FuLy5yZyG G7Ccj6WhbC9sc0WA4pAmSeVHk6CnjQji+IWEfrcodHRNCQykMkPKihlGGFBKJTfWGhNh 7m9emp2f96nttxWDDNJw99cC6Sh5ALxKZcG7rsqp4RqDnH1PRlfBx4ngtLJwecO+D9YV NQ== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3t9qmuk384-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 28 Sep 2023 02:09:11 +0000 Received: from pps.filterd (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 38S0kn2n030876; Thu, 28 Sep 2023 02:09:11 GMT Received: from nam02-sn1-obe.outbound.protection.outlook.com (mail-sn1nam02lp2047.outbound.protection.outlook.com [104.47.57.47]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3t9pfeurp9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 28 Sep 2023 02:09:11 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ep670oJDhOB2k/7E1UMPLxJuXdll0ccLdqkeXnd5tzCyMnQtl79NiqTIaobAz2PVGfUJIZwPsVH8jzKYPBj6JmOdZUy9aWymVUUg7Nzxid217Ic9+BWlbI6sfvzxjXi3rIqw9jxmlk0t/PRo83BCoe8tKS2W+5Wjga0Bsaa05BpH2mzLOC/zuv6o1YDjwXObaL0pm8RHStYJuvfLeosSqR6gSPHbzlMEswWs3W6prQZA4zLlxICIpZXIRaKN+mXHoUiPoGdjdQYSlWSuK+Vo0B2+1EG2zfltVTBi8KCd6VGT9zsKXoaXhecHpkyTLcSBuOQex4CjcoRbmXMvr1pHPg== 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=LksiKq3xV5vyyzccUTIyw9eUH1MabWrvGSZxWp1Gg8s=; b=m/v1N5lMjB90c8lbmJUgORAOyVW6G6dzEdoJR4wgUMJf5tSk5XmTazPyr67kIs7xbM6RuWx/qkJkPp5k0CQQQh/+BzYqyqTQm+wgJIphF0ZjyAItLq3kSAknjjz4MT9aC7/K4A9Jvy7BFskpaXiujv2oN1VUWTwta2FLDEw3Flx3C5TfcxJOhOcuzO+YyBVvwf0lLd0fRvvCJcawm3r8NmafXC6/49EBEd3iVTKr0JzsCJPZ7eqOlFjAqJsbqzW5rrTUNEVyBrRMn6zkkRgFTDMAaLHnzDKZf0HbC0p7G3ni5GR6GazBuZ1xXMM95wUWiun7yv5f1jQr2digZ2Lo6w== 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=LksiKq3xV5vyyzccUTIyw9eUH1MabWrvGSZxWp1Gg8s=; b=nXsc8Ic/VIpnUYhE54DA9YBUSS06v+CbKtbCxR7bwLFAB8e84yohb1Djp3PQvskya0r0ROXspuWwUA7gaYZnDvuOFy2UFGqEndU7iOH1esxjHu4Q19eAkURl/W1eSJVBoNknpWtx6J6xbroNvym7L59hvUa2H+4DpCecJpSpxus= Received: from CY8PR10MB7243.namprd10.prod.outlook.com (2603:10b6:930:7c::10) by SA1PR10MB5784.namprd10.prod.outlook.com (2603:10b6:806:22a::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6792.28; Thu, 28 Sep 2023 02:09:09 +0000 Received: from CY8PR10MB7243.namprd10.prod.outlook.com ([fe80::37c3:3be:d433:74e8]) by CY8PR10MB7243.namprd10.prod.outlook.com ([fe80::37c3:3be:d433:74e8%6]) with mapi id 15.20.6813.017; Thu, 28 Sep 2023 02:09:09 +0000 From: Mike Christie To: martin.petersen@oracle.com, linux-scsi@vger.kernel.org, target-devel@vger.kernel.org Cc: Mike Christie Subject: [PATCH v2 1/8] scsi: target: Make write_pending_must_be_called a bit field Date: Wed, 27 Sep 2023 21:09:00 -0500 Message-Id: <20230928020907.5730-1-michael.christie@oracle.com> X-Mailer: git-send-email 2.34.1 X-ClientProxiedBy: DS7PR03CA0253.namprd03.prod.outlook.com (2603:10b6:5:3b3::18) To CY8PR10MB7243.namprd10.prod.outlook.com (2603:10b6:930:7c::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY8PR10MB7243:EE_|SA1PR10MB5784:EE_ X-MS-Office365-Filtering-Correlation-Id: d32ca2a8-c9c2-4e97-f1b0-08dbbfc7e66d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: k53T+WK/8gDZKVgB3j66/cG8IZ4kgSQ9eRXxmYxh+beWPDm9Id51Z454T8Rr16uXET+w+uuwC0mAXdXVeecEpz1Nx6yJ9XAe5fmWS9PSYBWGMq1f8KIaHdrPFLhRjPI9DzXyIDgmJooJw6SFIwyuVhr2NKWvp/X4Iu4H5PY8B48hloSgVatxDi6BvAe4I1jvBNYgA4PTZvoBlH95yKkAMb6hCmjh+rAEx9NA+w1ojD3iKwdyGb0936RQ0cS7t9gmXndzKOnr6hpxYbfMbaXIq32mcIdZcudEXyRYwFIZ6dNkBkNPOT2xruTvCTbT2Rt95vToTQ4zW7vW+AyKfeKgioRFknFx9atjm+p3XvkWyIbIIMFKJwfUp29RrGB8ugEHmmG1Gnl7/Z69Ab47B7JgshcYPNrMzCFfr/EJytlatb7Q3n/bdoV8GurTjORpz6dXQWlvD659jszZcoElaKDCpYOVlXt9hqp3wH1RYJGlISEWs7Id7VWHaBudpZ3Zcmth8Oc3qY73dQ6f1/oJrgEaxO+/2AJWwU5DDuTcWFYSyrDgO4Q/pMqfrSEclx8fbeYE X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CY8PR10MB7243.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(39860400002)(136003)(376002)(346002)(396003)(366004)(230922051799003)(64100799003)(451199024)(1800799009)(186009)(6666004)(6506007)(6486002)(83380400001)(2906002)(478600001)(1076003)(5660300002)(4326008)(107886003)(66476007)(8676002)(66556008)(450100002)(66946007)(8936002)(2616005)(41300700001)(316002)(38100700002)(26005)(6512007)(86362001)(36756003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: t6wlwz8KSM8SoqyfsAm2XYtcH2DhWdpz36jrnb1N5MQo9giPSyKic/+CkP4mUqzYuGqBIfrx7AqVlvXdPjgrknw8GpQwHvAycblmvEiq1SLJLT1sy8818m/q1cAjog5sV9GT+JQuGJMeGqX282h+dVviqSgjRS+Y0KesSlDImifAeA7kyw9gg3v7F1t+eegWFc0sdKw4Adhe9MCbiB8LMSnZLYbubYApr2g/xE0t3ftyUiPmVpQVmdWA4CBtXPo+jgNcWQkZnz04XnJmSEvt4neNsZAPEqhWoT/13iKJhXBBwaGjA1DoBzfIOjyLrTwQKdMFgJdl9bIbxPduLD75fbNpovjCF6Phks/bjazL9MsFVDw9+gzEbQe/+H6XFvy1UsQBfovoi6X2/AM0PpGtw5+j9r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oXpOAj4mvyDBTuHh3pv/nVzI0BLBrAjzaRTBV5p2VMXv2Vc9WDmLOuBRMDXFNEI9+BwvdPlkiq/oIsZQGo3dproaXJjxsTihDJi9PFk1CsZzIXa6TdwfOle48LRnExg== X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: tUA1ccVxaR+FHAGOXaRc/e81LyI0VruPVwLXHmYeS+qJWL4bUM7Efx/3ttFIhh8XdmmiTn/xY+f/WagdJ+8MkpXKo9oSiaB+dwPJpcVRJWSziDFZulb25iu4fHCiekZ9Y7GI3mofUMK3zu4GDOsxpzo73G2O3s+EtNcw/RnY80HwksGojCoxqItQHYU771fmXczIMViZcMNW/4odTRbks9K5bmXE6uQy4OIUmUnzXK6kI/OQv3Q66OShm3h5WY1b9KNoCGIfHal+I34VhfaiqpVNySsC+ezRO1QCjx3GsHPHE2mBEnnLJAn7CtCv4aw5tqgrKNrpxlKbQEBFkusWsV46lDtUzv8EUDrH8DseWTYBsdZ8OmLtj6uWMefg7BEW6hBIkOt0LWliCHHMJt8sm4juArRk3Y5wx0WLh4pbF/xBCWTIqdL9mnpIkPM0Xwn6+gzdu8kd2W6HKHMqkjyE0K15SWoEsOnn4nkuxRmC5+5VbKPszka+66341iCZghPmQ5Yc8T5dcdjrE+0OOmByL9dhjeF9Z4PTxP1EDt+8Hj7DnBmE8PFcXTU9dLczrdhdI272FwhFdeBSBocj+w1cYMN/AEeRaUS15bfTKTpItBafsnYfxHnwu4yi2u2TkBTY3F6Q69lSFqQAwlbpYiAEZxEUz+Ir+1wzx8okz4U5YSURfFfVPlnIBTx6G4oJXtTnzM1PqxyxZIEvypfPs/vlUEUlr7I6Ln5GavqEN8f2SbgjXB/QNVpiqMaRywlrtY0WKcIqI9OAJNK/HzTpZqB4oQ== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: d32ca2a8-c9c2-4e97-f1b0-08dbbfc7e66d X-MS-Exchange-CrossTenant-AuthSource: CY8PR10MB7243.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Sep 2023 02:09:08.9616 (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: gcFNekdBGuXki/eL/FMu/8MokGbOwGPK22bUK/ym/AvyRpCIvBf35FxuHvHmI7zKXaqaoIOOVtl01SsXEFmKJnvsIA+CTD1DY3DVzH3xENg= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR10MB5784 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.980,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-09-27_17,2023-09-27_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 spamscore=0 mlxscore=0 malwarescore=0 suspectscore=0 bulkscore=0 mlxlogscore=999 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2309180000 definitions=main-2309280018 X-Proofpoint-GUID: ng8qz8B9s1GkRstYWLep5fr5TIn95jgY X-Proofpoint-ORIG-GUID: ng8qz8B9s1GkRstYWLep5fr5TIn95jgY 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 1cff6052e820..bf190dcb9eee 100644 --- a/drivers/target/iscsi/iscsi_target_configfs.c +++ b/drivers/target/iscsi/iscsi_target_configfs.c @@ -1589,5 +1589,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 Thu Sep 28 02:09:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 13401872 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 50034E80A8A for ; Thu, 28 Sep 2023 02:09:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229719AbjI1CJS (ORCPT ); Wed, 27 Sep 2023 22:09:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46760 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229437AbjI1CJQ (ORCPT ); Wed, 27 Sep 2023 22:09:16 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B7752AC; Wed, 27 Sep 2023 19:09:14 -0700 (PDT) Received: from pps.filterd (m0246632.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 38RL6YER020316; Thu, 28 Sep 2023 02:09:14 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=Kc+/XZ1WWwXyybA4FYsqvs0AntzLGDFrUSw0x9M1Y+o=; b=xzq8WJYi+HJovoQWLN4GUdbgPKMIlr1auqP9DL330nZa2PBfrzCSlvGDdYjRDKMrM4K1 FLGsBzu+tYP2R2xuJpWlPgkW6NiHzsm2jKtLrtsN5hn4B1L/zK3Rlve6CLOUMWKwlmta EGjUbkklVswFRePyaiEZdGlNc4jSGffvHaUexxO3kdt2vT8NPmlGo2ps3RswqcntHRdp xC96oG/JnRc1gsWkgH7dtKc8pKueX1y3Ip2+fIWJbWLLjYn17HnoYLmSxd16OZfwDEYu XCjIAVjC7uLiULpffrN+v/hRKauRWoSBdyP95DFDA6BShHpq+dKwWDhK1K0CuOZHbKuq 7w== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3t9qmuk385-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 28 Sep 2023 02:09:13 +0000 Received: from pps.filterd (phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 38S10Emt034957; Thu, 28 Sep 2023 02:09:12 GMT Received: from nam02-sn1-obe.outbound.protection.outlook.com (mail-sn1nam02lp2048.outbound.protection.outlook.com [104.47.57.48]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3t9pf977xb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 28 Sep 2023 02:09:12 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DmpSiy4NmFb6HjI4/vSSrhiORclTKx+48WrJmfMt3nwtm5cla/1gLX7AQJgAzf38+iI1OY4uhI9Tmhj/BUxul1aCA2zap+OH5mGgTyK868hic424FVZgHknD7EqbjrzoJzKttTu+D2duP+/IRCDBWi4vAarmO/wvHZ6VX/BQhLY6a6IObKRMxKbryjzeuJLBEENdTBQxHHTjWok6sfWg/QTqrcjTEekSWCC/fpnxU5225k/qKSMR3RCunfZlgK8UyAE0kz2WQh6NMr4IhgyRoYLgloEKv0j9aN2bt1LCqDIPcgnLMOHDBl1Dgx2CXig/DE0y24ySc60ChvgJO1kQcQ== 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=Kc+/XZ1WWwXyybA4FYsqvs0AntzLGDFrUSw0x9M1Y+o=; b=kA8tLHLDHvVkrIBkJiwK9M9JGa14dBZcP/wVer0pwE8MOCZXeKKkxeXdY/MihbMpvaMuPGD4dhLI/kXc/B451ia0ZjOvribFCdXOk/SCDCYSwPU05KwjplRDwE+4eSFT62XFn238HEQ08EFuQHXGzKRpCgPNOcfviTBloHNbJMeAYVRYNMlDYVpTVtn8NBJKTMEwHbS3FdRAvwQkVwR1t41PXFU5YZ7ayyQXaZyl4jdVmihDokbJgQEX6miyH9FE5imB+bDg3yEePRSoyxgw9fMhp1s81A6+AnFunAgdbQc4hTQiI0XGzTxqtceqRbiQYGDXeG7RGzAjqgadB2dHLg== 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=Kc+/XZ1WWwXyybA4FYsqvs0AntzLGDFrUSw0x9M1Y+o=; b=Ngh/PXicNMOiIST8tWStTd0TqXQ0c7bYfsWtHGvejDj1S/BRsH9Ep2BdZz8bORxA2GhHCdVzZSJlHL0FrTnGbkKzK2h4EMzknm37VP538kAGZTxwmgRvqWBU6RnzGD4XzZkuneskbFlMai1MxQcjSUcewqzemU1ApiCqWS+UEGY= Received: from CY8PR10MB7243.namprd10.prod.outlook.com (2603:10b6:930:7c::10) by SA1PR10MB5784.namprd10.prod.outlook.com (2603:10b6:806:22a::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6792.28; Thu, 28 Sep 2023 02:09:10 +0000 Received: from CY8PR10MB7243.namprd10.prod.outlook.com ([fe80::37c3:3be:d433:74e8]) by CY8PR10MB7243.namprd10.prod.outlook.com ([fe80::37c3:3be:d433:74e8%6]) with mapi id 15.20.6813.017; Thu, 28 Sep 2023 02:09:10 +0000 From: Mike Christie To: martin.petersen@oracle.com, linux-scsi@vger.kernel.org, target-devel@vger.kernel.org Cc: Mike Christie Subject: [PATCH v2 2/8] scsi: target: Have drivers report if they support direct submissions Date: Wed, 27 Sep 2023 21:09:01 -0500 Message-Id: <20230928020907.5730-2-michael.christie@oracle.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230928020907.5730-1-michael.christie@oracle.com> References: <20230928020907.5730-1-michael.christie@oracle.com> X-ClientProxiedBy: DS7PR03CA0247.namprd03.prod.outlook.com (2603:10b6:5:3b3::12) To CY8PR10MB7243.namprd10.prod.outlook.com (2603:10b6:930:7c::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY8PR10MB7243:EE_|SA1PR10MB5784:EE_ X-MS-Office365-Filtering-Correlation-Id: e5583d2d-33c9-4ebd-28fb-08dbbfc7e761 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 2/v491z20gm6ZC05X0ghPInbghYgKJCroZUrBh566QVU6R4nyn2sRJt4+cVQPErQmm8fr5snZ+7+7tAD9fopusLYwjTpmxzOeG6rLGpP5H2VhRefl4AqPqI7o7bIPXJn7QMzCkCMtyOSNPJ9l70X6b5byCU2cfNi5mfndNTnUjt9Xvxe/6KCTX1nx9WavF2+C22xtW4AdnYuv4073drzNF/mUff5ZYOilWLJb+PqcHFQPRRHWA4yQ/L4uve/d1FvIABhaGfWBYEVwmXWUyIgTrK2Uc1LUAEe1qgQa/7MBuCdRLpctuolw7WennGiObR4V5CnF5rznCQzdcyL09PkltqXyMjy2e7EP4zX32TghRiozAY5w65Cj8Ss6ErT1LmOehC2gH/2R/gEbpzJhmpXIswImc4abQSkEYAn6cO61+yzo/rQs9UNgh9WV4vKhZTDqB/rWz1hE9reYP4+60ku1N6B9hoJxx5cmIbuiTEi6N79TvJV4//rDa/wEHqdISM05ikBUnUKuxV424guhK7FauNyshTeVJKidx703APdS/kZBbeZD5/ovbomUPTgKbpE X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CY8PR10MB7243.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(39860400002)(136003)(376002)(346002)(396003)(366004)(230922051799003)(64100799003)(451199024)(1800799009)(186009)(6666004)(6506007)(6486002)(83380400001)(2906002)(478600001)(1076003)(5660300002)(4326008)(107886003)(66476007)(8676002)(66556008)(450100002)(66946007)(8936002)(2616005)(41300700001)(316002)(38100700002)(26005)(6512007)(86362001)(36756003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: gFQTgLd2j8vTdhMHje+rLaC7SoMf4aY4mwgBnc0IL33eIgdFcGboOUkur5TGiA04PQaWKSlfFFXywxCV44ZgzWCj1T0saRFZ0dtzibIhpZ+BT0BYPvbHkG8ZUUniJ0TMXgXfA4G48lKt89HcxfXTCe6z1+PyLGw5/numnzLnAPSwSXfy7rV0aDgc6O5/8sGEdZ+5gTIcj9fc8yPnznMS7y8vubV7zvsN9JtKpox67cpYwTeO3bYVWWqvYp8N7pD8Pt8xMYQcqEvn6BDLuE4kDc8Hk7ulp8cJfuWb1i46JTz2zu6AK0rWAnELGHl35AzcQwrl59tcGdj+0jRO2reZGOBwrWLhpDD/CTctwubqCmP+4Kc4Z4Lv86of8qslTTTq205hjlC51XdcLrsNNl9xYSHPKTpIwgASD3OUtQNT8wGMRliO9DWEO5jkALRJ6iOv/2o5B1uO4wNLXWdkwKTgcacffJ7QJPOYk4fFU+cj4g/6mqNGnqDvucDrkmwonbvi+4fFo7hxWLwgkhYsxEO6TBNf0j4K3JSAOgOxBM2CzVLJPPfuiH1QkEa9l64rrvXIZ+iEaFD5dlBLsCtlVaRqBCnfaK0Rc+wCODtK1zugjf6f79sXybVhrIRjdlkPd41q9Ngi/1P2BTis20WQR6CWJMIEU/5qYZIhPqhd9qRQgogTztk2DnlS3rm2MgJ4xpOT/qBJjCHJp05ARc2+bZhkZZSBjKaddLeYBsLTMFfxi4JjaPd5vMgJn/zzxSSNgDnB/G/tLh8ZUEHXhSIfKth6k+cuuo4l51sWIVtJpJ9PwdOyRuH0iK/w0sqUw3CovaZwwmhNu6ppAPoVAjWqyG4Hf23V/vOsxUII40d4h2/JyPlENeLGazVk5Zf+Y4L8X8aex8n4+BcxK4bcJPxOJYyYc8ll5+zENuLjqip/TcqJDdDFsLV6rOXVmjs2vMimiw4Sll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R8Yovh6dQOKAs3IL36m3LvmtnVPL/D9GVi1Yl1NwxmI9Z3XCoDWjlMpkblSqcuOBta51PFlAJM6dFjZQTocQbY6dVY8YqExtURIzBm21sjxJADx19MWzSJY9oYw+bQx2W+84tqf6WmtRmKaXjYGlbyWTXf5EeSpMrA15vYoqNePfxKGbPSUgU0i+fMIDANsjrhTPSqpdXhI/kp/eqpAdr8scwHTalM7joBRRHGRvYuhvXJUsxZ8dZ96FqLUPp3QT3jPlvhCbEaLFHRo1gUf3BQfebcoFDmb8SFB0GoyN+bZxQOoR+SoHJW481nnd3/es07KoGBKRoC2PFr/UAVAoOAij1kYs5Uk9NibhcnYnA/hNTzw0/wi5byoMfODoWG3SC2n1IJhBbMFg3X61Iv4UwsCM/uyryHidr6Ek5yGAlc6ACCae2zmMqOSl5slAuS6OkYYneViRWsrjJg== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: e5583d2d-33c9-4ebd-28fb-08dbbfc7e761 X-MS-Exchange-CrossTenant-AuthSource: CY8PR10MB7243.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Sep 2023 02:09:10.5653 (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: WVLzLMn2jl969y1psbEXFNdHSRxAq3csJ2NwtilZTie6DeXD8Ei7na4mdiRKueRxNOGGCytooO5eco58POa4igMYL9VCq6XdY9pEfSaofKk= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR10MB5784 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.980,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-09-27_17,2023-09-27_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 bulkscore=0 mlxscore=0 mlxlogscore=999 suspectscore=0 phishscore=0 adultscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2309180000 definitions=main-2309280018 X-Proofpoint-GUID: yRG0oUBb43mCvYcSKE_hsvQrZta0HAH6 X-Proofpoint-ORIG-GUID: yRG0oUBb43mCvYcSKE_hsvQrZta0HAH6 Precedence: bulk List-ID: X-Mailing-List: target-devel@vger.kernel.org In some cases, like with multiple LUN targets or where the target has to respond to transport level requests from the receiving context it can be better to defer cmd submission to a helper thread. If the backend driver blocks on something like request/tag allocation it can block the entire target submission path and other LUs and transport IO on that session. In other cases like single LUN targets with 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 receiving context. The next patches 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 possible regressions where the backend can block. 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/iscsi/iscsi_target_configfs.c | 3 +++ drivers/target/loopback/tcm_loop.c | 2 ++ 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_base.h | 9 +++++++++ include/target/target_core_fabric.h | 9 +++++++++ 13 files changed, 55 insertions(+) diff --git a/drivers/infiniband/ulp/srpt/ib_srpt.c b/drivers/infiniband/ulp/srpt/ib_srpt.c index c12005eab14c..58f70cfec45a 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_submit_type = TARGET_DIRECT_SUBMIT, + .direct_submit_supp = 1, }; /** diff --git a/drivers/scsi/elx/efct/efct_lio.c b/drivers/scsi/elx/efct/efct_lio.c index a982b9cf9870..6a6ec32c46bd 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_submit_type = TARGET_DIRECT_SUBMIT, + .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_submit_type = TARGET_DIRECT_SUBMIT, + .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..4dc411a58107 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_submit_type = TARGET_DIRECT_SUBMIT, + .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 68a0e6a2fb6e..7e7460a747a4 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_submit_type = TARGET_DIRECT_SUBMIT, + .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_submit_type = TARGET_DIRECT_SUBMIT, + .direct_submit_supp = 1, }; static int tcm_qla2xxx_register_configfs(void) diff --git a/drivers/target/iscsi/iscsi_target_configfs.c b/drivers/target/iscsi/iscsi_target_configfs.c index bf190dcb9eee..88db94f382bb 100644 --- a/drivers/target/iscsi/iscsi_target_configfs.c +++ b/drivers/target/iscsi/iscsi_target_configfs.c @@ -1590,4 +1590,7 @@ const struct target_core_fabric_ops iscsi_ops = { .tfc_tpg_nacl_param_attrs = lio_target_nacl_param_attrs, .write_pending_must_be_called = 1, + + .default_submit_type = TARGET_DIRECT_SUBMIT, + .direct_submit_supp = 1, }; diff --git a/drivers/target/loopback/tcm_loop.c b/drivers/target/loopback/tcm_loop.c index 4ec99a55ac30..fbacccdd2ff6 100644 --- a/drivers/target/loopback/tcm_loop.c +++ b/drivers/target/loopback/tcm_loop.c @@ -1102,6 +1102,8 @@ 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, + .default_submit_type = TARGET_QUEUE_SUBMIT, + .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..b604fcae21e1 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_submit_type = TARGET_DIRECT_SUBMIT, + .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..5ee03d1cba2b 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_submit_type = TARGET_DIRECT_SUBMIT, + .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..ff33f31bcdf6 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_submit_type = TARGET_DIRECT_SUBMIT, + .direct_submit_supp = 1, }; /* Start gadget.c code */ diff --git a/drivers/vhost/scsi.c b/drivers/vhost/scsi.c index abef0619c790..dc274463bdf0 100644 --- a/drivers/vhost/scsi.c +++ b/drivers/vhost/scsi.c @@ -2598,6 +2598,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_submit_type = TARGET_QUEUE_SUBMIT, + .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..0c51edfd13dc 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_submit_type = TARGET_DIRECT_SUBMIT, + .direct_submit_supp = 1, }; static const struct xenbus_device_id scsiback_ids[] = { diff --git a/include/target/target_core_base.h b/include/target/target_core_base.h index 159567359bbb..401abdf8a9ef 100644 --- a/include/target/target_core_base.h +++ b/include/target/target_core_base.h @@ -108,6 +108,15 @@ #define SE_MODE_PAGE_BUF 512 #define SE_SENSE_BUF 96 +enum target_submit_type { + /* Use the fabric driver's default submission type */ + TARGET_FABRIC_DEFAULT_SUBMIT, + /* Submit from the calling context */ + TARGET_DIRECT_SUBMIT, + /* Defer submission to the LIO workqueue */ + TARGET_QUEUE_SUBMIT, +}; + /* struct se_hba->hba_flags */ enum hba_flags_table { HBA_FLAGS_INTERNAL_USE = 0x01, diff --git a/include/target/target_core_fabric.h b/include/target/target_core_fabric.h index 2a6c4c935666..dcd7d76d2f30 100644 --- a/include/target/target_core_fabric.h +++ b/include/target/target_core_fabric.h @@ -118,6 +118,15 @@ 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 to a target_submit_type value. + */ + u8 default_submit_type; }; int target_register_template(const struct target_core_fabric_ops *fo); From patchwork Thu Sep 28 02:09:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 13401873 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 6AD83E81810 for ; Thu, 28 Sep 2023 02:09:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229770AbjI1CJS (ORCPT ); Wed, 27 Sep 2023 22:09:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46770 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229737AbjI1CJS (ORCPT ); Wed, 27 Sep 2023 22:09:18 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 70B7DB3; Wed, 27 Sep 2023 19:09:16 -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 38RL6gOf028420; Thu, 28 Sep 2023 02:09:15 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=E8Tae8tilgxq+dGuQqI2tvDzTcZUjt/G8MKIOKdvkG4=; b=uqYWmJ5geD7DErjH62b+4iueygRLQFanTMULbBFh/Ojjzl8p/XfF7Ze+aQIo5V9cBvTQ tCkqvw7c9jNlksuMWjNIMTQ2HeiOHcY7PFSUpdU/l+GSbzNqdLjK5/sPyMpzF8QOAZlx WgMVQXnYKu17bWRBZo1LiJHRELMHIlAFjfUlK6iGdarFoncdr/Pl+Lo8RH5smexkmCb8 iMLE1WhpjbhuJW/tyKR0oOZKPXSlW+HlqV24mjjWXR9x2Hc5NlPomjC0Z21Uu20E6iZ7 4PKlH7eevgA3IrGVO74lUWVHBKGyr7WLRYppdcqzjFpMYghboPESKi+KfBIPVpuNT9sX hg== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3t9peeb0h9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 28 Sep 2023 02:09:15 +0000 Received: from pps.filterd (phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 38S1VcfZ036610; Thu, 28 Sep 2023 02:09:14 GMT Received: from nam02-sn1-obe.outbound.protection.outlook.com (mail-sn1nam02lp2044.outbound.protection.outlook.com [104.47.57.44]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3t9pf97800-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 28 Sep 2023 02:09:14 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=c4F90XkhN+NVFGzWomLmeFW5WNk+CCS8/QQ8MveLcrQhIVR9efEesoZ8EmB5WphSvhPVkW7ilzujiAqg2732+iZZrKhnyNJXFqR4bXC8b389RIdvL2751Ci7oq0Hz7Ck/2vA7t9tzNLnVCAIAbj05zsxjRs+rSwIXaHUM2Jdg5lJwDTohMVCuwx4xS3NYY+upw2LEG435/4JjZpxpgNvnqco37BlXLJphAGrs8HwssmIOJqd1n/0XgMLoyur815m+I4JdHNRbhzjDguHm4+js/n0Yi/RoynCESPv/yCAWupLsFyt7agrhr+MsHugpXkg5bWQU0T74/86SOdSoTIoSQ== 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=E8Tae8tilgxq+dGuQqI2tvDzTcZUjt/G8MKIOKdvkG4=; b=KYIY947LmwUuncCqCXy1Jhm5QEr9ih2kptH222mMo3TuYv8wHTry4k3UarY0c3uBbS+r9tInTiy9i25szaKG1zMtdP3j6LaZuIlPCDxMwf7RxJ4MGdbkTSmaHNB5Fb2AMc4nmEeqazzNuhRPDWiaIFLsLwi23SoRqDLi6G9OKTsUkkM8EX4sPFx4I96BOvrHjl3N3/77liWPn0YjDKAdhgUerET6x2qo50jTv08jnmIAwDIMSaMtFWf/5ubnJK4rZrHTMQbm+Azyl2SnurCGV4Zv+WGwpnkk4MMeVfHJ/vL9ntovZqSJs/OlaTzoZZkKh1+gKydPYfGRDQOcHWkiuw== 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=E8Tae8tilgxq+dGuQqI2tvDzTcZUjt/G8MKIOKdvkG4=; b=ze0Aj9uXIwuKjPe75Kxl6UMrOacKLBP7XtIoyPVUeV1PlDL5Qir41zNtll+Yfy3e5ecAQTxFL8ZKza2SkSJ5Z0F2pdRmRcf6ylKAJl1FI9PqU3rHAZOZYNRDTzX8n4JRI7u1DR2s28vvW5y7OhjGzxad2/bvkFZ8rnijRuUA5fw= Received: from CY8PR10MB7243.namprd10.prod.outlook.com (2603:10b6:930:7c::10) by SA1PR10MB5784.namprd10.prod.outlook.com (2603:10b6:806:22a::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6792.28; Thu, 28 Sep 2023 02:09:12 +0000 Received: from CY8PR10MB7243.namprd10.prod.outlook.com ([fe80::37c3:3be:d433:74e8]) by CY8PR10MB7243.namprd10.prod.outlook.com ([fe80::37c3:3be:d433:74e8%6]) with mapi id 15.20.6813.017; Thu, 28 Sep 2023 02:09:12 +0000 From: Mike Christie To: martin.petersen@oracle.com, linux-scsi@vger.kernel.org, target-devel@vger.kernel.org Cc: Mike Christie Subject: [PATCH v2 3/8] target: Move core_alua_check_nonop_delay call Date: Wed, 27 Sep 2023 21:09:02 -0500 Message-Id: <20230928020907.5730-3-michael.christie@oracle.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230928020907.5730-1-michael.christie@oracle.com> References: <20230928020907.5730-1-michael.christie@oracle.com> X-ClientProxiedBy: DM6PR07CA0119.namprd07.prod.outlook.com (2603:10b6:5:330::11) To CY8PR10MB7243.namprd10.prod.outlook.com (2603:10b6:930:7c::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY8PR10MB7243:EE_|SA1PR10MB5784:EE_ X-MS-Office365-Filtering-Correlation-Id: ad63f3b9-a05b-4d50-d5e7-08dbbfc7e869 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: UmiANx7uCUff6LxwMbFaL7rtGtt19pLuseFzlG3rRXg7vw1CHT6upZjp3YT509TsiLGOIjFG9XwwjMwHZciid+cJlDA9624uS2XjJqaEho0H30zGSZsXVeyFXZTFtzVBIk3JidH0fyYePFbEEpCD6EKcV6U17JmMsNFNUEbLBA6rxPWRFB4O19nj4YcR+rZxCtQxXcBVN+vNexIiUAeZ3jaNWu6U/+Whfu86eT1gTGotyYBlLtoxAYNwAi7uTQxLtQqp/7V57MvhUNKyXYkN8fufAb7LFdOp6BXARUea4KsB1qXMJibZ6d1/DMhl2o95VZ+kuzDd4vwmZSGq4EeXPT3aQbPOzFEzI5QzJjmTh8VmVXcR4I8vIdR4H96D5WqJFvJSnUx6bVPKVjXYDJxYo7iH70prwBdxqDJizKWH5zRsqltJ5gSnXo9eSBbz8PNFnu1l9GFCJFMs0ByAXeyzQRyDzQ7AR8fzgu6Rc0VgMoiSYRFzagzNDnmJH/pisOnOFLk04Ml6n1wnDs8853sCbb7najL//KU8MLyjE5+MiV83zcjV7mJ7YKk6SEyBDN55 X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CY8PR10MB7243.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(39860400002)(136003)(376002)(346002)(396003)(366004)(230922051799003)(64100799003)(451199024)(1800799009)(186009)(6666004)(6506007)(6486002)(83380400001)(2906002)(478600001)(1076003)(5660300002)(4326008)(107886003)(66476007)(8676002)(66556008)(450100002)(66946007)(8936002)(2616005)(41300700001)(316002)(38100700002)(26005)(6512007)(86362001)(36756003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: xpLAWZ0RVv8zrvdPlWXpzh5RHWnNUM29mHZ/rL9tdRy4qGsRcT784dO1JLRZqmBcO9w9oqmzpQyPzVE4ckg9QuLkR3o+7J1jmnrOMQg03hEsEPWNB8TBF+P9qVFHON2nmmGDSUB3Bbrsqan3WWEPI4GYrtl8uOclsDeopjWB69AfhLbzi8PSJ7P32JjAjZ6km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baqKcHBK2DABTrvG8PrGaUM5a/kdO6qOpbBGynHc9LVyc7SjNUcWvjlXHPdXn1n/zPz7zDcV27a0ozu/d72in9qhBujBpHPQKAwx43Ti20mR+Vi0eUbNGTsYBDOF1TeV8sDHd4Q9MUiyGcpM6F+ra6uSA== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: ad63f3b9-a05b-4d50-d5e7-08dbbfc7e869 X-MS-Exchange-CrossTenant-AuthSource: CY8PR10MB7243.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Sep 2023 02:09:12.2922 (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: tsxGJvhRW9KdvBdiqztpvlUxNQjgcD1X4lmZdUHgKcYRQHbYKMra2uhVjYlGV6XiD8w0/FDJ6+76wBsDWNVN0eiz4Hi+8OTqyvVFL9+06lw= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR10MB5784 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.980,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-09-27_17,2023-09-27_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 bulkscore=0 mlxscore=0 mlxlogscore=999 suspectscore=0 phishscore=0 adultscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2309180000 definitions=main-2309280018 X-Proofpoint-ORIG-GUID: 4pR4qNHSsgi1qC3eczobj83LhaHCov8_ X-Proofpoint-GUID: 4pR4qNHSsgi1qC3eczobj83LhaHCov8_ Precedence: bulk List-ID: X-Mailing-List: target-devel@vger.kernel.org This moves core_alua_check_nonop_delay to transport_handle_cdb_direct so the iSCSI target driver doesn't have to call as many core functions directly. This patchset will eventually merge transport_handle_cdb_direct and target_submit so iSCSI and the other drivers call a common function. It will also be helpful with the next patches which allow the iSCSI target to defer command submission to the lio submission workqueue, because we will have a common submission function for that which will be based on transport_handle_cdb_direct/target_submit. Signed-off-by: Mike Christie --- drivers/target/iscsi/iscsi_target.c | 6 ------ drivers/target/target_core_alua.c | 1 - drivers/target/target_core_transport.c | 12 ++++++------ include/target/target_core_fabric.h | 2 -- 4 files changed, 6 insertions(+), 15 deletions(-) diff --git a/drivers/target/iscsi/iscsi_target.c b/drivers/target/iscsi/iscsi_target.c index b516c2893420..1d25e64b068a 100644 --- a/drivers/target/iscsi/iscsi_target.c +++ b/drivers/target/iscsi/iscsi_target.c @@ -1234,12 +1234,6 @@ int iscsit_setup_scsi_cmd(struct iscsit_conn *conn, struct iscsit_cmd *cmd, spin_lock_bh(&conn->cmd_lock); list_add_tail(&cmd->i_conn_node, &conn->conn_cmd_list); spin_unlock_bh(&conn->cmd_lock); - /* - * Check if we need to delay processing because of ALUA - * Active/NonOptimized primary access state.. - */ - core_alua_check_nonop_delay(&cmd->se_cmd); - return 0; } EXPORT_SYMBOL(iscsit_setup_scsi_cmd); diff --git a/drivers/target/target_core_alua.c b/drivers/target/target_core_alua.c index 3372856319f7..01751faad386 100644 --- a/drivers/target/target_core_alua.c +++ b/drivers/target/target_core_alua.c @@ -850,7 +850,6 @@ int core_alua_check_nonop_delay( msleep_interruptible(cmd->alua_nonop_delay); return 0; } -EXPORT_SYMBOL(core_alua_check_nonop_delay); static int core_alua_write_tpg_metadata( const char *path, diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c index 0686882bcbda..709314415a01 100644 --- a/drivers/target/target_core_transport.c +++ b/drivers/target/target_core_transport.c @@ -1587,6 +1587,12 @@ int transport_handle_cdb_direct( might_sleep(); + /* + * Check if we need to delay processing because of ALUA + * Active/NonOptimized primary access state.. + */ + core_alua_check_nonop_delay(cmd); + if (!cmd->se_lun) { dump_stack(); pr_err("cmd->se_lun is NULL\n"); @@ -1818,12 +1824,6 @@ void target_submit(struct se_cmd *se_cmd) } - /* - * Check if we need to delay processing because of ALUA - * Active/NonOptimized primary access state.. - */ - core_alua_check_nonop_delay(se_cmd); - transport_handle_cdb_direct(se_cmd); } EXPORT_SYMBOL_GPL(target_submit); diff --git a/include/target/target_core_fabric.h b/include/target/target_core_fabric.h index dcd7d76d2f30..e5fcfb845529 100644 --- a/include/target/target_core_fabric.h +++ b/include/target/target_core_fabric.h @@ -206,8 +206,6 @@ void target_stop_session(struct se_session *se_sess); void target_wait_for_sess_cmds(struct se_session *); void target_show_cmd(const char *pfx, struct se_cmd *cmd); -int core_alua_check_nonop_delay(struct se_cmd *); - int core_tmr_alloc_req(struct se_cmd *, void *, u8, gfp_t); void core_tmr_release_req(struct se_tmr_req *); int transport_generic_handle_tmr(struct se_cmd *); From patchwork Thu Sep 28 02:09:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 13401874 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 C722EE810D5 for ; Thu, 28 Sep 2023 02:09:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229955AbjI1CJX (ORCPT ); Wed, 27 Sep 2023 22:09:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46772 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229854AbjI1CJT (ORCPT ); Wed, 27 Sep 2023 22:09:19 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C68DDAC; Wed, 27 Sep 2023 19:09:17 -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 38RL6YxX010753; Thu, 28 Sep 2023 02:09:17 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=c/KT1LUXffi8CQ3sbr4TDpDp+kJ0EPHQLIH3Pd53xjw=; b=t6JYhHPrZrbC5n5Sa2/35voR6J6gn2Kd4R139Rr9T/DogHumw2SxTmDA48/FeQREXeF+ mqUvIYR/5DmXQS4xb+HyHd2VsKA4jzemvnfYMsmwiiWEH+2nyo3Itf+1FgklioaVwDBE nZ692PKtHjUUOZBupiixm2UK5i4Y9PZUgkl4TNHg1BlLVNfYzy2/m4ZB17Pt07b8lD3z lnMo/BfWDc940upD5PFrk8hfEVl+o4qj/F0MvdepFL44VlxSntefCa3T4cxEfWo/coEH W/Y0O//NUJivoOZKlvIQo3r9e3bCy3C5691I9JBfUherYItvzZ6/5yej4lxIt3lp2ZA5 6Q== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3t9r2dk6u7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 28 Sep 2023 02:09:16 +0000 Received: from pps.filterd (phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 38S1UJwY035048; Thu, 28 Sep 2023 02:09:15 GMT Received: from nam02-sn1-obe.outbound.protection.outlook.com (mail-sn1nam02lp2044.outbound.protection.outlook.com [104.47.57.44]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3t9pf97827-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 28 Sep 2023 02:09:15 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Mao6GXKWIZc8GXiqrz9YNC8uJQiBqjEAJXywZR3/MAh4OGK+H4o4eYqLzDtyfNUFZFFDVX6k6FSz9jDA+S4U8t6uTd7Ftezv9ECNoe09Qn5rGuAmP1lD1ewwPk0xbGr942/cnxrbKU3u2qmSPgKfS3osROJJ+WnvwYkZ5vGhwOCxyhQBg2F2TdG78sHEcqLIXC0Fq9JZQGUcEb5SYbpnq+Vv4BoitOAP1v3Kjk0SSHkA9hU/bzBJWNfTGQXBdSzs3ug/YIq3yuwhFfSTMVXn/s5WaVQOsHFWiHiqq6mJVtYSFVqgYRqqPlKVmmzeEWGrl/+cCL5lJ6bT7F+6LJBRNg== 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=c/KT1LUXffi8CQ3sbr4TDpDp+kJ0EPHQLIH3Pd53xjw=; b=NWhuuvmCUeKdUDfafqeaKViulW8BxesVYemJncaTcWNA0VuVMgeTn0z/XyZpUkQnfIQcZeeDsKbl1n2vRXKd9UpXz8D9F4I1xXMEP8FubHamwwtt85EFcAeJ2gk23pXOqmdgFkfAmakezBKY7Ndh3YL3R/81hLzOk+GBRkgFPiqpQhwTeZRgVlL1kuWrj3hwHBYuXEP/1+plzbCOfsv1hTYZ+rF3l9xALbQAa3ul1GkC6dX2UhgDxQs2EeU4vd3bV+fil8lhWXsQPkJrT/hLxUiwiXESg8Krl/2bZC3DoryU9MHEsa/CkU4xk/O0DJIKUIW6s7ulB09JJFEa2m8hZQ== 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=c/KT1LUXffi8CQ3sbr4TDpDp+kJ0EPHQLIH3Pd53xjw=; b=ZiazSCFygrD7MTHItgmFVkQqt6x/TCWh/ARmWeaOEtqCbG1rZ6sUIh+GvmHMqcbd34VygDsTvLK3ufjWm6NwP0odRBYuENgF1MChd7WCxf/8v1y+FkcDsaORXq9+Loty4oEMfq4RG5pIbftNF9EAYy4pChKnlumI9RgOwJ0f750= Received: from CY8PR10MB7243.namprd10.prod.outlook.com (2603:10b6:930:7c::10) by SA1PR10MB5784.namprd10.prod.outlook.com (2603:10b6:806:22a::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6792.28; Thu, 28 Sep 2023 02:09:14 +0000 Received: from CY8PR10MB7243.namprd10.prod.outlook.com ([fe80::37c3:3be:d433:74e8]) by CY8PR10MB7243.namprd10.prod.outlook.com ([fe80::37c3:3be:d433:74e8%6]) with mapi id 15.20.6813.017; Thu, 28 Sep 2023 02:09:14 +0000 From: Mike Christie To: martin.petersen@oracle.com, linux-scsi@vger.kernel.org, target-devel@vger.kernel.org Cc: Mike Christie Subject: [PATCH v2 4/8] target: Move buffer clearing hack Date: Wed, 27 Sep 2023 21:09:03 -0500 Message-Id: <20230928020907.5730-4-michael.christie@oracle.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230928020907.5730-1-michael.christie@oracle.com> References: <20230928020907.5730-1-michael.christie@oracle.com> X-ClientProxiedBy: DS7PR03CA0294.namprd03.prod.outlook.com (2603:10b6:5:3ad::29) To CY8PR10MB7243.namprd10.prod.outlook.com (2603:10b6:930:7c::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY8PR10MB7243:EE_|SA1PR10MB5784:EE_ X-MS-Office365-Filtering-Correlation-Id: 7e614508-d18a-46e3-82f9-08dbbfc7e972 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: itFizXDb06KJis8OBLY3vKvlqfeyRSjNr9FLRNORPqW1EzL4diqkU/TQjCDxilIVdUtxmZhZ5VaXRwBEqj1bwMGsuNduYx3nAbsoGZCOOgCS8Hx9shD2/qs5J8h2u5UUPwE1Ne22FuvXNbzvrz0Oo9LidGTt5iAWOeeLuyy/IGP22pn8qFx6CP2vSyeLWjIeJDhRxk3iNjDrS3Y6qdTQlUnPmZ1ZHY8wDhXgDUW2tVwsOOXIUdlVNdzxOlHa43C5Vrb93atAw1e1xxhda45lCAHHb/aXsPsF/HJuKgdCaV0lXtaDItBivHllTltT5Qv6gPmS3ewNXc3n1XlBMxPF+4sC7zgznlxB2096vBxcbNJyC39B5VkSTmmpUHZLeCWpNFlcGMKQF2ELV1bE/gkUkLBuuxS9PQ/B+SJIgESgIiaKDf9U/dsGFfnmysvGe2un4iEKZuZNzGyUlgHlr5kfZ+uHgnLt5eSv6v6VptVUur9b5UAtECeDn+P6gP63vl8ZMsx16EoElpqHkzTpl5H5Gc4vmJ6yGIhU6tAi3BgjRPX1FDKu1KZ5rMo/vf6U3cUF X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CY8PR10MB7243.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(39860400002)(136003)(376002)(346002)(396003)(366004)(230922051799003)(64100799003)(451199024)(1800799009)(186009)(6666004)(6506007)(6486002)(83380400001)(2906002)(478600001)(1076003)(5660300002)(4326008)(107886003)(66476007)(8676002)(66556008)(450100002)(66946007)(8936002)(2616005)(41300700001)(316002)(38100700002)(26005)(6512007)(86362001)(36756003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Y31eDXz8HDDyvmf//tmEsdALkhqIeL6qeylRuqAv7KZ1ZQD8T6HZQEu0Fa8aGKNTY2ZoOVqXnKkiUPpcGyEVWXU6kMU1RKh99DJ0TEXvk841sLnXjC759GmTa5lxVdgqoZwU9/o8t3hE9BQXumyQOqnosQzBD1xA2aUqtz/eLPdsoybQgnIEVMn4yYDK6m3wi9a1S2i3o9KVNVcjvCvUz/cKB1s580XM1yaR2+xrN0CLieyal/fIR1ysD2MZ+lcd6RdY8IgQ3DDJ+TRzPnMeurYXj8gpPWhgg4gQ7Z0dazgEz4xqPE8N2YeyxKECBaVMz5Y/AZSkUfE1QhTQLhXa6lULbTxN9bb57QuVHHmHqQnXlO+TZtPbhI8TLGctlkXFaWABLoeS9Oaf5Glfxf7O2YucfxIv8kxaHAKnQcgMOHeDNJy7qKUgEiV4dPsR5dsg3CDIGkHv1b3My2MQLZ/WgZvG/l+zYaEUUT7pli6iMVNTPayPkrLO/YxPc/gg98Z/WpsZ+Zu1k7L4ozbtQEQoOlSft3OoOwwsWjNM6DE+VOdVIB/tvzwMHot3taJlGF7FxjSAupbe0HkkjFBw0Eb8HoywCu5IKfYMHZVJEr/Krg4/0bt6UefvRL8gS3XM/ZmQm6UBNYTNTYZ+6ECY/+t6L6UmGVMl2bM4EcKpTgqobPaTaNQwTRkPmZ7wClv4QIvmtSId4nFvPEcj8DOlNZyaLTwobJPxukXbhYJf4M7r/VCCy3zK9DwZ8q0W/aXNzhT4wsJrJvx/T655kG7RUQPXld9AzsBAyQA3FYeXOG1XeEIpG93OU/hABbIPVweyyiWn+66raTL3af7ANhXVNG4roDkYr4pS87z7CX70PFm6DpITHmG9/yzUNx7r/qfrosmzKdWpZndlSyKq8rSdCI/rKv+4p67cTf9JcLeEve8dkFJHKOiOgjhNrjTTKT7YWpMvlh//QbFz8dm0L3sZodV7xwKcueLIQUz7jbty5r8Nif/zlNHiBUG23GLkNjCaftLwG9174830WsIYxCXawwMAa+3dRmaDwx5Jzz+yqdCvQQ2ejkwZEayfrmo+Ds85ebIgmvavmXu/maUZIh3PwLc0McsMTkxvi19DWQozPE5hYWHSaKXw6CeBx7neOR9/KqENSOi0tk3AUi/anO2GPM+JX4aGk89DrVjbdF7CGspXY1BHwvDGgTxqUJFPhJBXaiE4hQSUjZFqX/oobkyIL7NlYirVAV/63pH9yO7sYwy3T1ACxN4rMTSbzu/QeiTTCG+2puVCCD5VPDKczqIce7eVdp2v4IGsuVHK3xuy3C9hU+OnHqGBrmwI8JBwbDiwQ5md2BNfHyQIxkcaceqvzVBeySNChW/R3Jo40g3QfTE3ns75xC5d6fzlFhpiQkqmlK8+OgVPnCNeAJcnm11EZMmJKK+MGxwYL75VhDQTM6NoC8ukfJTc8tVxG9+ftu7Zqr3amP2a0m8O9tPLLGFF4S394xHQFzHP/X8Lqnq3XH0yZq6MfWwHQphvcYkLh788HMehAfYegV/pYUuixNiAv1lD+wmWsHBT7jW3LrG4MDsM779fTqyoVNhQea75BEX0BJ5IIIXsrHhCOguW7lGRNQ0JDw== X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: OL2x/lmLw1M+TJ23WKlay9s0snY1V5Ab43Wlkr7eMap2AZ4DiphhYwIw/ERsMztpHQlHY7xPISHPKVypbrPx+hAY4l1HqzHNr/aC7PGCnFiXeFO1y8zr0uNmj/tAH+GcH9J/raqI8stHduZJrpRhm3yGIHC3Gp5oKb0rjtyPqJfpA9DCRda0wU+74GYwxcRVmyEipgpKiTQhm5w0N2oQLCFGyWiNTthBATURAKPGhBgHcIXSYHKhFvql6HY23NpSyE8HZBUC9G74y3zxKM/DXQO6Pv7FcvsedhPuvwvRW3fM199bFZA3t5li/dMN4u5jv8WkUdSnU8dpOtMXzuBk9pZt3twmY/unoL41LUZ2kZfiVxS5QtSBF0MQpOkBBik130WwYlfdEsA4SpwDljm0nqq+JmHO9dZQOw9ag+wi8rxeWlnaWve7RqmQ3q24hpJjnR/N55cD/cZSH+/yNeWj1W346IznvSXxcszVwrAiIQWBquhGuQR/3DQlHyD6qEY5MF+HZ3Lrw95eBVchB2m91OApaLGdhxxoncafvkrUHxwIczaK0a8cabUb6apKbqEAmayNHgYqrA/RR7ozCAwNm8WJu8CRBq4rM+BvlQikATmgvML3RgPAFwyFcP1kD9JSDvHTHUmL+841fBpUG+Eio6SchUSheFm/2/YSOTEm8ZsOFS143NGzsZCtbIhq/vvaaTnS6E3SpKh7XLuFPh+9hc8ZLldiFQCKjEmACG3IFK57c25ylG45vL1UO5msSgTUPUNQsqDuIvllKuiyIMGK/Q== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7e614508-d18a-46e3-82f9-08dbbfc7e972 X-MS-Exchange-CrossTenant-AuthSource: CY8PR10MB7243.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Sep 2023 02:09:14.0387 (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: JN1Jx1iYZudKDwE8ap44riPRIagGbWpZh63f0BNfFdWzOYabET+cNku9gh0133artVL7LtYR+5TSz+uS2f7zS/WCgqpZKstVMnnhKA5G+zM= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR10MB5784 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.980,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-09-27_17,2023-09-27_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 bulkscore=0 mlxscore=0 mlxlogscore=999 suspectscore=0 phishscore=0 adultscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2309180000 definitions=main-2309280018 X-Proofpoint-GUID: jcrTtkehQwKClfz7BAfPliDRSbI-54dF X-Proofpoint-ORIG-GUID: jcrTtkehQwKClfz7BAfPliDRSbI-54dF Precedence: bulk List-ID: X-Mailing-List: target-devel@vger.kernel.org This moves the hack to clear some buffers to transport_handle_cdb_direct so we can eventually merge transport_handle_cdb_direct and target_submit. This also fixes up the comment so it's clear it was only for udev and reflects that the referenced function does not exist and we now allow more than 1 page for control CDBs. Signed-off-by: Mike Christie --- drivers/target/target_core_transport.c | 49 +++++++++++--------------- 1 file changed, 21 insertions(+), 28 deletions(-) diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c index 709314415a01..c2ddd09051e8 100644 --- a/drivers/target/target_core_transport.c +++ b/drivers/target/target_core_transport.c @@ -1593,6 +1593,27 @@ int transport_handle_cdb_direct( */ core_alua_check_nonop_delay(cmd); + if (cmd->t_data_nents != 0) { + /* + * This is primarily a hack for udev and tcm loop which sends + * INQUIRYs with a single page and expects the data to be + * cleared. + */ + if (!(cmd->se_cmd_flags & SCF_SCSI_DATA_CDB) && + cmd->data_direction == DMA_FROM_DEVICE) { + struct scatterlist *sgl = cmd->t_data_sg; + unsigned char *buf = NULL; + + BUG_ON(!sgl); + + buf = kmap_local_page(sg_page(sgl)); + if (buf) { + memset(buf + sgl->offset, 0, sgl->length); + kunmap_local(buf); + } + } + } + if (!cmd->se_lun) { dump_stack(); pr_err("cmd->se_lun is NULL\n"); @@ -1796,34 +1817,6 @@ EXPORT_SYMBOL_GPL(target_submit_prep); */ 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, - * so go ahead and do that here for type non-data CDBs. Also - * note that this is currently guaranteed to be a single SGL - * for this case by target core in target_setup_cmd_from_cdb() - * -> transport_generic_cmd_sequencer(). - */ - if (!(se_cmd->se_cmd_flags & SCF_SCSI_DATA_CDB) && - se_cmd->data_direction == DMA_FROM_DEVICE) { - if (sgl) - buf = kmap(sg_page(sgl)) + sgl->offset; - - if (buf) { - memset(buf, 0, sgl->length); - kunmap(sg_page(sgl)); - } - } - - } - transport_handle_cdb_direct(se_cmd); } EXPORT_SYMBOL_GPL(target_submit); From patchwork Thu Sep 28 02:09:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 13401875 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 429EDE810DF for ; Thu, 28 Sep 2023 02:09:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229987AbjI1CJZ (ORCPT ); Wed, 27 Sep 2023 22:09:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46786 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229737AbjI1CJV (ORCPT ); Wed, 27 Sep 2023 22:09:21 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 991C7B3; Wed, 27 Sep 2023 19:09:19 -0700 (PDT) Received: from pps.filterd (m0246627.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 38RL7T2q005172; Thu, 28 Sep 2023 02:09:19 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=yN9n0XboO6sXrc+xTkp6zQZfm+oW2/DJLqsqYyjEoYc=; b=s+w9bfQ7XEgtcuzwMOIDy46nkPQzLea2gSyTjNjMYGJBVdzLjMPLHpbAPyz/lvQpA8wk MEuqMjz5swjoCnO+a4zwUvhkiuKTsrxiGJoTKkjIniVrJCExZdbGhfKvVJ+xsg6mF7Ep Yeq1+NEu5r8fGQSgNQ8Msi5cJVVRLnWXVFSOx7hklbQ8V494aeiupnAsGs0kmk0MYHV6 0WJC6iPE2Wtv99JhfnRoHyqsrdDlGVIpQsAc9/HUO4my/X9YdKjYVR6zSCbYri7D2/TR 2vjlHIX9sCCley1xKS7IXP8PNOKY0UtR/rsFj3KWkyv3telAMy78xPT9vcuAvgqOM7xT YA== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3t9pm2b459-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 28 Sep 2023 02:09:19 +0000 Received: from pps.filterd (phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 38RNWBJT034921; Thu, 28 Sep 2023 02:09:18 GMT Received: from nam02-sn1-obe.outbound.protection.outlook.com (mail-sn1nam02lp2041.outbound.protection.outlook.com [104.47.57.41]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3t9pf9784a-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 28 Sep 2023 02:09:18 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ekpWEK5LmAep4dpLi10ddQ9zUwJYcwiYw+07MbNGhkJBiLZR4ekueCwRJswdeKQu+Xv4zW1mJeAhaTOeRYVG+Gz7ObO8YRpWPqdoHmSe73pvd4+J8dXca/g7Q0ehrZedATm9HCCSKBUki/8uIVZdijnC1JgzoIeTE/V4oyfKL26iuMtcvbWK9Xpg8Qaed9hjrbWdvCLBRxQL4+Xl/nOp1BYnGyyaNCa8WxJZNNNAkodSoTj/JDPWmhwFeTp15ik/PTg9msonrHOh3tmf4BXCIfEvP6xTZA3ujTlY6Z5XgADn5nOS49gnSnTbwuXaICDGuYr5MW4HJjx4Yy3ps67syA== 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=yN9n0XboO6sXrc+xTkp6zQZfm+oW2/DJLqsqYyjEoYc=; b=I8SJbohU1aQDIQrsrWPpnKdmvJve/E6wziVlgzDs8OMZEry1oKHauGw9YxIVk5QAHrRoPScdbd7f8/VfGFmrP+mcoAXrZd2EYGxdW2eozbMl66W//lx6NBoqGB73HHeQthMIAoxol0Tzyt9AL6GQ/QGHsnEPiWW2/RKwRLTr7ZZyDSb3dTxW1XYK5lBXu8Ws7Gy8nZwjHEiGpJECPQAyQMlMxEsAz6Hok5FJYr1a7vdSfAoca12WhUD1K6ix75Bi5ZH37adJhgKU8Jmlhqxu16dKpKPcobAfQDy9gEvPjuPn5IzVab8tYkEb36hOn4C/gqT9ai3aCbGtbtbTirwVDw== 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=yN9n0XboO6sXrc+xTkp6zQZfm+oW2/DJLqsqYyjEoYc=; b=IlI3D5CMS7K6gHiQWLs7ouKnwjv34RjYl/5TlY4QOajJiOm3Yne3fCJJECmf0/iw8OcWjouMtwgDCA2aDUnEiNsWV7zKLhVDGyzGAJ5mcRdeMDwBhAzyjl47etK5VwLCOQ+n/qcP84OOrcVWuGAA5LVe2VE7NiKUmk4EPiWucm8= Received: from CY8PR10MB7243.namprd10.prod.outlook.com (2603:10b6:930:7c::10) by SA1PR10MB5784.namprd10.prod.outlook.com (2603:10b6:806:22a::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6792.28; Thu, 28 Sep 2023 02:09:15 +0000 Received: from CY8PR10MB7243.namprd10.prod.outlook.com ([fe80::37c3:3be:d433:74e8]) by CY8PR10MB7243.namprd10.prod.outlook.com ([fe80::37c3:3be:d433:74e8%6]) with mapi id 15.20.6813.017; Thu, 28 Sep 2023 02:09:15 +0000 From: Mike Christie To: martin.petersen@oracle.com, linux-scsi@vger.kernel.org, target-devel@vger.kernel.org Cc: Mike Christie Subject: [PATCH v2 5/8] target: Kill transport_handle_cdb_direct Date: Wed, 27 Sep 2023 21:09:04 -0500 Message-Id: <20230928020907.5730-5-michael.christie@oracle.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230928020907.5730-1-michael.christie@oracle.com> References: <20230928020907.5730-1-michael.christie@oracle.com> X-ClientProxiedBy: DS7PR05CA0077.namprd05.prod.outlook.com (2603:10b6:8:57::17) To CY8PR10MB7243.namprd10.prod.outlook.com (2603:10b6:930:7c::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY8PR10MB7243:EE_|SA1PR10MB5784:EE_ X-MS-Office365-Filtering-Correlation-Id: 76fdf04a-dccc-49ef-43e5-08dbbfc7ea6f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: MTibRdJAsecwXkC4a4n4c2GNAZv6gQ6C2oLf7Y4z1fE1LdKNckqqJR0S/uyw1I0ltuiM/AF9n/DIYvPw7B//CAbDwJQlsQmn8dfxIUNDQe1GZSl0gbYgVwYftSKMqo1sEAI3AX+zbiw/OCDglmC8EQibsW8Ck6WqO0xD7ItJHT/c6z3hnK8Ghs5HsJuWtcfYvGjafVhX8V4uJnahukN2zoKDG8T0Kh9/KRdW7ZhAwq0W08eZeeBDHJ+oW/fVeXNS4BA+FUWd3sFaLNtUoJif2QShgM+mGnThWkFHGAD/xEnjQJpWFWuU/cJqvMqlOSHl9OJ9Fw8sJI/7uHOnYN4RNbV50WJ+5sAkw3nmogfNYGwge5xz0gpJDMHcylpzXKpG50V5T8j6B1jl+YhI1m3lZyV7x9OsKpAIVR7kknB3G65GL8WczTL0vjE+F5zFyGl1HRrdCGjrUhRcbHnC9td4b+zXE0VpZQM+QEC8USuPoEFs2h5PnwKpiROjfjjZIep7AougdQabBpALHoDs4fLSY6k2uP9iN1KIn/ZRurS4nbzRQF4n74TvCAFHhyksyBK3 X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CY8PR10MB7243.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(39860400002)(136003)(376002)(346002)(396003)(366004)(230922051799003)(64100799003)(451199024)(1800799009)(186009)(6666004)(6506007)(6486002)(83380400001)(2906002)(478600001)(1076003)(5660300002)(4326008)(107886003)(66476007)(8676002)(66556008)(450100002)(66946007)(8936002)(2616005)(41300700001)(316002)(38100700002)(26005)(6512007)(86362001)(36756003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 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XnnwYcqyM8IKnMuDcPeism6PQ25+k3vsrOU1gD+VULE1iymNT46oHnver6RMiCe4FA4PoLykii/1rcbd38NTploR7UAyVP/G0xvU53+i7DHI+xy2MpWPLwq2BFgq+KG0tGhVFthfpJRDy8MbYhZq1z6wwEpqRytJUjBzlvIpA2MTLea9gC00frmerVIY5YTwLOmh9pgOQNjQCVPVxqJIU/kGs7iMMOLeeJGOoj04/ZF5bK+ieBcK3eZdEgpIqnxdWH2Dl5FhrOB03z7pmBJ5X0HdvFp0sZ88ArMYzE0mhpUwrBgVhqOIT6jDY58bKTs8suQ5ZEsUD+gZmYRZa0IU6Atxu4mZs8Db9zrMmUJ7i4JuY+TJ2PKYHw== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 76fdf04a-dccc-49ef-43e5-08dbbfc7ea6f X-MS-Exchange-CrossTenant-AuthSource: CY8PR10MB7243.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Sep 2023 02:09:15.6750 (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: 3NaXbkMosgYfacLBM4NZTre/up/Ajy1YQahKKyZyDdK/+EUuQFR9aI7/gANa6dJH9FuJ3+2NS96uF1mlwMLkKPOe0OSCwgG6dRZpr26C+XU= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR10MB5784 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.980,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-09-27_17,2023-09-27_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 bulkscore=0 mlxscore=0 mlxlogscore=999 suspectscore=0 phishscore=0 adultscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2309180000 definitions=main-2309280018 X-Proofpoint-ORIG-GUID: B9Ea5KwENR_tIhyA9a8Ec27Sq1srD87L X-Proofpoint-GUID: B9Ea5KwENR_tIhyA9a8Ec27Sq1srD87L Precedence: bulk List-ID: X-Mailing-List: target-devel@vger.kernel.org This moves the code from transport_handle_cdb_direct to target_submit and has iSCSI call target_submit. Signed-off-by: Mike Christie --- drivers/target/iscsi/iscsi_target_erl1.c | 2 +- drivers/target/iscsi/iscsi_target_tmr.c | 2 +- drivers/target/target_core_transport.c | 27 +++++++----------------- include/target/target_core_fabric.h | 3 +-- 4 files changed, 11 insertions(+), 23 deletions(-) diff --git a/drivers/target/iscsi/iscsi_target_erl1.c b/drivers/target/iscsi/iscsi_target_erl1.c index f460a66c0e7c..679720021183 100644 --- a/drivers/target/iscsi/iscsi_target_erl1.c +++ b/drivers/target/iscsi/iscsi_target_erl1.c @@ -948,7 +948,7 @@ int iscsit_execute_cmd(struct iscsit_cmd *cmd, int ooo) iscsit_set_unsolicited_dataout(cmd); } - return transport_handle_cdb_direct(&cmd->se_cmd); + return target_submit(&cmd->se_cmd); case ISCSI_OP_NOOP_OUT: case ISCSI_OP_TEXT: diff --git a/drivers/target/iscsi/iscsi_target_tmr.c b/drivers/target/iscsi/iscsi_target_tmr.c index afc801f255f5..9c4aa01b6351 100644 --- a/drivers/target/iscsi/iscsi_target_tmr.c +++ b/drivers/target/iscsi/iscsi_target_tmr.c @@ -318,7 +318,7 @@ static int iscsit_task_reassign_complete_read( pr_debug("READ ITT: 0x%08x: t_state: %d never sent to" " transport\n", cmd->init_task_tag, cmd->se_cmd.t_state); - transport_handle_cdb_direct(se_cmd); + target_submit(se_cmd); return 0; } diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c index c2ddd09051e8..d78f24c2dfcf 100644 --- a/drivers/target/target_core_transport.c +++ b/drivers/target/target_core_transport.c @@ -1576,12 +1576,14 @@ target_cmd_parse_cdb(struct se_cmd *cmd) } EXPORT_SYMBOL(target_cmd_parse_cdb); -/* - * Used by fabric module frontends to queue tasks directly. - * May only be used from process context. +/** + * target_submit - perform final initialization and submit cmd to LIO core + * @cmd: command descriptor to submit + * + * target_submit_prep or something similar must have been called on the cmd, + * and this must be called from process context. */ -int transport_handle_cdb_direct( - struct se_cmd *cmd) +int target_submit(struct se_cmd *cmd) { sense_reason_t ret; @@ -1641,7 +1643,7 @@ int transport_handle_cdb_direct( transport_generic_request_failure(cmd, ret); return 0; } -EXPORT_SYMBOL(transport_handle_cdb_direct); +EXPORT_SYMBOL_GPL(target_submit); sense_reason_t transport_generic_map_mem_to_cmd(struct se_cmd *cmd, struct scatterlist *sgl, @@ -1808,19 +1810,6 @@ 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 - * @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) -{ - transport_handle_cdb_direct(se_cmd); -} -EXPORT_SYMBOL_GPL(target_submit); - /** * target_submit_cmd - lookup unpacked lun and submit uninitialized se_cmd * diff --git a/include/target/target_core_fabric.h b/include/target/target_core_fabric.h index e5fcfb845529..a808c3c32004 100644 --- a/include/target/target_core_fabric.h +++ b/include/target/target_core_fabric.h @@ -175,7 +175,7 @@ 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, gfp_t gfp); -void target_submit(struct se_cmd *se_cmd); +int 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 *se_cmd, unsigned char *cdb, gfp_t gfp); @@ -188,7 +188,6 @@ int target_submit_tmr(struct se_cmd *se_cmd, struct se_session *se_sess, unsigned char *sense, u64 unpacked_lun, void *fabric_tmr_ptr, unsigned char tm_type, gfp_t, u64, int); -int transport_handle_cdb_direct(struct se_cmd *); sense_reason_t transport_generic_new_cmd(struct se_cmd *); void target_put_cmd_and_wait(struct se_cmd *cmd); From patchwork Thu Sep 28 02:09:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 13401876 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 7071CE81815 for ; Thu, 28 Sep 2023 02:09:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229966AbjI1CJY (ORCPT ); Wed, 27 Sep 2023 22:09:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46796 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229866AbjI1CJV (ORCPT ); Wed, 27 Sep 2023 22:09:21 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E9B86B7; Wed, 27 Sep 2023 19:09:19 -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 38RL66k7000505; Thu, 28 Sep 2023 02:09:19 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=wgeGot3zr7OFEcHNYj4OulCxe9EwIfAjFKU53rDvP5E=; b=Lg3chZCAk6mjH+eobMGpQYug4pwMbuXVhmi3RVkXKYG7umcfW1lozOCXNYbsNWG4d9lI uk36hokOxqQDA3Lsg4GI/3hezSW+VRPmrN5yLgpv1T+FUfiI2YoFacwlCaO9LgpT7xBp v3iXoLSico3BOwWbZ8+s0t7kg0C5PpFgNZVBwJnawj8oEIdsu8O2OwHpSlnEORGsc3uJ eVsTExeqIY6SNQTDQPlgQfE6qRgc2qnvrGWR2zOXTZjfeJvP26tFI5jp4GNLmll3P5+w jglDi1wbN3P/3Ry1cMlDhy2RzMCpcZEKlovoC3Ful66BHMxlt3/A1lymj6ZfR9ozHTvt 1w== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3t9pxc34pp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 28 Sep 2023 02:09:19 +0000 Received: from pps.filterd (phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 38RNWBJU034921; Thu, 28 Sep 2023 02:09:18 GMT Received: from nam02-sn1-obe.outbound.protection.outlook.com (mail-sn1nam02lp2041.outbound.protection.outlook.com [104.47.57.41]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3t9pf9784a-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 28 Sep 2023 02:09:18 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MjRoWIVpOksRshmWOm2FasGE5e77Fg/BoD7kQMqEWHzH27Jk60egCi819x9JMoiIpssX7hhls6SduDJcmGyAyP0GQ1i2UqsfNIqFR6F65rsM0TboszYMLipUQdPiflAtjncXKwzHaN62yRk5UuNIseX/Gcla73Ap/hX4q/0elYq7AG6V1fMrt+6YiJoxyALxWmXMe29JVfXawF0sVnA0HDVOXnSxR+rq2c/9/nas3tK/BkJKLU0ZPl2/IP5gY8WAMkqvN3h+R/o6Cbd4Jex0wnP9L/8riSy4/gHQ53M0rjn82ptkaSrVPjjrZgRVnoAHTnT+NtLpFZQa4FLZ2H4NpQ== 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=wgeGot3zr7OFEcHNYj4OulCxe9EwIfAjFKU53rDvP5E=; b=ORypWVYBT9XvI+NA01b0rWQnZFhln43uks8aApjOpb05Gj9bwGK8HiS/v2gJ3aQN4bd7k4IN0vMfCoX5qnFUKq7ZqKBXqhHeia5PDsAA65LdErs6kYhn43Fy3MHIz960yfsbxZhoPGdmUijE4G4165/rVKcYMzy79zHviwgJ3yyv2Ci9xxoyjySJn7Kcjvj8cxBW/bpPrsY1+pjwypjxOjHeACJaImlYECr/EoFDNETWpxn20simiTUGE1rxzRg5Y5ZDq+Z8OLKnAAOKP3732W81GzN6APtkQsraNMZbf8sCnAbuNKpl2U2/JNIiLO2/wgSME/t1R1Dwqu0hDA2jDw== 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=wgeGot3zr7OFEcHNYj4OulCxe9EwIfAjFKU53rDvP5E=; b=HsBygKG+NsXXB3zjHZfiQCU/hGLSNV8rPrB5p6h4+v6e0hhSldxW1YYHxqRCwR+6s7wtlIqB9kTlb9VMor/LQ070/z8bivQxZ0P3AKSggQm2ds241JTGrkxdCGxttiTMQ/0HtUK0ln/q9XPHdxYSFNxG0++Rjas31zqBFwFinQY= Received: from CY8PR10MB7243.namprd10.prod.outlook.com (2603:10b6:930:7c::10) by SA1PR10MB5784.namprd10.prod.outlook.com (2603:10b6:806:22a::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6792.28; Thu, 28 Sep 2023 02:09:17 +0000 Received: from CY8PR10MB7243.namprd10.prod.outlook.com ([fe80::37c3:3be:d433:74e8]) by CY8PR10MB7243.namprd10.prod.outlook.com ([fe80::37c3:3be:d433:74e8%6]) with mapi id 15.20.6813.017; Thu, 28 Sep 2023 02:09:17 +0000 From: Mike Christie To: martin.petersen@oracle.com, linux-scsi@vger.kernel.org, target-devel@vger.kernel.org Cc: Mike Christie Subject: [PATCH v2 6/8] scsi: target: Allow userspace to request direct submissions Date: Wed, 27 Sep 2023 21:09:05 -0500 Message-Id: <20230928020907.5730-6-michael.christie@oracle.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230928020907.5730-1-michael.christie@oracle.com> References: <20230928020907.5730-1-michael.christie@oracle.com> X-ClientProxiedBy: DM6PR13CA0038.namprd13.prod.outlook.com (2603:10b6:5:134::15) To CY8PR10MB7243.namprd10.prod.outlook.com (2603:10b6:930:7c::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY8PR10MB7243:EE_|SA1PR10MB5784:EE_ X-MS-Office365-Filtering-Correlation-Id: 2ec3df67-f367-40d6-1800-08dbbfc7eb7f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: fQQm8qQl4DV9Z1sdIBK6LC2njeyOU1vMMmqBWxPnGGKddYhjblT/bHul9ojA2/OVd2/Q18XF0KV/XkitRZRpLj/N8m6jCnq/H3JGLN5YYMHpRmCdAUrmOo8D5rVL4Zt2r/cVfOA6+B+giigCK/H4vYbx2GoPEcEm8Mq/Llhpb5Ts0zT5u0Bch45NcsX3zJnNcCX1l5+c39u5R1Cs4DMWjJxWZbBBrYyvdIR5bTZRmb0g7acvamg/tM1Z4n23yFy++PzwZBqMRGA8pwKMSdbemd2Te1+L6wKFRGJ44jP2ODz8DULRAatGLpyJBd5Uzf9Jeyhf4hBsfqDKPaM0+/HIlIaZhXv/K2GyCWKe3oomYpkmodgjZxCNUZJejmfxd4yVkBGOB79y9Uo8tg+vMMukdg92W8YbQCcPOQX20UmQ3n+bdHLjRy1b7jqay86mdfohs7DU2x1IFt3klxWULlNuQvDiEpt9vvmsX54GuLhj94ybQHs/GlR9pxMZ1BGRcv6Uw8/hfyO+XwnCIkKf89K5MYNNmm3bi1sHAkFNUUgb8QA2X8+5abAvsW6FDRcEesAr X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CY8PR10MB7243.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(39860400002)(136003)(376002)(346002)(396003)(366004)(230922051799003)(64100799003)(451199024)(1800799009)(186009)(6666004)(6506007)(6486002)(83380400001)(2906002)(478600001)(1076003)(5660300002)(4326008)(107886003)(66476007)(8676002)(66556008)(450100002)(66946007)(8936002)(2616005)(41300700001)(316002)(38100700002)(26005)(6512007)(86362001)(36756003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: g7JSQEKCc+gfxsbpvjTUGuXwAydocRGxd62qg2R9h0l2o/QaQ50wTMO3YjC93yOjv8o8HsVj3LQR8zBFwN7oMG9IpBYaOyk8xcPUGqYS8rJcv7Lr148LyzJFN2QrvQS6vaeOHAs4/KRJkNTJ4y0SaW6+rUOjB2CuQNoHyAa1MgruNSj4JA8fqa5qiPCXWNut4WAsi4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NwABI9a+yfNAW8w+9DAPMYcxUpnPx0+lNGCVMmS6pVZgW6RHPZZP7WSz0yhB6ah4hJaH8EosKb/CThugTzJSjxNGhfrnEbQO8RXLEIxf3mhWscynnFT97YkMqJQ== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2ec3df67-f367-40d6-1800-08dbbfc7eb7f X-MS-Exchange-CrossTenant-AuthSource: CY8PR10MB7243.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Sep 2023 02:09:17.4666 (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: r1sRrrnrfdD0p0bzEAbgsEFNjAdPXFRP7ye1ACE439Sp8Xq0cl9e5pM6HsDtFCet4NN8TTkowo/jauDYVasN0yjL1PtS2REFoqwb2mUJSiQ= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR10MB5784 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.980,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-09-27_17,2023-09-27_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 bulkscore=0 mlxscore=0 mlxlogscore=999 suspectscore=0 phishscore=0 adultscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2309180000 definitions=main-2309280018 X-Proofpoint-GUID: dJI5HkfUs4EENEMSEH-HB32pcxqqmbdb X-Proofpoint-ORIG-GUID: dJI5HkfUs4EENEMSEH-HB32pcxqqmbdb 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. With the new device file, submit_type, users can write 0 - 2 to control how commands are submitted to the backend: 0 - TARGET_FABRIC_DEFAULT_SUBMIT - LIO will use the fabric's default submission type. This is the default for compat. 1 - TARGET_DIRECT_SUBMIT - LIO will submit the cmd to the backend from the calling context if the fabric the cmd was received on supports it, else it will use the fabric's default type. 2 - TARGET_QUEUE_SUBMIT - LIO will queue the cmd to the LIO submission workqueue which will pass it to the backend. When using a nvme drive and vhost-scsi with direct submission 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 - And when using the queueing mode, we now no longer see issues like where the iSCSI tx thread is blocked in the block layer waiting on a tag so it can't respond to a nop or perform IOs for other LUs. Signed-off-by: Mike Christie --- drivers/target/loopback/tcm_loop.c | 2 +- drivers/target/target_core_configfs.c | 22 ++++++++++++++ drivers/target/target_core_device.c | 1 + drivers/target/target_core_transport.c | 41 +++++++++++++++++++------- drivers/vhost/scsi.c | 2 +- include/target/target_core_base.h | 1 + 6 files changed, 57 insertions(+), 12 deletions(-) diff --git a/drivers/target/loopback/tcm_loop.c b/drivers/target/loopback/tcm_loop.c index fbacccdd2ff6..8e4035ff3674 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 d5860c1c1f46..a5f58988130a 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(submit_type); #define DEF_CONFIGFS_ATTRIB_STORE_U32(_name) \ static ssize_t _name##_store(struct config_item *item, const char *page,\ @@ -1231,6 +1232,24 @@ static ssize_t emulate_rsoc_store(struct config_item *item, return count; } +static ssize_t submit_type_store(struct config_item *item, const char *page, + size_t count) +{ + struct se_dev_attrib *da = to_attrib(item); + int ret; + u8 val; + + ret = kstrtou8(page, 0, &val); + if (ret < 0) + return ret; + + if (val > TARGET_QUEUE_SUBMIT) + return -EINVAL; + + da->submit_type = val; + return count; +} + CONFIGFS_ATTR(, emulate_model_alias); CONFIGFS_ATTR(, emulate_dpo); CONFIGFS_ATTR(, emulate_fua_write); @@ -1266,6 +1285,7 @@ CONFIGFS_ATTR(, unmap_zeroes_data); CONFIGFS_ATTR(, max_write_same_len); CONFIGFS_ATTR(, alua_support); CONFIGFS_ATTR(, pgr_support); +CONFIGFS_ATTR(, submit_type); /* * dev_attrib attributes for devices using the target core SBC/SPC @@ -1308,6 +1328,7 @@ struct configfs_attribute *sbc_attrib_attrs[] = { &attr_alua_support, &attr_pgr_support, &attr_emulate_rsoc, + &attr_submit_type, NULL, }; EXPORT_SYMBOL(sbc_attrib_attrs); @@ -1325,6 +1346,7 @@ struct configfs_attribute *passthrough_attrib_attrs[] = { &attr_emulate_pr, &attr_alua_support, &attr_pgr_support, + &attr_submit_type, NULL, }; EXPORT_SYMBOL(passthrough_attrib_attrs); diff --git a/drivers/target/target_core_device.c b/drivers/target/target_core_device.c index b7ac60f4a219..0f3fd775fe6d 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.submit_type = TARGET_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 d78f24c2dfcf..1fde18e1ef3f 100644 --- a/drivers/target/target_core_transport.c +++ b/drivers/target/target_core_transport.c @@ -1576,14 +1576,7 @@ target_cmd_parse_cdb(struct se_cmd *cmd) } EXPORT_SYMBOL(target_cmd_parse_cdb); -/** - * target_submit - perform final initialization and submit cmd to LIO core - * @cmd: command descriptor to submit - * - * target_submit_prep or something similar must have been called on the cmd, - * and this must be called from process context. - */ -int target_submit(struct se_cmd *cmd) +static int __target_submit(struct se_cmd *cmd) { sense_reason_t ret; @@ -1643,7 +1636,6 @@ int target_submit(struct se_cmd *cmd) transport_generic_request_failure(cmd, ret); return 0; } -EXPORT_SYMBOL_GPL(target_submit); sense_reason_t transport_generic_map_mem_to_cmd(struct se_cmd *cmd, struct scatterlist *sgl, @@ -1905,7 +1897,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) @@ -1928,6 +1920,35 @@ void target_queue_submission(struct se_cmd *se_cmd) } EXPORT_SYMBOL_GPL(target_queue_submission); +/** + * target_submit - perform final initialization and submit cmd to LIO core + * @cmd: command descriptor to submit + * + * target_submit_prep or something similar must have been called on the cmd, + * and this must be called from process context. + */ +int target_submit(struct se_cmd *se_cmd) +{ + const struct target_core_fabric_ops *tfo = se_cmd->se_sess->se_tpg->se_tpg_tfo; + struct se_dev_attrib *da = &se_cmd->se_dev->dev_attrib; + u8 submit_type; + + if (da->submit_type == TARGET_FABRIC_DEFAULT_SUBMIT) + submit_type = tfo->default_submit_type; + else if (da->submit_type == TARGET_DIRECT_SUBMIT && + tfo->direct_submit_supp) + submit_type = TARGET_DIRECT_SUBMIT; + else + submit_type = TARGET_QUEUE_SUBMIT; + + if (submit_type == TARGET_DIRECT_SUBMIT) + return __target_submit(se_cmd); + + target_queue_submission(se_cmd); + return 0; +} +EXPORT_SYMBOL_GPL(target_submit); + static void target_complete_tmr_failure(struct work_struct *work) { struct se_cmd *se_cmd = container_of(work, struct se_cmd, work); diff --git a/drivers/vhost/scsi.c b/drivers/vhost/scsi.c index dc274463bdf0..4e3b2c25c721 100644 --- a/drivers/vhost/scsi.c +++ b/drivers/vhost/scsi.c @@ -909,7 +909,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 401abdf8a9ef..97099a5e3f6c 100644 --- a/include/target/target_core_base.h +++ b/include/target/target_core_base.h @@ -726,6 +726,7 @@ struct se_dev_attrib { u32 unmap_granularity; u32 unmap_granularity_alignment; u32 max_write_same_len; + u8 submit_type; struct se_device *da_dev; struct config_group da_group; }; From patchwork Thu Sep 28 02:09:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 13401877 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 E6559E810D5 for ; Thu, 28 Sep 2023 02:09:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230047AbjI1CJf (ORCPT ); Wed, 27 Sep 2023 22:09:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46838 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229984AbjI1CJY (ORCPT ); Wed, 27 Sep 2023 22:09:24 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 224C5B3; Wed, 27 Sep 2023 19:09:23 -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 38RL67IA000518; Thu, 28 Sep 2023 02:09:23 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=+tO2VjHVKNgGEMU7q3Tzi+M6706HlTxC8sy1II9UE1Q=; b=nAf/P4NDn30IcYIWbvS9iUeyTqmiWioCHPgGkdJPhjihIDAJmzUFV1l1UswZXK+ROa0z 3M52wHGlb/n2uSsXRdcT62VdTTY74I3tywMosqOZ9NFoYaWf0KFrT2+fHkhkUEeZ5iPA gCJ9I8+Uk20/nFuZqKFqsJkvx30wxGf88kzKigBA2Fj3tPeDK+Qys8XaA21ZBMttEWQZ AnpJFJAaMuFifEuoObsvmztn4kZ4EjR+cobHQgnC+YebD5N2/5MLRj1/8ZlItjPSW7Dn vim/EfrybIrRzlTd5zQbW8nt102+mFws0j1r74FUbOJm5DCdaX6qr1inFaB+HIvA56m6 FA== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3t9pxc34ps-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 28 Sep 2023 02:09:22 +0000 Received: from pps.filterd (iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 38S13tsb023671; Thu, 28 Sep 2023 02:09:21 GMT Received: from nam02-sn1-obe.outbound.protection.outlook.com (mail-sn1nam02lp2045.outbound.protection.outlook.com [104.47.57.45]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3t9pff0f11-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 28 Sep 2023 02:09:21 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XfgCWwb3B3kgoasng6qfEsu2aTzlOfKUGXvh8QLfCsd0hfLfsgHd/X/dtRE43LvjmsNppQtrUF0tmQ+23p0+dTEXB58hgQ0nxCeZ7zHT/cf7VRps1Umh86qX6t/TSjQBZMIbBhc0hgLdxMvvAGEmy9WPwb6EkYcKBhWOZ4t7+JhhALYsNXj5Xgfh1toPzTP9bNE8sw/cX9H6BsKZHkx0JpW1FdD1S3SeLadApGk18dB57eTvPSCyuct/VfF0PXO2dSZNgb9zomr5TDqEHh8xkv2ifxg2lTGCuSsWm52hfHKkTSYw+lRlUX0PwRu6ga7qFv9eLesUtMRpzIUljsexDg== 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=+tO2VjHVKNgGEMU7q3Tzi+M6706HlTxC8sy1II9UE1Q=; b=IB8/h6B9tV0Kxr1zU6KyD2Pc+A7K/atHMlNu+ReeNDrAIb3HPBJhrrnLNzW8BqFq4y+5kEluiX6XbHnT8FAJhEHiv5PqBqJErCcRFhraFD2uGJwrWrPrQmDVJ4zbfRA1F1mfyRdce/cyZr3zivtnZK9VYaSdKscVn684feXWGyTUlnychdSGG6/v2D+JE30rOxL2BDtB7CAr31Bazcaiv3J9Mx9DvVr9nD0bhd5Z0iPpgQL+LgXd2iLUqo1upFhv8wkqYDVKOisHSS1tkkmsbo2jiRD/qGX1BN81J7rE6SIzt5adTNtjtgfIctk3ScpPPjzokcY1uBV0bEyBkDwFuw== 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=+tO2VjHVKNgGEMU7q3Tzi+M6706HlTxC8sy1II9UE1Q=; b=FlpQmFlQ4sIzIxczFt2UNmlZO99bAj58TSKFtRzSNTtorx2QvDZnY6h4Je0SHhcccTybcAQtV2FueeuZwvtLnh8V9HqbSmLesmd1zO2zMRotjFnvYIfp5zHNRp2RaGStuuVPXRdAMkJxiXmEBExSX/wJPwkbsolHhsxy8kQLwPs= Received: from CY8PR10MB7243.namprd10.prod.outlook.com (2603:10b6:930:7c::10) by SA1PR10MB5784.namprd10.prod.outlook.com (2603:10b6:806:22a::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6792.28; Thu, 28 Sep 2023 02:09:19 +0000 Received: from CY8PR10MB7243.namprd10.prod.outlook.com ([fe80::37c3:3be:d433:74e8]) by CY8PR10MB7243.namprd10.prod.outlook.com ([fe80::37c3:3be:d433:74e8%6]) with mapi id 15.20.6813.017; Thu, 28 Sep 2023 02:09:19 +0000 From: Mike Christie To: martin.petersen@oracle.com, linux-scsi@vger.kernel.org, target-devel@vger.kernel.org Cc: Mike Christie Subject: [PATCH v2 7/8] scsi: target: Unexport target_queue_submission Date: Wed, 27 Sep 2023 21:09:06 -0500 Message-Id: <20230928020907.5730-7-michael.christie@oracle.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230928020907.5730-1-michael.christie@oracle.com> References: <20230928020907.5730-1-michael.christie@oracle.com> X-ClientProxiedBy: DS7PR05CA0053.namprd05.prod.outlook.com (2603:10b6:8:2f::34) To CY8PR10MB7243.namprd10.prod.outlook.com (2603:10b6:930:7c::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY8PR10MB7243:EE_|SA1PR10MB5784:EE_ X-MS-Office365-Filtering-Correlation-Id: ca964062-c866-4186-ec4b-08dbbfc7ec8e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: VlsWm8QONn8qSBZ1JPDN8k7DONlzaq8tgq54OOGWXSlVRTn0adhquuqWQHyPlMsv+eqpULAVAUKzAsYzMJC4DmigSwyc6rK5yWu4A34HHH0YFUqWUntdFn3QLS1pF82bYMijyW3Ybr4heD/LRc4F8Zv8LlBtvtu+jN0VmuVpT2U+TXQSqvLHtggsgcbog2UwRpWbx2i8K5YtWlspbHSV/sWHtgNHkLbPYdbGmsD/tzVZBD0FQVlA/SUh1RnFROwTYiSCh98si5aq/yAQyWwFiHdhhmBvnJWKUxyszjmQj/sf9p3DBRGVDqvNj/EnyHY8CTO7h+XTlMdxf/zL03EhClYmnOv1n/FMeR0vUx+TIPtyFeRHtZGvtsxkHqVgzyQ0TCTjfwFULrTzFwgthyDVCEXRJPY2qMF4R0PS9+1gZgYums6J01eKPcf4AqOJfiTOEb+MvZN0egvTcdXofOhSMnznoqrCN1uAP/m8ITbf3znT7hnMclMr79pkDLvYVuHfYs7eI6AcWoBkoV7m739E2EOe/QXLdFysbcPkwkbFQR9GpNk99at50WXD+vJN4Jmy X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CY8PR10MB7243.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(39860400002)(136003)(376002)(346002)(396003)(366004)(230922051799003)(64100799003)(451199024)(1800799009)(186009)(6666004)(6506007)(6486002)(83380400001)(2906002)(478600001)(1076003)(5660300002)(4326008)(107886003)(66476007)(8676002)(66556008)(450100002)(66946007)(8936002)(2616005)(41300700001)(316002)(38100700002)(26005)(6512007)(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cXg7gdVh7R/xEDBfZkkTnki/htZcpT/4kWEmIxOHDxYzOqPPDj8SFX0E7uVOxJTgFgjVvLutVvyC/FZlN4kSypijJkfUwQK4Ne6UhuGwIz/u6/9NGl+/bAPqfnMZSwR8iP1SK/S1MsNv6sBjLWJosi18hhiqNzkK/H/wulxP3/H390MIF4WPZGAHsfQ+EXu95iBf7icOyy5CGUW5Dhx92ZXyPUaC/TpuhZ650ffQ15+X3A3bXgE7puU0aX3Gsx5jK/hG9Ge41dslXL8U6iy6NmCu/rlcKK3dW2usEWIrOlhQtlkpggx+PnVhERPTKncRIhjn0IYsnKFgwFHq2KfW+Pf30pkwgSvW4Y1JwWdTEWTQU1eWIV6ScI2Uq14cu1KU5i+pCRi+QLvwg39s/1Jnx1xCsFtYRyJZwM/9DwfgvoKxw== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: ca964062-c866-4186-ec4b-08dbbfc7ec8e X-MS-Exchange-CrossTenant-AuthSource: CY8PR10MB7243.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Sep 2023 02:09:19.2468 (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: 8ilxLo6aWcX4wJBQxbBBcfSh8hIEBJAFLxoiko/JcRLpPzhlRu5Rcmf/oYGkQv6ju8JMORN1acGEmDOecauKvhjTT8jnIx9KmCIapJ4oG+Q= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR10MB5784 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.980,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-09-27_17,2023-09-27_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 bulkscore=0 suspectscore=0 adultscore=0 phishscore=0 mlxscore=0 spamscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2309180000 definitions=main-2309280018 X-Proofpoint-GUID: xUM9dWykO6g4Tl1aA1wK8yKUsUeyIHB7 X-Proofpoint-ORIG-GUID: xUM9dWykO6g4Tl1aA1wK8yKUsUeyIHB7 Precedence: bulk List-ID: X-Mailing-List: target-devel@vger.kernel.org target_queue_submission is not called by drivers anymore so unexport it. Signed-off-by: Mike Christie --- drivers/target/target_core_transport.c | 3 +-- include/target/target_core_fabric.h | 1 - 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c index 1fde18e1ef3f..c81def3c96df 100644 --- a/drivers/target/target_core_transport.c +++ b/drivers/target/target_core_transport.c @@ -1908,7 +1908,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; @@ -1918,7 +1918,6 @@ 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 - perform final initialization and submit cmd to LIO core diff --git a/include/target/target_core_fabric.h b/include/target/target_core_fabric.h index a808c3c32004..3378ff9ee271 100644 --- a/include/target/target_core_fabric.h +++ b/include/target/target_core_fabric.h @@ -182,7 +182,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 Thu Sep 28 02:09:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Christie X-Patchwork-Id: 13401878 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 75B45E81810 for ; Thu, 28 Sep 2023 02:09:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229920AbjI1CJg (ORCPT ); Wed, 27 Sep 2023 22:09:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46786 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230059AbjI1CJe (ORCPT ); Wed, 27 Sep 2023 22:09:34 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8208A139; Wed, 27 Sep 2023 19:09:31 -0700 (PDT) Received: from pps.filterd (m0246617.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 38RL7Sdl003996; Thu, 28 Sep 2023 02:09:31 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=b2ohtSnePw0MUBlQYUzZ4HRx6DfTz2jCK7A/nfh6CjU=; b=axEgQ+JdOgeTeEfWQ/U6aBUw4ngySfM6Kb/kTdxEWbQRmGLHcN3I+ANh9nbTZ3+To026 Lox2rY7ET631giORgs5zSEHS8GfAR6TVZ8PhdR7OWzeEriH9+46A+b0lduKKszEx+uXM CceyU74HhQw5LgDXBS1UeM85CgTnd1e79Obhe4lmeissGD8fFhs23Smv0Tyt04kfD9aQ yzJBB+CPbHDe9EcDYR+UqRl9gRLpUbttE59qWcVd8F9OMsTHCG6zAsY4X0m9hM4XgJlo gA53x7rAYw4dT+zydpqsQo45+tASjEHlJpOlpcP8C5y38TyReRrBoADwteZKjk9B1axP 6A== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3t9rjuk1bm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 28 Sep 2023 02:09:31 +0000 Received: from pps.filterd (iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 38RN0Gsc039385; Thu, 28 Sep 2023 02:09:22 GMT Received: from nam02-sn1-obe.outbound.protection.outlook.com (mail-sn1nam02lp2047.outbound.protection.outlook.com [104.47.57.47]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3t9pff0f1x-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 28 Sep 2023 02:09:22 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CPRELxzR0JOehcFNQJUFlUNS7gxCl0+L54rXLXBnib4cHfJnshyvC+zcDibYxdc4EZGmtZRsN67Lo8u9aMq/vkHwWFt6vuV+C6mpRGuoEujo/BwH5grOTqBTj/V80YWxGCFIfTJuAJ7YtMfzHXQBgnJazTSvDbqSWvorYamhcKU642lUuoVCfdpJcHHbES8FZRFaeRCuCiP9prr+9ldlIgssG3BuuLuptN76zJhtCejtN5IMRVReMy1Nyc/13ZH4sPY/3WwZYIqwjQ42RFyyrJjs7If1pOQmIFpNbi92FuqUgxPBaSSLGackLWKUA9paHs6Z6jwxvti62rR+zHkmQg== 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=b2ohtSnePw0MUBlQYUzZ4HRx6DfTz2jCK7A/nfh6CjU=; b=BO86X5o5EWW45z2/EZhQ25hypaBWFT3UhyCW0aMaYrDF7ruuptBVvcwoDiE4GVcJYXo6wmA5RlWOx0zJuNVhxVLOI8hZcidotK/duLAAW0lvFHPhSIIQ4VjwKmLWi5bhgi7bGgOA9fDmUZ/XlKuDGHRuE5fgfFnzjuQOyLqjq7aAOiDgUzlzCpsAGevGrQ4hnoeQiAvWMSrT7qNmcsPnIgtpl2GJajVf3bftFol8FESPWr+iV8d4MzkECMC/A6pTUOpgKteqtoDW8Rgn6zQLem8OGxessKVTc9kGtVV3Amc+Rl1pz3ETucDE+N8AVICM9NJlnIdoLPn6DqiaoGHjQw== 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=b2ohtSnePw0MUBlQYUzZ4HRx6DfTz2jCK7A/nfh6CjU=; b=NN9HHXGEJwwbZz2WbV9vncVIA5wp3lMmj3Wumei+Ng8E8WiG6hTD0UXHpfvXgCKe9ez/oYetod3XxceaG/p4pIAWookDpGxhmnc1feWwfaluHtru3m0roFb5YEbrR66S2aMDA3PmYa077njsh37GQP6v2un5wP48V7EjuOTyeKo= Received: from CY8PR10MB7243.namprd10.prod.outlook.com (2603:10b6:930:7c::10) by SA1PR10MB5784.namprd10.prod.outlook.com (2603:10b6:806:22a::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6792.28; Thu, 28 Sep 2023 02:09:20 +0000 Received: from CY8PR10MB7243.namprd10.prod.outlook.com ([fe80::37c3:3be:d433:74e8]) by CY8PR10MB7243.namprd10.prod.outlook.com ([fe80::37c3:3be:d433:74e8%6]) with mapi id 15.20.6813.017; Thu, 28 Sep 2023 02:09:20 +0000 From: Mike Christie To: martin.petersen@oracle.com, linux-scsi@vger.kernel.org, target-devel@vger.kernel.org Cc: Mike Christie Subject: [PATCH v2 8/8] scsi: target: Export fabric driver direct submit settings Date: Wed, 27 Sep 2023 21:09:07 -0500 Message-Id: <20230928020907.5730-8-michael.christie@oracle.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230928020907.5730-1-michael.christie@oracle.com> References: <20230928020907.5730-1-michael.christie@oracle.com> X-ClientProxiedBy: DS7PR03CA0289.namprd03.prod.outlook.com (2603:10b6:5:3ad::24) To CY8PR10MB7243.namprd10.prod.outlook.com (2603:10b6:930:7c::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY8PR10MB7243:EE_|SA1PR10MB5784:EE_ X-MS-Office365-Filtering-Correlation-Id: 715d8e57-aad7-4082-4b44-08dbbfc7ed6a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ksQXm4wMFWoJmzLBnt63smXUsoKo+wN8iXKtb7e50FkOn5XeK7WQww8pbvxMYrzXL+y+/3naBEtZOrV+zsGtyHgsV067orMQNG4TkeoP/eQBSv+ksCNSlIhaPRhvWxYb30DIipQCou5dBtz6bYmVn6dYqVaz1mwDa3kSg+5A6OOX7Z8Q2hxvgKSER9pnj+jGVwnYioc4LGJZO8X52P/GgfP2PJvBZJaKLemKTWrB5C835piEIknWyyiKeqFKgnyfnUNtEYs4LGbIouMiqOvC1DvrvqjbT7YqaHABjt+GBfx3GnIAajRn1zQyqelYTOCmax8eSumBjRnL3oFQrzh9DkMZPqAoy2T34mTJufGwajcbz5YxX0yWAeiqdDCMTuOSG7F7ew8l6fFFGIFLZCUcGtb99LQaBdVaF115Vvr/8blwl9bvf3foyNI3tWsfdTnmBEZHVUfHLS22rjVhg2b9ltAk7SN0hCfXnZ+0MJSCWHx1kDhKDbYpfoMCTDtSE2HyRL8tt7hUMFVYadWqE+ji0EhsD0Prxrrvo5MBdIQmVpLup9VD/KxPqG7Ck+Tdg7XM X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CY8PR10MB7243.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(39860400002)(136003)(376002)(346002)(396003)(366004)(230922051799003)(64100799003)(451199024)(1800799009)(186009)(6666004)(6506007)(6486002)(83380400001)(2906002)(478600001)(1076003)(5660300002)(4326008)(107886003)(66476007)(8676002)(66556008)(450100002)(66946007)(8936002)(2616005)(41300700001)(316002)(38100700002)(26005)(6512007)(86362001)(36756003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: hR1PZ2bgqNiDG8y24kM+qe/lZGQWELgPZEHh+djPhJA1gm3MOh3KpfzAclWXBBWgfA/xDZKN3kjlyekQ+5x5HUCijs2oj1OFRhuwTBEgHo2gD0gKmSRJSuMJhoWtwDMhAlIqQzYryUI/rZtKoJ50oQKfjpR8EBAURruEYjppN6ugz1CiJ1tIgJKa9+cjymGtDqlxQzYOh7uHBtetDBnOh9E7wdqScZ2cYwNiT/F0d5OXMQVZCktiadLm5LtkmpNZPAqtFoF6KQ7+e1LO7Qtuvp3aSdYJYJHn6CDprTg7SONNsaT2H11iL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XPBjB3ZxHLfUVwBQN19KbaNxCfmpqpxOw== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 715d8e57-aad7-4082-4b44-08dbbfc7ed6a X-MS-Exchange-CrossTenant-AuthSource: CY8PR10MB7243.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Sep 2023 02:09:20.7033 (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: CluenCnSfPLwkRIkIbCbEPj7P9Kdd3nWrvaom8gZYd+VoOU2xFAwp7ltq7yatm6+FFKgEO53/qL1e7lDefKnEiNybdB/cU4uACGSJSTablc= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR10MB5784 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.980,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-09-27_17,2023-09-27_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 bulkscore=0 suspectscore=0 adultscore=0 phishscore=0 mlxscore=0 spamscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2309180000 definitions=main-2309280018 X-Proofpoint-ORIG-GUID: 8yGyezJ_BA-wmegJ3P89LWdIB3ao3UKW X-Proofpoint-GUID: 8yGyezJ_BA-wmegJ3P89LWdIB3ao3UKW 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. The new files allow the fabric to report what submission types they default to and if they support direct submission: default_submit_type: 1 - TARGET_DIRECT_SUBMIT - If the user has not requested a specific value then the fabric requests direction submission. 2 - TARGET_QUEUE_SUBMIT - If the user has not requested a specific value then the fabric requests queued submission. Note that these fabric values are based on what the fabric driver currently defaults to for compat with exiting setups. direct_submit_supported: 0 - The fabric does not support direct submission. 1 - The fabric supports direct submission. Signed-off-by: Mike Christie --- drivers/target/target_core_fabric_configfs.c | 24 ++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/drivers/target/target_core_fabric_configfs.c b/drivers/target/target_core_fabric_configfs.c index b7c637644cd4..7156a4dc1ca7 100644 --- a/drivers/target/target_core_fabric_configfs.c +++ b/drivers/target/target_core_fabric_configfs.c @@ -1065,8 +1065,32 @@ 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_submit_type_show(struct config_item *item, + char *page) +{ + struct se_wwn *wwn = container_of(to_config_group(item), struct se_wwn, + param_group); + return sysfs_emit(page, "%u\n", + wwn->wwn_tf->tf_ops->default_submit_type); +} +CONFIGFS_ATTR_RO(target_fabric_wwn_, default_submit_type); + +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 sysfs_emit(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_submit_type, + &target_fabric_wwn_attr_direct_submit_supported, NULL, };