From patchwork Mon Oct 10 17:00:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 13002753 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 D8CF6C433FE for ; Mon, 10 Oct 2022 17:01:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229641AbiJJRBH (ORCPT ); Mon, 10 Oct 2022 13:01:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52770 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229672AbiJJRBG (ORCPT ); Mon, 10 Oct 2022 13:01:06 -0400 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2087.outbound.protection.outlook.com [40.107.94.87]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 79B5A3FA09 for ; Mon, 10 Oct 2022 10:01:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YJS2izuA5nO5rgGgZBwgE94rxO6dmlRtgFRIzTA6jTAYOkkmBnU+1lZuwJVz4fhubU4g2ypsfRL9v5Dd+7gDvtRAJmL+gjWc8T2J9ci9C8ZI3mPQXd2+BACsWlgrkzo01Wif4VVR2p/n3pUJSQB+F7UEzCgmeWfIL5bDMvUW6dRKdsaKIzPih+Adh++KlI8Nsa8ZDgaBEaVznfzqehuQe/nK1FrHR/IcuRXB67e4Ukl23kFANZkI0wEgT6v0g3i6z27zKqwUbScnuvyrE7FZBbQcE2bXhRptG5s+20KevJJ4pGce5Q4xzClKp1ae2OI5OySE0N0Id5cBWKLfLNi1Qg== 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=TqcX13LGIxrt+38AapM+u1daoUuMxB5PQNcxzunNi4I=; b=EFfokmQLX2Tx2vYTfVs8H5H7isvlNbEADFSPZUtbL7qeAjsiFGBb1qnEnWcGwAK246HM5z8awEXb6XM20sLWdl62F5GwPNmwA5/VvhSPvcuF3UUyE16wlwo3zz5yUXCpXHW8LeziM8cAv64DbtyPnYTG4H1aUA+dABRarNQe0T/bWiX3kkDYtakIhYGsWLXlFi9v3hOLUFhtww2XrYonqDgzXaTTil2CFc/6rkv0OsbRWxCCddFZvQ3TZ03UvdG4AWFPHDBJ+tskplaVZ5fiNCOYT8BWuLMZNREuKTXtpwplUrniCx8wzaOH8FR2ern/CQhb/CnT/GlbWl8fPJcaTw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=TqcX13LGIxrt+38AapM+u1daoUuMxB5PQNcxzunNi4I=; b=mHAs4g7y4TgfFMO/kTu8ae9Lzk5dlMJVCT8e7ZAEAZ987A5PHFlV2GNuL/zC8/qSX4VdSEFj8l6Vi5Bv858QriVw0FKp2g4nl7mERuR3j4SwuXxGbKWhZJlnF0E0cK17llZ/WEjKsLM6zlSaI4cA9YN2nt+Nfn7ZCEptX1FXkFleOiCJXcVptbWQ306+zn7KHe7jHQFsgPhQjdvNf/r0oMoB9GouZHz0crQEbzwsZ3Dd0/Cmx3Kwf5G6H5OA6T3iVdn7gDRrnkpgRRYEwYOYJKggrdIs5VHrgNZLPWR50G9QNCn96xlsBZK3StoiAce1w5tZMkKxot9LfUZssTrFgQ== Received: from MW4PR04CA0102.namprd04.prod.outlook.com (2603:10b6:303:83::17) by DM4PR12MB6376.namprd12.prod.outlook.com (2603:10b6:8:a0::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.36; Mon, 10 Oct 2022 17:01:02 +0000 Received: from CO1NAM11FT079.eop-nam11.prod.protection.outlook.com (2603:10b6:303:83:cafe::f6) by MW4PR04CA0102.outlook.office365.com (2603:10b6:303:83::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5709.15 via Frontend Transport; Mon, 10 Oct 2022 17:01:02 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by CO1NAM11FT079.mail.protection.outlook.com (10.13.175.134) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5709.10 via Frontend Transport; Mon, 10 Oct 2022 17:01:02 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.26; Mon, 10 Oct 2022 10:00:50 -0700 Received: from dev.nvidia.com (10.126.230.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.29; Mon, 10 Oct 2022 10:00:49 -0700 From: Chaitanya Kulkarni To: CC: , , , , , , , , Subject: [RFC PATCH 1/6] block: add and use tagset init helper Date: Mon, 10 Oct 2022 10:00:21 -0700 Message-ID: <20221010170026.49808-2-kch@nvidia.com> X-Mailer: git-send-email 2.29.0 In-Reply-To: <20221010170026.49808-1-kch@nvidia.com> References: <20221010170026.49808-1-kch@nvidia.com> MIME-Version: 1.0 X-Originating-IP: [10.126.230.35] X-ClientProxiedBy: rnnvmail201.nvidia.com (10.129.68.8) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1NAM11FT079:EE_|DM4PR12MB6376:EE_ X-MS-Office365-Filtering-Correlation-Id: e62e075b-b445-4816-3b48-08daaae10353 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 4ZuNDf4gax3QXAEbcTAkLYNm8ZzQrE4FiwH06AnF0RajAAshr9d+hKZ/ICbDOc+e+vYM60p/bLfPdGvSLcLhq68Pta56n57Nm2xp0M3XGmet4jvSmfa6hShkxu9xfQ5aXOrD4hkuSneToj2WWAV6zLr6srzENh4x6KwRougqc7Ibr8c95NfViJvRWV4sNHH3WRXA7+PLhwwn9qtD7TyScCrr59XaVFkeV4k8L/vd3s5XU3/ZOXoVoS/F/sJI36clJGW4RMa2YYodLrlW4BT7lylJnBXYS8QEZK3ORDHmtbqUR112YuHYrMDawY1bvDa/nQqdpnb7Jvr5a26p6LqtWkZyfrhncN1sd++zYRqfr34fewYUG2Uy4IRVD+MFwwnc1e8Pw5Q1s0+pFOkLTL7STidauqYbySl9zoUJGqnGNcS0X4Nufl4tuGrCPdzGAt07PFYSX1Mk0/OZcOtXJKwWgYMVtg8gryOJraqfG+9CbTv8/rjBzeOxFofOZqZazgpYR95oRWG9fnfAw8YjFV0P0A0t7qPrbOky8LpAMg+iLWUwIeZhZkTg7DcA0Ad6fNgzA8eKwpucyRjPg44YjEQMhZ3Jv0TlGXDsYApPNSiCjjiDaeZO6ZgLMUCEeklpuMN3rQIEID6DmtElkTYM70j6jBXqgAX4fTBDj3cWo62YXztybNNZobveP2Ho6+qeVMTp+ZOymQGsZvS0nG8xCLpvMfiHlVx3zeYhbr3OmTDjQ96IrXCRh3SNmr19wD1Nto1OnCX3QzUZXSIojEISViZ2Qg== X-Forefront-Antispam-Report: CIP:216.228.117.160;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge1.nvidia.com;CAT:NONE;SFS:(13230022)(4636009)(136003)(39860400002)(396003)(376002)(346002)(451199015)(40470700004)(36840700001)(46966006)(6666004)(8936002)(40480700001)(356005)(82310400005)(54906003)(7636003)(478600001)(2906002)(70586007)(5660300002)(70206006)(6916009)(36756003)(1076003)(186003)(82740400003)(26005)(47076005)(316002)(8676002)(426003)(16526019)(2616005)(336012)(4326008)(41300700001)(7696005)(40460700003)(83380400001)(36860700001);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Oct 2022 17:01:02.5558 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e62e075b-b445-4816-3b48-08daaae10353 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.160];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT079.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB6376 Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org Add and use a helper to initialize the common fields of the tag_set. The newly added helper blk_mq_init_alloc_tag_set() replaces existing call to blk_mq_alloc_tag_set() and takes following arguments to initialize tag_set before calling blk_mq_alloc_tag_set() :- * blk_mq_ops * number of h/w queues * queue depth * driver data The number of arguments to the new API are similar to the existing API blk_mq_alloc_sq_tag_set() used in block layer to eliminate the common code to initialize and allocate tag_set. This initialization is spread all over the block drivers. This avoids code repetation of inialization code of tag set in current block drivers and any future ones. Signed-off-by: Chaitanya Kulkarni --- block/blk-mq.c | 12 ++++++++++++ drivers/block/null_blk/main.c | 7 ++----- include/linux/blk-mq.h | 4 +++- 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/block/blk-mq.c b/block/blk-mq.c index 8070b6c10e8d..0060c6b37b69 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -4429,6 +4429,18 @@ int blk_mq_alloc_tag_set(struct blk_mq_tag_set *set) } EXPORT_SYMBOL(blk_mq_alloc_tag_set); +int blk_mq_init_alloc_tag_set(struct blk_mq_tag_set *set, + const struct blk_mq_ops *ops, unsigned int nr_hw_queues, + unsigned int queue_depth, void *driver_data) +{ + set->ops = ops; + set->nr_hw_queues = nr_hw_queues; + set->queue_depth = queue_depth; + set->driver_data = driver_data; + return blk_mq_alloc_tag_set(set); +} +EXPORT_SYMBOL_GPL(blk_mq_init_alloc_tag_set); + /* allocate and initialize a tagset for a simple single-queue device */ int blk_mq_alloc_sq_tag_set(struct blk_mq_tag_set *set, const struct blk_mq_ops *ops, unsigned int queue_depth, diff --git a/drivers/block/null_blk/main.c b/drivers/block/null_blk/main.c index 1f154f92f4c2..3b32d5231eab 100644 --- a/drivers/block/null_blk/main.c +++ b/drivers/block/null_blk/main.c @@ -1926,12 +1926,8 @@ static int null_init_tag_set(struct nullb *nullb, struct blk_mq_tag_set *set) flags |= BLK_MQ_F_BLOCKING; } - set->ops = &null_mq_ops; set->cmd_size = sizeof(struct nullb_cmd); set->flags = flags; - set->driver_data = nullb; - set->nr_hw_queues = hw_queues; - set->queue_depth = queue_depth; set->numa_node = numa_node; if (poll_queues) { set->nr_hw_queues += poll_queues; @@ -1940,7 +1936,8 @@ static int null_init_tag_set(struct nullb *nullb, struct blk_mq_tag_set *set) set->nr_maps = 1; } - return blk_mq_alloc_tag_set(set); + return blk_mq_init_alloc_tag_set(set, &null_mq_ops, hw_queues, + queue_depth, nullb); } static int null_validate_conf(struct nullb_device *dev) diff --git a/include/linux/blk-mq.h b/include/linux/blk-mq.h index ba18e9bdb799..b34d55fe79e0 100644 --- a/include/linux/blk-mq.h +++ b/include/linux/blk-mq.h @@ -707,7 +707,9 @@ struct request_queue *blk_mq_init_queue(struct blk_mq_tag_set *); int blk_mq_init_allocated_queue(struct blk_mq_tag_set *set, struct request_queue *q); void blk_mq_destroy_queue(struct request_queue *); - +int blk_mq_init_alloc_tag_set(struct blk_mq_tag_set *set, + const struct blk_mq_ops *ops, unsigned int nr_hw_queues, + unsigned int queue_depth, void *driver_data); int blk_mq_alloc_tag_set(struct blk_mq_tag_set *set); int blk_mq_alloc_sq_tag_set(struct blk_mq_tag_set *set, const struct blk_mq_ops *ops, unsigned int queue_depth, From patchwork Mon Oct 10 17:00:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 13002754 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 20E0CC433FE for ; Mon, 10 Oct 2022 17:01:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229672AbiJJRBa (ORCPT ); Mon, 10 Oct 2022 13:01:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52922 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229470AbiJJRB2 (ORCPT ); Mon, 10 Oct 2022 13:01:28 -0400 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2073.outbound.protection.outlook.com [40.107.223.73]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A08A32BD3 for ; Mon, 10 Oct 2022 10:01:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NEuUXVM+058Exstjx14rZcN9h2gbjL/Dy2lWNI5UdS6QVc81Uh9jlYRSMCqS+Rv624O0MzYdSUC/dIbrNp1bDoxGbd+rb4Ma36BpQUnO/itIqjmu5jIDfHUO6nEP1aA9oBb4sLswDP7m+UNRb8IRuNV0lj971f8FmdkB+KV9bySoSTbdFhHuEWarZ2U99GtmyHQ/DcQlFna2cLlWcwP7HC0MkD5mTCcrek6TAdtzDWx5MnvqZ61Vp4Pl3FrUWLEKENIoM/kdFFR1i5oio8DOjLaGZIXlcqafCY7/oA0cBXbFUzUmHVHCnqXEGuOqseWg7qjGa0CIfyYMEnTawI/rBA== 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=EaUozEY/eysVdgrkNyJBIgddP6G1EQqtY8ZNOZKR5no=; b=jxtPU3ccRLRaE1sL4VMTEXB01XUFRSxGfXCV6E4TeGIdj3wby28Q1wSyeF75f5jBhcTAHVXku1PH0d63SQ8K6cKW694AuGmmVis+CSG6LU1iBmuLwKknGdpfFZhJcuUwk3D8+s2msqWkBlcDPg52YhyRWARxIkLVfmLycuCG4UXg2N5yUydceT2iQ80TZ+pjwujLytPzBn+4Le85wBF1iaOrAoMFmBAxHgosncWXkiuCkZp8nThj7A3wXumAr+1/QgqYBRpgDUP4IB19a9FlaCF2dbWYsVF/32z7fP3C68gqw8WsBvdDSlsxsgOn77xKMWXqF7tIFgCVLR37wApi7w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=EaUozEY/eysVdgrkNyJBIgddP6G1EQqtY8ZNOZKR5no=; b=T324NJyeYpjOXXrb0iJBaM9MSd2dy3Hhv/U/AUBlZYaO/c/w3Qm4+EXvrqDYvn2XIxbrQh2yFP1W5pIESxM1+TwVSZ5Nu82jC/MguZTdfZvvpTpyMdxelTbGUhGYP+5ev62PLvKpNw6b751BxseG5CN/iGgvn2kW/zElYWTJdHUbijZm+BXQxfo2wOvtcYmlMAZFtjrt0Cf5fL8RLgVnQeQclBk8AGgmYrs2Q2i2rQrHLFn9rxK8YUQmlHypvUvWU7Nqp5XpC/ULlNEmZlC4TgzQFNLX1D3F3voWArJGpfbtKuXoeiKGt8ylELcXcanerxQtznWyERP/JAHPWs+0og== Received: from DM6PR02CA0139.namprd02.prod.outlook.com (2603:10b6:5:332::6) by MN0PR12MB5763.namprd12.prod.outlook.com (2603:10b6:208:376::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.36; Mon, 10 Oct 2022 17:01:23 +0000 Received: from CY4PEPF0000B8EF.namprd05.prod.outlook.com (2603:10b6:5:332:cafe::ae) by DM6PR02CA0139.outlook.office365.com (2603:10b6:5:332::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5709.15 via Frontend Transport; Mon, 10 Oct 2022 17:01:23 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by CY4PEPF0000B8EF.mail.protection.outlook.com (10.167.241.11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.13 via Frontend Transport; Mon, 10 Oct 2022 17:01:22 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.26; Mon, 10 Oct 2022 10:01:06 -0700 Received: from dev.nvidia.com (10.126.230.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.29; Mon, 10 Oct 2022 10:01:05 -0700 From: Chaitanya Kulkarni To: CC: , , , , , , , , Subject: [RFC PATCH 2/6] nbd: use init alloc tagset helper Date: Mon, 10 Oct 2022 10:00:22 -0700 Message-ID: <20221010170026.49808-3-kch@nvidia.com> X-Mailer: git-send-email 2.29.0 In-Reply-To: <20221010170026.49808-1-kch@nvidia.com> References: <20221010170026.49808-1-kch@nvidia.com> MIME-Version: 1.0 X-Originating-IP: [10.126.230.35] X-ClientProxiedBy: rnnvmail201.nvidia.com (10.129.68.8) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PEPF0000B8EF:EE_|MN0PR12MB5763:EE_ X-MS-Office365-Filtering-Correlation-Id: 18a8540d-a81f-4c2e-c5d6-08daaae10f72 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: uPp8TMl7FkJnTkDYklw3KGJ+ytEyHi1eDIvcZmCJpnYwT6ZOBarpfDpzIggF78PrRcqMzEBsrK09HyALe+9qz1M/H54Svu2Bwjh8Z11iAXKzuexMFESQKVXlwEFowArhLd2jlndmLwnoPUiEvoWH0l6Q0wW7x5kEa52P+WjUPbIqAvbE/WaVycqqUqzZQ25Zpd+Y7EAIsrhhEe1YM2xQTm6vI0C6AZCrCb0wfK83Jvn177dWTpobvzuIuj9cu5KVHRbuCNHJAa+IeYpyHVZSwsJLZfDd7tI/M06g37p4DoZqSX8UO+nA9exDuiMCH3qddQRFi8RIVfqNcLvSWDqxROWvYlk/+QesyOtiJY34WmazjkZk1r7BexGXJyxlWLa+xEEirKAE5D1Jvxkk6PkH90TuKnmJTzQUbVWaiZ0vajJEUurMOdwEC5N3VJZPddu4kl6Mbo1k748z+47OIwwLE2xb3UjAcOkurPFlirZa4Zx8hZn5bk993ohbZ6Je3BoUOnBeSKTuY6ASFzIqezVvXuP1ZvXSv8959WubpddTBF21y41PFUJo2G8l9D15oihSvigcwZoujc26cvy4nXhs+Bc7eOTZaU4V0aMQRR+m+Hjiz/fFqbegYsfIWl7XaI3bwlb6MdfXs5acpU44j2vKf1MtM7WpdzaxKKdHyClZ5lS/pm5yRnCVvvEasTRes+IS65Q4THGk1EG9dvwUEefhvCxx5l3JmtV4oad2asrObb7FBrI/f7qDHGyUDJnDdBZfJotPr8EsGWZ9k0JS+u6uhw== X-Forefront-Antispam-Report: CIP:216.228.117.161;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge2.nvidia.com;CAT:NONE;SFS:(13230022)(4636009)(136003)(396003)(39860400002)(346002)(376002)(451199015)(46966006)(36840700001)(40470700004)(83380400001)(47076005)(336012)(356005)(7636003)(16526019)(2616005)(426003)(186003)(1076003)(4744005)(82740400003)(26005)(5660300002)(41300700001)(70206006)(2906002)(40460700003)(40480700001)(54906003)(8936002)(36860700001)(7696005)(478600001)(4326008)(8676002)(6666004)(70586007)(82310400005)(316002)(6916009)(36756003);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Oct 2022 17:01:22.8171 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 18a8540d-a81f-4c2e-c5d6-08daaae10f72 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.161];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CY4PEPF0000B8EF.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN0PR12MB5763 Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org Signed-off-by: Chaitanya Kulkarni --- drivers/block/nbd.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c index 2a2a1d996a57..7a304812c280 100644 --- a/drivers/block/nbd.c +++ b/drivers/block/nbd.c @@ -1749,18 +1749,15 @@ static struct nbd_device *nbd_dev_add(int index, unsigned int refs) if (!nbd) goto out; - nbd->tag_set.ops = &nbd_mq_ops; - nbd->tag_set.nr_hw_queues = 1; - nbd->tag_set.queue_depth = 128; nbd->tag_set.numa_node = NUMA_NO_NODE; nbd->tag_set.cmd_size = sizeof(struct nbd_cmd); nbd->tag_set.flags = BLK_MQ_F_SHOULD_MERGE | BLK_MQ_F_BLOCKING; - nbd->tag_set.driver_data = nbd; INIT_WORK(&nbd->remove_work, nbd_dev_remove_work); nbd->backend = NULL; - err = blk_mq_alloc_tag_set(&nbd->tag_set); + err = blk_mq_init_alloc_tag_set(&nbd->tag_set, &nbd_mq_ops, 1, 128, + nbd); if (err) goto out_free_nbd; From patchwork Mon Oct 10 17:00:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 13002755 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 18CFBC433F5 for ; Mon, 10 Oct 2022 17:01:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229786AbiJJRBi (ORCPT ); Mon, 10 Oct 2022 13:01:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52948 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229470AbiJJRBf (ORCPT ); Mon, 10 Oct 2022 13:01:35 -0400 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2057.outbound.protection.outlook.com [40.107.223.57]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E5B242BE2B for ; Mon, 10 Oct 2022 10:01:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PP7d/8tOSaSrWzHJ7wc7y9r/03tXzN2fH2abYpgFqtaj9RvJATgh9mgvjMZ/R22LC6tAQe1uyc/HI2jZrQaA5S+uD0B4lbJorfH6Ai7t2EiVj4x+D2784kvnmsf3Bz6jTkVzz/zO3TEjd/MLPHQ5Il+Qcko766cqIziuSRBACua8kty/vkjO8xPoHXFoao1YA5M0p73Tph9VZ4LbbWOnS25JGHU/v43zc+KpWrZcAc3DNofPIoRXPdxGpvi6KAvt09WAdOfN/kCkR7wAepwIJdNGxssKzXaAWXkSEpYvU7GjvYHqMGX+QJuoiw4VRTG2hw7Ix8xboNKN89g6ZNZt/w== 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=IKmS5ZfE29c/Q777j+URajCZkuCuhg44wmnKvh6Z1mI=; b=Wv5dh2pFLwnB4pQIfapcXgsbnp2efoRmUBbxgVreV/eTDToYtcEQi6BPdN6wwchOOYuyrSKAz2igzVPvh6Patz4MrEMruaR3l514HhtzZnj95hJz1KDU+pqM3g4loviE8qEWJ92SF6CaTNSgQvGJdV9L/i+dBJsCr/yLOIyiUmkGAwuRdyo2O+3f7IHQoTv3LxciKm24E4qDCOYUv9Z0svZQPqAoUuThhZcih4OoGwwpYY83JbVxg7s4GCoCLDD0WOexAViBDGURux41F2ULxRrq/42kphVuOOOl0J+L8KhaGCr+Ax8wamx9F7rLOn9UFr4Wg6tK5hFyeRo6dG1SEA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=IKmS5ZfE29c/Q777j+URajCZkuCuhg44wmnKvh6Z1mI=; b=UDdax9ufHc6JFiMeznngH5AE6wo+UbpqWnz5nZN4MYsHlZ4sfEVxIY2JLwVADdQANIlsNzFFwyf0n197rytaiUs+zXP9B18UPUYohiqMloRRh7gPHgZwSEqrs6OtpfRvwgKdd+HeaveUp//dOAt5Ebg6fCca0T8ILGH8wu5HMmNMhlqpVcf6eCZn/B8r7LvxblQN/jrCfLEREZYFU/wZrBGmb/XKqUIrrxcYnmg4X5lAQFOSuwfY27RlqplwAnGg5Fr13yMWWniXZZtHTtAC5thYh05dPv/KSm2im1fKddIffx+x0mRQrd+wydzDlwMcxK2t6529dPCzGmnrIluCpw== Received: from CY5P221CA0078.NAMP221.PROD.OUTLOOK.COM (2603:10b6:930:9::13) by PH7PR12MB6396.namprd12.prod.outlook.com (2603:10b6:510:1fc::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5709.15; Mon, 10 Oct 2022 17:01:33 +0000 Received: from CY4PEPF0000B8E8.namprd05.prod.outlook.com (2603:10b6:930:9:cafe::ae) by CY5P221CA0078.outlook.office365.com (2603:10b6:930:9::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5709.15 via Frontend Transport; Mon, 10 Oct 2022 17:01:33 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by CY4PEPF0000B8E8.mail.protection.outlook.com (10.167.241.4) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.17 via Frontend Transport; Mon, 10 Oct 2022 17:01:33 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.26; Mon, 10 Oct 2022 10:01:18 -0700 Received: from dev.nvidia.com (10.126.231.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.29; Mon, 10 Oct 2022 10:01:17 -0700 From: Chaitanya Kulkarni To: CC: , , , , , , , , Subject: [RFC PATCH 3/6] virtio-blk: use init alloc tagset helper Date: Mon, 10 Oct 2022 10:00:23 -0700 Message-ID: <20221010170026.49808-4-kch@nvidia.com> X-Mailer: git-send-email 2.29.0 In-Reply-To: <20221010170026.49808-1-kch@nvidia.com> References: <20221010170026.49808-1-kch@nvidia.com> MIME-Version: 1.0 X-Originating-IP: [10.126.231.35] X-ClientProxiedBy: rnnvmail201.nvidia.com (10.129.68.8) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PEPF0000B8E8:EE_|PH7PR12MB6396:EE_ X-MS-Office365-Filtering-Correlation-Id: 8f5a0e06-f177-42d1-3bf0-08daaae1158b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 8WNaCRV3zdvXFF71cxQH3xwW7+PNil42gRE9KU57wHK+b/yddm3IwNwVR1cMVL4vo/LeG4+HX8fXX7jy4PHeL0pVdzuUfzRGgUhF+t/bLkqLUMXPxRX190BzRSYWr8gFET7KPZXH3OG/cVbGfse/Qu6gx/eiUOyaMuYeETKZsZ8yJJATW2szp+9xx7o8gsbjlUvwX+j+xXGWADYb0y3/XiZDOWw8WibT4XFh3CXS3YGGfO93iWv3CUaQ8Na4wkSqW1tsJMrGQy9XKj9t0rdNB18UGqXfl7D0c+fesCKkuprMdFPwbcf68nJCE9om7K2hTU2E9UT4I/To7x4W4TD0gvUJLrMPUwAh7BcE4nvzJ6Jek/shaqkxFoSqDGe/QAX+Aw5OHGgSRkPvXmoPZKBHvgsugls6nMGb7/x0NNlD4A69ymjmjSBhtSQDLyc3jYKzL/u/Udv98W1glCHjOgkwdH1froPp3ioRFSm5sob3WDn0JJw5aSyedLs/HKc7yWA0g3mARPwx5FVGegyf1ORk/JO+3dbAkT0eaayP7VryNg6GStDB9rST8gUHJG8lnpWtbIo2CJwT47Fg7S1BxlE1qsBEV0aWaPWCk+jx8RQi8/IgEaby+bWM2rNylm14oj9D4x+60kW6kUIPC6lU6nkivz5MfHmX+l8LCOEWaz4tYZfEG2BIqEDJRhf8kId+xPLGW5DXLLmK2USg2N9ryFQwhyPH3FpBsMEBHVMrqnbH8E5vhR0JK8liZO/yq1cdm5cAAYOK/ANVTbobJnJAJ9x8pQ== X-Forefront-Antispam-Report: CIP:216.228.117.161;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge2.nvidia.com;CAT:NONE;SFS:(13230022)(4636009)(396003)(376002)(136003)(346002)(39860400002)(451199015)(40470700004)(36840700001)(46966006)(70206006)(7696005)(41300700001)(36756003)(54906003)(40460700003)(478600001)(8936002)(83380400001)(40480700001)(47076005)(26005)(6916009)(4326008)(426003)(316002)(82740400003)(82310400005)(36860700001)(7636003)(356005)(6666004)(8676002)(5660300002)(70586007)(186003)(1076003)(336012)(2616005)(16526019)(2906002);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Oct 2022 17:01:33.0438 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8f5a0e06-f177-42d1-3bf0-08daaae1158b X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.161];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CY4PEPF0000B8E8.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB6396 Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org Signed-off-by: Chaitanya Kulkarni --- drivers/block/virtio_blk.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c index 23c5a1239520..57333cc90557 100644 --- a/drivers/block/virtio_blk.c +++ b/drivers/block/virtio_blk.c @@ -942,20 +942,17 @@ static int virtblk_probe(struct virtio_device *vdev) } memset(&vblk->tag_set, 0, sizeof(vblk->tag_set)); - vblk->tag_set.ops = &virtio_mq_ops; - vblk->tag_set.queue_depth = queue_depth; vblk->tag_set.numa_node = NUMA_NO_NODE; vblk->tag_set.flags = BLK_MQ_F_SHOULD_MERGE; vblk->tag_set.cmd_size = sizeof(struct virtblk_req) + sizeof(struct scatterlist) * VIRTIO_BLK_INLINE_SG_CNT; - vblk->tag_set.driver_data = vblk; - vblk->tag_set.nr_hw_queues = vblk->num_vqs; vblk->tag_set.nr_maps = 1; if (vblk->io_queues[HCTX_TYPE_POLL]) vblk->tag_set.nr_maps = 3; - err = blk_mq_alloc_tag_set(&vblk->tag_set); + err = blk_mq_init_alloc_tag_set(&vblk->tag_set, &virtio_mq_ops, + vblk->num_vqs, queue_depth, vblk); if (err) goto out_free_vq; From patchwork Mon Oct 10 17:00:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 13002756 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 BA19EC433F5 for ; Mon, 10 Oct 2022 17:01:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229470AbiJJRBz (ORCPT ); Mon, 10 Oct 2022 13:01:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53142 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229851AbiJJRBy (ORCPT ); Mon, 10 Oct 2022 13:01:54 -0400 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2046.outbound.protection.outlook.com [40.107.92.46]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 601233FA21 for ; Mon, 10 Oct 2022 10:01:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ALgrC5M11Id59DHnVzZnWcTb0MrUofnkFXlZYqp8HpqQPDGkNY8YbaJvLEVxKlvNrrrs0/Z6hwt74G5fEU+QaYuols95s0aMxOgSCf5HKggsgXppVDvDp+Kx+mc733J//kEKfa633Rj2jOpL49e5bYZndEvmMHL0G1wlslz+RSWs1lcTumRQRJM6myFbxBvtUeYm9odYkA6SC2jIdGmhPoAq2rWTubLOgiEYdNVqtAM8rIgYnBDjDlxl4l/dV/VWsfdzjY3eYAfS/uhM/9YxTADZRMdZVyIHEu0g1gno1dgp3VSHcVwEtNL4U1ObW3HHqtMzqfNq4g8rlfwSLgGrAw== 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=sc8XT2hDD65HCxC6GQQw20MIw9BjmG6MFOx3ppWkz+4=; b=M+RGSl/ZEOt4VfRixoEBro72VvWz0ShpnnbKOEv9Xs/jBa9kN0pLuJYVPmyeGeCpdZUpISsWosNUb7B1zUlY7F2ZJEAkPM8pBdNxj+cFMGZ7wasLtAYPXso3c7e4BWTAVtnEUubH18+t4bFBMM6R808tFKy6JXepDRc9MKSGNz2oRpj1n+H25QZAKk6TlymfsslrNRaVy7OqKxJu7w7uqIQd/iuyWru+eq9jegd54NYzWgb9k1bif3Dz9dZwdrpIU5OBj06qBGsMsiMMwRqSpi4SYU5Gt9qRU4NfFme1vqM2SaADubk67n986ydphdaFy4v9hLDFynQju+THWsDtkg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=sc8XT2hDD65HCxC6GQQw20MIw9BjmG6MFOx3ppWkz+4=; b=Oa5Uuj1RlfwYD/N5tFPL2zgNySK6UhIK/zENnFa3Aln/ulUtTHF1FVxktGqaItnq45AosoE05sBBBHtoA4z3QYEKi8O0OdbJvb32uJSUyFG/+1p8esBOeEgU8aEjnfTRyY1xdIthkfjBD/pRlHwi1LfLI0266HmJMhs6ATYdMsErA6jae2sfE/hkUZ1oPpQbMIkSqPxDONzujssfVaVVZRWqHXxZpg0BrYPMcG/oNY2mwdIv5Z7T+kxJMVIc+wP+DIm0uFVKMYDKkUSQP5YCaH+kwA0ZLVDopTxE/iFAmCjZxy6MJvrFvC7XMDdT5T1cZ+U0xyb6bK3z7gGu9dbN8A== Received: from CY5P221CA0102.NAMP221.PROD.OUTLOOK.COM (2603:10b6:930:9::33) by MW3PR12MB4457.namprd12.prod.outlook.com (2603:10b6:303:2e::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5709.15; Mon, 10 Oct 2022 17:01:49 +0000 Received: from CY4PEPF0000B8E8.namprd05.prod.outlook.com (2603:10b6:930:9:cafe::d3) by CY5P221CA0102.outlook.office365.com (2603:10b6:930:9::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5709.15 via Frontend Transport; Mon, 10 Oct 2022 17:01:49 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by CY4PEPF0000B8E8.mail.protection.outlook.com (10.167.241.4) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.17 via Frontend Transport; Mon, 10 Oct 2022 17:01:49 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.26; Mon, 10 Oct 2022 10:01:29 -0700 Received: from dev.nvidia.com (10.126.231.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.29; Mon, 10 Oct 2022 10:01:28 -0700 From: Chaitanya Kulkarni To: CC: , , , , , , , , Subject: [RFC PATCH 4/6] nvme-apple: use init alloc tagset helper Date: Mon, 10 Oct 2022 10:00:24 -0700 Message-ID: <20221010170026.49808-5-kch@nvidia.com> X-Mailer: git-send-email 2.29.0 In-Reply-To: <20221010170026.49808-1-kch@nvidia.com> References: <20221010170026.49808-1-kch@nvidia.com> MIME-Version: 1.0 X-Originating-IP: [10.126.231.35] X-ClientProxiedBy: rnnvmail201.nvidia.com (10.129.68.8) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PEPF0000B8E8:EE_|MW3PR12MB4457:EE_ X-MS-Office365-Filtering-Correlation-Id: 0adc84ea-0b15-4e5a-4fcf-08daaae11f44 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 5WKvCvbf9AykPeetcGKk+tiR/cZdw2bXjX2lzsPpZjYiJcFLVjb/Vi78qv1NV3EebGvx2tA0GpA8cAb+9pF/+htxSWxBqjHAr+CW4bGpApD4GqtKwanPFGw035NtVx1TSfZiGPYtOPzdwYVNDl7+Ixk/MsHjRnXvn/QJlCd8ixgAj5YyTb6LaWRSpPhkYiy4nqZ5q56A5vzgvJkHjEnCnt6M2yvGk4Xayb2K7v4QWnBhSuY0LV/r2DCOGHqAe2fe6Iz0xNhLaG8O7QWMGKf85xHlj6BOJdBapWPf/C/EZtdHRZNLqRMzFtc4p5JA7/MQDDoG4CqY9V3ewvPHXM0XEpuAV0C7GMeZ6Ihhka3xKV4kNZ3llKsqDzpvYhD219Phq9VuBamdndgDzdIqtOynDW5BCvhVM5gne/Ot2fQiGq8atrNbYhvo+d81b+R0UIR3/+XZ55fg85wfe9Teqe0acc2H7snwIXlHU3+GFgca6usVgLFjzo4s5WibnYHko+YDOJsWGd9IA5g2E2lG2+byLJH4VgJtAn+619Z8i2SDXVeReUoEdeYQWjkbBGRb3g4oY5NIQ8QOIinmkuSvYFtQ8q13aD8dg0nd7GDql2AbpxNu4qQRw0XB+ENYfL2lXQJm09Q0B5hNw3hgScnpTtitbYQWohHTmKzacuDBi8qO6kv+ZNFcgqRSERMqF1gDdkUXcZ9gb+pdkmRJG1ttgNq/KHoltm2R7XLL+ZkQ/pB2F3Cagz+4h8AY4FhpBHJfpFWoVKspJcJCRt/nHremUYN6lJ+0diKIM/m0uzqiyF4u0Fw0IP+7opTVfY0jEdGndQDs X-Forefront-Antispam-Report: CIP:216.228.117.161;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge2.nvidia.com;CAT:NONE;SFS:(13230022)(4636009)(376002)(396003)(39860400002)(346002)(136003)(47660400002)(451199015)(36840700001)(40470700004)(46966006)(2616005)(40480700001)(426003)(36860700001)(356005)(40460700003)(7636003)(8676002)(70586007)(70206006)(82310400005)(4326008)(54906003)(36756003)(6916009)(41300700001)(2906002)(6666004)(82740400003)(47076005)(316002)(83380400001)(336012)(478600001)(5660300002)(8936002)(1076003)(26005)(186003)(7696005)(16526019)(46800400005);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Oct 2022 17:01:49.3561 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0adc84ea-0b15-4e5a-4fcf-08daaae11f44 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.161];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CY4PEPF0000B8E8.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW3PR12MB4457 Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org Signed-off-by: Chaitanya Kulkarni --- drivers/nvme/host/apple.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/drivers/nvme/host/apple.c b/drivers/nvme/host/apple.c index 5fc5ea196b40..baafee23e32a 100644 --- a/drivers/nvme/host/apple.c +++ b/drivers/nvme/host/apple.c @@ -1228,16 +1228,13 @@ static int apple_nvme_alloc_tagsets(struct apple_nvme *anv) { int ret; - anv->admin_tagset.ops = &apple_nvme_mq_admin_ops; - anv->admin_tagset.nr_hw_queues = 1; - anv->admin_tagset.queue_depth = APPLE_NVME_AQ_MQ_TAG_DEPTH; anv->admin_tagset.timeout = NVME_ADMIN_TIMEOUT; anv->admin_tagset.numa_node = NUMA_NO_NODE; anv->admin_tagset.cmd_size = sizeof(struct apple_nvme_iod); anv->admin_tagset.flags = BLK_MQ_F_NO_SCHED; - anv->admin_tagset.driver_data = &anv->adminq; - ret = blk_mq_alloc_tag_set(&anv->admin_tagset); + ret = blk_mq_alloc_tag_set(&anv->admin_tagset, apple_nvme_mq_admin_ops, + 1, APPLE_NVME_AQ_MQ_TAG_DEPTH, &anv->adminq); if (ret) return ret; ret = devm_add_action_or_reset(anv->dev, devm_apple_nvme_put_tag_set, @@ -1245,8 +1242,6 @@ static int apple_nvme_alloc_tagsets(struct apple_nvme *anv) if (ret) return ret; - anv->tagset.ops = &apple_nvme_mq_ops; - anv->tagset.nr_hw_queues = 1; anv->tagset.nr_maps = 1; /* * Tags are used as an index to the NVMMU and must be unique across @@ -1254,14 +1249,13 @@ static int apple_nvme_alloc_tagsets(struct apple_nvme *anv) * must be marked as reserved in the IO queue. */ anv->tagset.reserved_tags = APPLE_NVME_AQ_DEPTH; - anv->tagset.queue_depth = APPLE_ANS_MAX_QUEUE_DEPTH - 1; anv->tagset.timeout = NVME_IO_TIMEOUT; anv->tagset.numa_node = NUMA_NO_NODE; anv->tagset.cmd_size = sizeof(struct apple_nvme_iod); anv->tagset.flags = BLK_MQ_F_SHOULD_MERGE; - anv->tagset.driver_data = &anv->ioq; - ret = blk_mq_alloc_tag_set(&anv->tagset); + ret = blk_mq_alloc_tag_set(&anv->tagset, *apple_nvme_mq_ops, 1, + APPLE_ANS_MAX_QUEUE_DEPTH - 1, &anv->ioq); if (ret) return ret; ret = devm_add_action_or_reset(anv->dev, devm_apple_nvme_put_tag_set, From patchwork Mon Oct 10 17:00:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 13002757 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 23B95C433F5 for ; Mon, 10 Oct 2022 17:02:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229887AbiJJRCB (ORCPT ); Mon, 10 Oct 2022 13:02:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53170 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229606AbiJJRB5 (ORCPT ); Mon, 10 Oct 2022 13:01:57 -0400 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2080.outbound.protection.outlook.com [40.107.237.80]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 299B53A15A for ; Mon, 10 Oct 2022 10:01:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bKEgUR/u8dvTF4Tg4uO/TbwQRtoYNVfnEleHNeKYReWuE2XYjrMPnvIiSgqPvXwXNmjj2raeWrEHoFdeCsu7boBRGh+xRWdh217gwnWsd3jEi0pZe5EaWVjQhyW8LuyfAEuajRx4LC9KS+I5SNkMiMoEyVP+U6JelwqKVJXFZ/MjBR/09DJ3qBrgo/bg+jgWNS+MvnEdyyxg9POaA3eDrdO1rUuMDI0gLBzhFMx94ro35vebIR2MDeiJVbS634GCCK/8hCOy6VOYQ0e2VyclMQcjm3NwnYjcC5S6dazej4L2MkNkFgEpL69ZM+8W1/1xcW5qLwwGxTxQil0cjxUODA== 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=C2JTODkI+74irzK0zcIIIoWdG2MUh2aj+Wde6aFLSqc=; b=Ij0R0lYBJpmzKzq62AO1YpvrRwttigYOjFl6OhLehWkhpuAmkzCbnAnv9ekyYfH3Fs1BaYBCfA0+KDfddG3sRvBO1Rvyk+1F8+1ddXTOx2FBioo7BGnt0mQMZvmkzQk9uwSraoYg53Huv0GCiXByCvmkHIE5T1YfU4fZyiRvnUja/tWRhxw0BIepjqG/ZWPf3R2ojXLNVrpVerKuOvUg9SWFEJpHhPLX9gEvuuYIF/Buhyf42D8mDo5Q2uZgJ06QVG6lh9870LIaZAQBL2YcGwM8Y5GWQVx1JKfnk99fpn5N8x9kVEgboMNeda+WDFhPpKITREt/L3RbSbB0QvlDQg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=C2JTODkI+74irzK0zcIIIoWdG2MUh2aj+Wde6aFLSqc=; b=JmLPw0EvOmBL2eXXbQc3WO0xj+yqeElWdWbn6HJ3DYsUkKazYjzh2mPGR623sXGhNspG3QppClDFNKvNlM24OczHKg1ozEc3ksHP/B72KgIuHvqTi1mfTb//7N+fYxIb5gJgZjBT3jcOOUAqTprO6NWxkU+NkpSw8Y6xZYp5fvjsTyKDvvM0uQBlc3iCHINVZQwbC3hzdNGd9P8b5V8HP41GMDXaeMHZbhWyr0Y6aNhiehEZQGaTWZteg+TlqYDMvoPdz5zF85iMx0ddyNGDPfZ5VP7WNEfr5pcAk/pApo8W60OFWsHoEjPJSWzQKKLKrHdIIHLl+elFT0IDQdH7mw== Received: from MW2PR16CA0054.namprd16.prod.outlook.com (2603:10b6:907:1::31) by MN2PR12MB4285.namprd12.prod.outlook.com (2603:10b6:208:1d7::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5709.15; Mon, 10 Oct 2022 17:01:54 +0000 Received: from CO1NAM11FT069.eop-nam11.prod.protection.outlook.com (2603:10b6:907:1:cafe::4e) by MW2PR16CA0054.outlook.office365.com (2603:10b6:907:1::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5654.26 via Frontend Transport; Mon, 10 Oct 2022 17:01:53 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by CO1NAM11FT069.mail.protection.outlook.com (10.13.174.129) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5709.10 via Frontend Transport; Mon, 10 Oct 2022 17:01:53 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.26; Mon, 10 Oct 2022 10:01:40 -0700 Received: from dev.nvidia.com (10.126.231.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.29; Mon, 10 Oct 2022 10:01:39 -0700 From: Chaitanya Kulkarni To: CC: , , , , , , , , Subject: [RFC PATCH 5/6] nvme-core: use init alloc tagset helper Date: Mon, 10 Oct 2022 10:00:25 -0700 Message-ID: <20221010170026.49808-6-kch@nvidia.com> X-Mailer: git-send-email 2.29.0 In-Reply-To: <20221010170026.49808-1-kch@nvidia.com> References: <20221010170026.49808-1-kch@nvidia.com> MIME-Version: 1.0 X-Originating-IP: [10.126.231.35] X-ClientProxiedBy: rnnvmail201.nvidia.com (10.129.68.8) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1NAM11FT069:EE_|MN2PR12MB4285:EE_ X-MS-Office365-Filtering-Correlation-Id: 6a44df2e-46ab-45ef-2483-08daaae121e2 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ULGkBzOxFpVRkcc811xOQd663uca9G02oOZpsMZrtqIsCKyVoM97cEuFVKfnQEElaDGI3eIbSLPVYnZjIB0qn45zDCKb/saEPZmbCoR1E6DnJoqdSGXkus1UGbARhBAFSaaEWDzbSPa0f1k69CuSaRzpvt4qobXqWE3WYIpqHlC7wxobEsGcZXjrd+nrUPG6gRXLUhhMdciUwLdOdcYnUbqu4LN4Duy3BCwWLm+eMv6PmBqywl/aNiOLDzn30icnSec0CbQxl+pZ3Eo8HTFdvFZser7VujTBSFJzIxqMSq6PCCUxjd/zoFNCItPiwQTmACFpZW0NSQbx+Vvnsu82AnsgnVHfM95OtVxfccYFQSqfr51uRYK5hHk6LzGWIE59+HrspOL/b8LT++gsNkPaRNjZH4CB0QXApyOq0SKpXTbqFDIV8WMzlS4gpDJeNt3gMWaPgr90qhOt7q1vrg8Kp76IFk6gnP6syNziIgyK8LSW6pujOXeJUzm07FNhZfOdYgURVzn3ahQmuSbxya26hSU1YsH82dX/I0TAwHGY8Fy1ZiiyR+PK9waHnbscd1FuRKBSS8sPNHA1VznJ08zr83PXe6jnRT1qjS0bnH6/6uhnUXMYjImcKYkV4JH+cb3Cx98HSi4QVfs3ak1AglZpGWkP3WZDApw3L/PvIY5oh6Tb0uCdlK3KY9Wv29vmx8llsRy9qSPLB4rMR3Hbw+SQC3E/dO7xRGui1bUw56aytIUgwjZ1PwAj8REnIp0mwbG5naRR3z+2NRgGevOqClfcHg== X-Forefront-Antispam-Report: CIP:216.228.117.160;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge1.nvidia.com;CAT:NONE;SFS:(13230022)(4636009)(346002)(136003)(376002)(39860400002)(396003)(451199015)(36840700001)(40470700004)(46966006)(7696005)(26005)(82740400003)(40480700001)(316002)(8676002)(70206006)(4326008)(70586007)(36860700001)(356005)(7636003)(40460700003)(36756003)(83380400001)(186003)(16526019)(1076003)(6666004)(82310400005)(478600001)(2616005)(47076005)(2906002)(6916009)(54906003)(336012)(426003)(5660300002)(8936002)(41300700001);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Oct 2022 17:01:53.8084 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6a44df2e-46ab-45ef-2483-08daaae121e2 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.160];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT069.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB4285 Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org Signed-off-by: Chaitanya Kulkarni --- drivers/nvme/host/core.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c index 965a4c3e9d44..bb6868f895c3 100644 --- a/drivers/nvme/host/core.c +++ b/drivers/nvme/host/core.c @@ -4814,17 +4814,13 @@ int nvme_alloc_admin_tag_set(struct nvme_ctrl *ctrl, struct blk_mq_tag_set *set, int ret; memset(set, 0, sizeof(*set)); - set->ops = ops; - set->queue_depth = NVME_AQ_MQ_TAG_DEPTH; if (ctrl->ops->flags & NVME_F_FABRICS) set->reserved_tags = NVMF_RESERVED_TAGS; set->numa_node = ctrl->numa_node; set->flags = flags; set->cmd_size = cmd_size; - set->driver_data = ctrl; - set->nr_hw_queues = 1; set->timeout = NVME_ADMIN_TIMEOUT; - ret = blk_mq_alloc_tag_set(set); + ret = blk_mq_init_alloc_tag_set(set, ops, 1, NVME_AQ_MQ_TAG_DEPTH, ctrl); if (ret) return ret; @@ -4869,18 +4865,15 @@ int nvme_alloc_io_tag_set(struct nvme_ctrl *ctrl, struct blk_mq_tag_set *set, int ret; memset(set, 0, sizeof(*set)); - set->ops = ops; - set->queue_depth = ctrl->sqsize + 1; set->reserved_tags = NVMF_RESERVED_TAGS; set->numa_node = ctrl->numa_node; set->flags = flags; set->cmd_size = cmd_size, - set->driver_data = ctrl; - set->nr_hw_queues = ctrl->queue_count - 1; set->timeout = NVME_IO_TIMEOUT; if (ops->map_queues) set->nr_maps = ctrl->opts->nr_poll_queues ? HCTX_MAX_TYPES : 2; - ret = blk_mq_alloc_tag_set(set); + ret = blk_mq_init_alloc_tag_set(set, ops, ctrl->queue_count - 1, + ctrl->sqsize + 1, ctrl); if (ret) return ret; From patchwork Mon Oct 10 17:00:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 13002759 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 9D9FDC433FE for ; Mon, 10 Oct 2022 17:02:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229899AbiJJRCO (ORCPT ); Mon, 10 Oct 2022 13:02:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53288 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229838AbiJJRCN (ORCPT ); Mon, 10 Oct 2022 13:02:13 -0400 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2075.outbound.protection.outlook.com [40.107.244.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5D8923F33A for ; Mon, 10 Oct 2022 10:02:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bvjfo40Ox6V3rwUm+utvjib33FlFHPLKZUcq1uydBDRFuSMpXIjSPVtnIghjuqXpF/atBUpqY52JIC6fzSjVt4BMndljGvlBaHkzKQsUWM2HczN/1BV1XOpf3LQVKlIiXHAxTjtc6LYtpjSX6MRdy/W3hA1aVQ9AladxPdkT3EScwbNs739yZ2BfsCZ9v66kxUEaVbSKQd6CohUxLPsREUIWKWT/VdxBMmnWpjDG/aYqSP7pl7rnFWUj36aMr42p6TiGoudzGecaxH8wZ35K0BxMnhguO8434PwUT5+G/p2ZhRg6pIhZAR1z+BO2ktKNTw/tpUws6cv6U9/m3SEKMw== 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=YGYt7wDNsJhkReIYKMLa1ALfeADXtj37NPpGS6t3jK0=; b=ncY6S8wqu81ZsWxoRPCeE047WiRgucQon31WkkikQKGiS1Px+KqEtBc1zUiIXQW5UeA7MobOhJ0IHxU/OWKqJewo/ofzBBeg6dvOqaynuV+afDNVkWs8AfzrfFFIUtqwe2n6RQ2LZkHoJwJBeE3X41DsLS+ooktiFMRNQDuOTCW1vYh8wJKe2CGwOgZxAzuVwYvIAFwDDVDLNMFaJ2i4eXtAvQWsHDIdW0ps8vCTYCa5mGS9x0LMYCotyuCWt3dcufEkXhVQAI60xbIokszUYJDwhBGzNc9YnCgqLn3ygbN5dFu0nJT/pIFeuq3+ehEYAATih9yyk/oBZSNPaO0RUg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=YGYt7wDNsJhkReIYKMLa1ALfeADXtj37NPpGS6t3jK0=; b=HNzT648xRISEqIkEPutPc9tWQic5UOOge8rG1Z5DirNDq1OV+v2Qm10hUPl9EE0qGQHx3B4jJ1EYclarJ8qv0aiaCTdmgbrEr39aPHw2ut6BdS2VYCtPWp6TRi8iIGbe4a6yv+618yBd5gk9OAa42SC1WZBqCPmNz7044E2Dq26NtFSd0CuOl1VW0pHOfAL2UwPfQ00iX8Bq9yIT6MXRV86wO2v0QMqEL6SP6hTDV0Vtr1YAjpYJm8albXM+le0lMsOdS2lOXKp3Mv++1f1wkIxADvHIRpZvHNVRYK8qTFUU2Cw0OshxV9Nk6Y1TqTVcix/aeNXMp5liBM3KBwW4Tw== Received: from CY5PR22CA0050.namprd22.prod.outlook.com (2603:10b6:930:1d::17) by PH7PR12MB7209.namprd12.prod.outlook.com (2603:10b6:510:204::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5654.16; Mon, 10 Oct 2022 17:02:10 +0000 Received: from CY4PEPF0000B8ED.namprd05.prod.outlook.com (2603:10b6:930:1d:cafe::7f) by CY5PR22CA0050.outlook.office365.com (2603:10b6:930:1d::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5709.16 via Frontend Transport; Mon, 10 Oct 2022 17:02:10 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by CY4PEPF0000B8ED.mail.protection.outlook.com (10.167.241.9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.17 via Frontend Transport; Mon, 10 Oct 2022 17:02:08 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.26; Mon, 10 Oct 2022 10:01:52 -0700 Received: from dev.nvidia.com (10.126.230.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.29; Mon, 10 Oct 2022 10:01:51 -0700 From: Chaitanya Kulkarni To: CC: , , , , , , , , Subject: [RFC PATCH 6/6] nvme-pci: use init alloc tagset helper Date: Mon, 10 Oct 2022 10:00:26 -0700 Message-ID: <20221010170026.49808-7-kch@nvidia.com> X-Mailer: git-send-email 2.29.0 In-Reply-To: <20221010170026.49808-1-kch@nvidia.com> References: <20221010170026.49808-1-kch@nvidia.com> MIME-Version: 1.0 X-Originating-IP: [10.126.230.35] X-ClientProxiedBy: rnnvmail201.nvidia.com (10.129.68.8) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PEPF0000B8ED:EE_|PH7PR12MB7209:EE_ X-MS-Office365-Filtering-Correlation-Id: e247c5cc-3b3d-4e3c-8eec-08daaae12ab6 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: RMVMAnkHUcuspSYcCC0M639n5yxvyjt+8pP+WQjgHIe6PPjtnpA1uC5z0OXUeytMaqbvB/nyugNa6vErz4f866QitZMXTHXmP6gSDUVeChN8a+wd7JIQ8wXyPj6nM60YSMhl7eEc+d11MbuhBoEHaAB0DZV82eK1LIpBplulS1A6oUd5bxiot17x8j54BudDKkzvZqb+R8s1H6zY13MI76SJHYEIoT1xGuWmfqQuSq3apG3mBCW08e0tWlzaKB7ECy2DTtc0Fffz1YimjZbXu0U4NR0qZ5HHvf14kgfxoVAvpBRSdr0dobCdI8R8LDUeSmJbzjycS4JzZaPI2aVzBxsojNexr649GfJn/DI/ecnzF8/xMBeMGknQk3y/Dd0ngRSexurXUhhiTH6VwnaHO2BJFdJWX7ZI/6MqpP4n2xdsyKpD0evCM0lZ22qNl+SCL5faLJUQ55H+JZ62nwozSrh0JYktAikYDAcwz/tTmm9F76hPbWzaxoDOQs6h9JjeLRrsdQY1AjZGe35OwZmBwd0PlFeidec1sC8UJ1qA8AOP1p1hg/qi+W3SxfScvxPlnYwHUvcEbcN3AZ+nmvrJ/XRa4mQig6v3qtmvNji/3coCJpoXFOow1w98my6TSImG2EaBJ0LD5ZliIDe0Uw2/s9kFpve81r5HcDoUvhoalVbMw7O+ZQwQ2e2px6FWG9qcXuqiLkumfOs+28Clsh6tGibeUKEsnIe2FrgpvslpTevvAsgSbBrCUrDVNtWZyhpi1Up7Y9DpjGhQuS6aijGdtA== X-Forefront-Antispam-Report: CIP:216.228.117.161;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge2.nvidia.com;CAT:NONE;SFS:(13230022)(4636009)(346002)(39860400002)(396003)(376002)(136003)(451199015)(46966006)(36840700001)(40470700004)(5660300002)(8936002)(4744005)(7696005)(336012)(82310400005)(6916009)(478600001)(83380400001)(40460700003)(54906003)(70586007)(2906002)(70206006)(316002)(36756003)(4326008)(8676002)(186003)(356005)(26005)(16526019)(47076005)(41300700001)(6666004)(426003)(7636003)(2616005)(36860700001)(1076003)(40480700001)(82740400003);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Oct 2022 17:02:08.5598 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e247c5cc-3b3d-4e3c-8eec-08daaae12ab6 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.161];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CY4PEPF0000B8ED.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB7209 Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org Signed-off-by: Chaitanya Kulkarni --- drivers/nvme/host/pci.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c index 7bbffd2a9beb..2c153c08e418 100644 --- a/drivers/nvme/host/pci.c +++ b/drivers/nvme/host/pci.c @@ -1756,6 +1756,7 @@ static void nvme_dev_remove_admin(struct nvme_dev *dev) static int nvme_pci_alloc_admin_tag_set(struct nvme_dev *dev) { struct blk_mq_tag_set *set = &dev->admin_tagset; + int ret; set->ops = &nvme_mq_admin_ops; set->nr_hw_queues = 1; @@ -1767,7 +1768,9 @@ static int nvme_pci_alloc_admin_tag_set(struct nvme_dev *dev) set->flags = BLK_MQ_F_NO_SCHED; set->driver_data = dev; - if (blk_mq_alloc_tag_set(set)) + ret = blk_mq_init_alloc_tag_set(set, &nvme_mq_admin_ops, 1, + NVME_AQ_MQ_TAG_DEPTH, dev); + if (ret) return -ENOMEM; dev->ctrl.admin_tagset = set;