From patchwork Thu Jun 30 09:14:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 12901484 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 B6B81CCA47B for ; Thu, 30 Jun 2022 09:14:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234121AbiF3JOt (ORCPT ); Thu, 30 Jun 2022 05:14:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43472 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234070AbiF3JOV (ORCPT ); Thu, 30 Jun 2022 05:14:21 -0400 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2044.outbound.protection.outlook.com [40.107.223.44]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B29E8240BD; Thu, 30 Jun 2022 02:14:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=O78+PXr+/vRNNfMOz4Yb2KznlTwvP67uZxl5Ojqy8HKxYLG6/N4NJDn9smRnrauVi/qZJWY2HxK41iYJtzhBVHAnt5KzYZ7L825KNuTg8wPpSDwhEBCKPCFBq0OXvN9Ud2SZ5FrMHHh8+CU0RVmcSrOPCOZWgpThGaDXpQ7ZT+yP+F3OuBIkMquw4gPe1i+eTqpTmiHY73V4S1DhheyBPuyURC68tE6Yr/eSoZF12OXqkKQKIwxn8bQ7DjvTP8g/x3vsUwcpbU2W5oGy3P1sr7mSJrNK4/lwRD3JxGQaMPSPdUT2FjwXptIeQs/AJdvn/+UEHDYrn79FVg6Vr8EFHA== 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=ZIKYgSi8FEB/8bYaiu7+YXsjGTNBlPiCSGf24gXOvP0=; b=c1yFad5iqED7PWvjrvExCjG8RVw6h+d1GN0mvgpucgHR/19Ir7LyYKLXkKzh48ZOvzRISRTDWAI00ZYuX9/vl/5zv7H3vPoF2i+SjLkJUzBdOAhos3BOM3APIN2LHPqSyBEGzViGcIy6DGY/DaJqCbFYNU2JkPNYDcBvZisX77GUYxsGI/kDhopDMNuMGvQgd/2NhGCWjnEnNMf8/a0VI5v+VQoOzyLv446obUzAHOpTwz7AucmxOvQNNBUibupSKwEb7sM+k0liT3+0CVI4JetUy276UGMWuf1Ea70JdgnWrHFfH19SD4WaJONm2YGDZYgPFoLl+JKh3j5vghPFgQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 12.22.5.235) smtp.rcpttodomain=grimberg.me 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=ZIKYgSi8FEB/8bYaiu7+YXsjGTNBlPiCSGf24gXOvP0=; b=XT4AqCgKnjZhOq7UysnjA48CUcBpJktVwwptG1hE0Aj4Z5sgdSyJjm02HPzIeeqY4T2qRT+FYARF7mUJGsT00KBfQrre9CWO8uJLg4yUoRmLaZjW6G32VXsZApRghisKFRUmQIuORj+YFCCkfuUCnT+2cLpysEPYgcjzV/GrvqxYzJ1n6Inj5wTWMKFYyBWiKi8If85ryLm3Z+JAD71NfqAqPij8fuP5oqCRHtEWRaGTbIpwfrc2A39pzLnqobhhq6yn7AYKMHonRIhmh03cYFDDxQEebVz/ApBCCSiTqjP/Wh3bNqL9ss+aRcfij8iI+jcV/ug852zgVV9hqkekHQ== Received: from MW4P221CA0008.NAMP221.PROD.OUTLOOK.COM (2603:10b6:303:8b::13) by DM5PR1201MB0153.namprd12.prod.outlook.com (2603:10b6:4:57::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5373.18; Thu, 30 Jun 2022 09:14:17 +0000 Received: from CO1NAM11FT058.eop-nam11.prod.protection.outlook.com (2603:10b6:303:8b:cafe::c6) by MW4P221CA0008.outlook.office365.com (2603:10b6:303:8b::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5395.15 via Frontend Transport; Thu, 30 Jun 2022 09:14:17 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 12.22.5.235) 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 12.22.5.235 as permitted sender) receiver=protection.outlook.com; client-ip=12.22.5.235; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (12.22.5.235) by CO1NAM11FT058.mail.protection.outlook.com (10.13.174.164) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.5395.14 via Frontend Transport; Thu, 30 Jun 2022 09:14:17 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by DRHQMAIL107.nvidia.com (10.27.9.16) with Microsoft SMTP Server (TLS) id 15.0.1497.32; Thu, 30 Jun 2022 09:14:17 +0000 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.26; Thu, 30 Jun 2022 02:14:15 -0700 From: Chaitanya Kulkarni To: , , , CC: , , , , , , , , , , , , , , , , , , , , , , , , , , , , Chaitanya Kulkarni Subject: [PATCH 0/6] block: add support for REQ_OP_VERIFY Date: Thu, 30 Jun 2022 02:14:00 -0700 Message-ID: <20220630091406.19624-1-kch@nvidia.com> X-Mailer: git-send-email 2.29.0 MIME-Version: 1.0 X-Originating-IP: [10.126.230.35] X-ClientProxiedBy: rnnvmail203.nvidia.com (10.129.68.9) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 628ae762-7407-4cae-de06-08da5a78e8d6 X-MS-TrafficTypeDiagnostic: DM5PR1201MB0153:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 6/CSXdVuDm4VgZZ7KnSaQw8/9wahZ/W4fqekKNVqoE7rR3EvjUreUjly9M0kx8w55tIIulIQgcLfIiyKLcQOkB8PZmwuhGxJIVb1r/FSntQ2/goUb3uLu7Up/4bPebu4yZGb68Hv2ZGpBav1bbrAcEWW7mC8l4u2gy4iQr9soB4IZ7gkAsecew7NmekiujRNUo0SMF8ymzpXpfO3lH1NSkGTGkDSu4u07lrwkfvcpDrrvVRbFKp+vmPW9adHOknDpYSxXuqE4JByBYZfJrnZ0WHiViiMY514rO6T2Yc3IGOSHg6iKP59W5jddhHn2+Y/XBiljqYpn+iEA5uwcNu4KIb9laGPARLNH5BeER+cLk2MpkGR0bAg0tGyOGMe/CvnoDzbd50X7U0MV/vY6hSVEJICNbA2KErMl21kLQQH5/fE8rCgkFZltS99Z5ZrOom87ATkymfZnbjXtA8IeMX6TK5neGMbC4xHmfeemEfw7irMF+PPwA1ysf9w24O/BQH1j09KI8YAuESicU3fIvlbxORhH9d1Nh0w94DWnAJbS/sCFs1C3hgik2ZmnxrOr3I8/qu8RVtOgTdgnWvcbriAXQzfP3ZwlIj6AvQYFFb9pAtxUW+KdpDTaxLGPihv6+iPx46Gy4s85LmRXnrAV6T6uzL+j77f1sYPv3hIClq8ZdAZ9NG6FtEbicHZaBO/e5auPm6504nuV8+xwW+22WH41naOf59uRnIpVNEuDOgriK5HWocvJSVkw64Qoskvgx/PSTVebced+QUtiYq1zq/krZHzJKF55Kk+wXMC73C7ILOK9rxfLC8w97/4hCaTFtTN/NLFYVUvFA4O2tBirONHWMfjhd0iAd8Z7Q4LG03qbOhE8O6Vy8BPkCfNOekyvGp9HgEL0uc9cim3ILJMChqapq9O7s8jCufpNR+1B8Y/0pq42adM1HrqGYGWUmcwb4D0V5ZRsmR5ddN61ZSXNSBKjA== X-Forefront-Antispam-Report: CIP:12.22.5.235;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:InfoNoRecords;CAT:NONE;SFS:(13230016)(4636009)(39860400002)(396003)(376002)(346002)(136003)(46966006)(40470700004)(36840700001)(47076005)(82310400005)(356005)(83380400001)(30864003)(107886003)(8936002)(2906002)(36756003)(5660300002)(16526019)(7406005)(186003)(1076003)(110136005)(2616005)(426003)(336012)(54906003)(316002)(81166007)(7416002)(966005)(36860700001)(8676002)(70206006)(4326008)(70586007)(7696005)(40480700001)(40460700003)(6666004)(82740400003)(478600001)(26005)(41300700001)(36900700001)(2101003);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Jun 2022 09:14:17.3911 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 628ae762-7407-4cae-de06-08da5a78e8d6 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[12.22.5.235];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT058.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR1201MB0153 Precedence: bulk List-ID: X-Mailing-List: linux-raid@vger.kernel.org Hi, This adds support for the REQ_OP_VERIFY. In this version we add support for block layer. NVMe host side, NVMeOF Block device backend, and NVMeOF File device backend and null_blk driver. In this version we also add a new blkverify userspace tool along with the testcases patch for the util-linux, this patch will be followed by the this series. Below is the summary of testlog :- 1. NVMeOF bdev-ns null_blk verify=0 (triggering bdev emulation code) :- ----------------------------------------------------------------------- linux-block (for-next) # blkverify -o 0 -l 40960 /dev/nvme1n1 linux-block (for-next) # dmesg -c [ 1171.171536] nvmet: nvmet_bdev_emulate_verify_work 467 linux-block (for-next) # nvme verify -s 0 -c 1024 /dev/nvme1n1 NVME Verify Success linux-block (for-next) # dmesg -c [ 1199.322161] nvmet: nvmet_bdev_emulate_verify_work 467 2. NVMeOF bdev-ns null_blk verify=1. ----------------------------------------------------------------------- linux-block (for-next) # blkverify -o 0 -l 40960 /dev/nvme1n1 linux-block (for-next) # dmesg -c [ 1257.661548] nvmet: nvmet_bdev_execute_verify 506 [ 1257.661558] null_blk: null_process_cmd 1406 linux-block (for-next) # nvme verify -s 0 -c 1024 /dev/nvme1n1 NVME Verify Success linux-block (for-next) # dmesg -c [ 1269.613415] nvmet: nvmet_bdev_execute_verify 506 [ 1269.613425] null_blk: null_process_cmd 1406 3. NVMeOF file-ns :- ----------------------------------------------------------------------- linux-block (for-next) # blkverify -o 0 -l 40960 /dev/nvme1n1 linux-block (for-next) # dmesg -c [ 3452.675959] nvme_setup_verify 844 [ 3452.675969] nvmet: nvmet_file_execute_verify 525 [ 3452.675971] nvmet: nvmet_file_emulate_verify_work 502 [ 3452.675972] nvmet: do_direct_io_emulate_verify 431 linux-block (for-next) # nvme verify -s 0 -c 1024 /dev/nvme1n1 NVME Verify Success linux-block (for-next) # dmesg -c [ 3459.794385] nvmet: nvmet_file_execute_verify 525 [ 3459.794389] nvmet: nvmet_file_emulate_verify_work 502 [ 3459.794391] nvmet: do_direct_io_emulate_verify 431 4. NVMe PCIe device. ----------------------------------------------------------------------- linux-block (for-next) # modprobe nvme linux-block (for-next) # blkverify -o 0 -l 40960 /dev/nvme0n1 linux-block (for-next) # dmesg -c [ 2763.432194] nvme nvme0: pci function 0000:00:04.0 [ 2763.473827] nvme nvme0: 48/0/0 default/read/poll queues [ 2763.478868] nvme nvme0: Ignoring bogus Namespace Identifiers [ 2766.583923] nvme_setup_verify 844 Here is a link for the complete cover-letter for the background to save reviewer's time :- https://patchwork.kernel.org/project/dm-devel/cover/20211104064634.4481-1-chaitanyak@nvidia.com/ -ck Chaitanya Kulkarni (6): block: add support for REQ_OP_VERIFY nvme: add support for the Verify command nvmet: add Verify command support for bdev-ns nvmet: add Verify emulation support for bdev-ns nvmet: add verify emulation support for file-ns null_blk: add REQ_OP_VERIFY support Documentation/ABI/stable/sysfs-block | 12 +++ block/blk-core.c | 5 + block/blk-lib.c | 155 +++++++++++++++++++++++++++ block/blk-merge.c | 18 ++++ block/blk-settings.c | 17 +++ block/blk-sysfs.c | 8 ++ block/blk.h | 4 + block/ioctl.c | 35 ++++++ drivers/block/null_blk/main.c | 20 +++- drivers/block/null_blk/null_blk.h | 1 + drivers/nvme/host/core.c | 33 ++++++ drivers/nvme/target/admin-cmd.c | 3 +- drivers/nvme/target/core.c | 14 ++- drivers/nvme/target/io-cmd-bdev.c | 75 +++++++++++++ drivers/nvme/target/io-cmd-file.c | 152 ++++++++++++++++++++++++++ drivers/nvme/target/nvmet.h | 4 +- include/linux/bio.h | 9 +- include/linux/blk_types.h | 2 + include/linux/blkdev.h | 22 ++++ include/linux/nvme.h | 19 ++++ include/uapi/linux/fs.h | 1 + 21 files changed, 601 insertions(+), 8 deletions(-)