From patchwork Wed Nov 30 20:29:00 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitanya Kulkarni X-Patchwork-Id: 9454857 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 9B1826074E for ; Wed, 30 Nov 2016 20:29:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9015A2015F for ; Wed, 30 Nov 2016 20:29:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 85066284A2; Wed, 30 Nov 2016 20:29:35 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0C56028497 for ; Wed, 30 Nov 2016 20:29:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757809AbcK3U3d (ORCPT ); Wed, 30 Nov 2016 15:29:33 -0500 Received: from esa2.hgst.iphmx.com ([68.232.143.124]:7899 "EHLO esa2.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757922AbcK3U3c (ORCPT ); Wed, 30 Nov 2016 15:29:32 -0500 X-IronPort-AV: E=Sophos;i="5.31,574,1473091200"; d="scan'";a="38135412" Received: from mail-co1nam03lp0016.outbound.protection.outlook.com (HELO NAM03-CO1-obe.outbound.protection.outlook.com) ([216.32.181.16]) by ob1.hgst.iphmx.com with ESMTP; 01 Dec 2016 04:29:30 +0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sharedspace.onmicrosoft.com; s=selector1-wdc-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=5mVZluCfvK6t5XbMz80wWKIhVrolxiQTEa9GWGQ4ZzU=; b=H3M6f3XMXJ1OEk0/AWMhU50u3OeOi/gyFZkv9DiQeuYAgFt194zG1785KvQEuxUqSgUgeOtnLyLtykWPrQ/qyhMkKjSsc4FkXXU2XGsjdy+ogeZDnvNQEVSh480Lkpk7DTDD5q00dkdo80NnMr2jov6oP/MohVBxGvSOOMMPmLI= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Chaitanya.Kulkarni@wdc.com; Received: from ztester-Precision-T3600.hgst.com (199.255.44.5) by CO2PR04MB2184.namprd04.prod.outlook.com (10.166.93.154) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.747.13; Wed, 30 Nov 2016 20:29:29 +0000 From: Chaitanya Kulkarni To: axboe@fb.com Cc: martin.petersen@oracle.com, keith.busch@intel.com, linux-nvme@lists.infradead.org, linux-block@vger.kernel.org, Chaitanya Kulkarni Subject: [PATCH V2 3/5] nvme.h: add Write Zeroes definitions Date: Wed, 30 Nov 2016 12:29:00 -0800 Message-Id: <1480537742-15190-3-git-send-email-chaitanya.kulkarni@hgst.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1480537742-15190-1-git-send-email-chaitanya.kulkarni@hgst.com> References: <1480537742-15190-1-git-send-email-chaitanya.kulkarni@hgst.com> MIME-Version: 1.0 X-Originating-IP: [199.255.44.5] X-ClientProxiedBy: BY2PR06CA0019.namprd06.prod.outlook.com (10.166.106.157) To CO2PR04MB2184.namprd04.prod.outlook.com (10.166.93.154) X-MS-Office365-Filtering-Correlation-Id: 6cd7700a-65fa-4a6c-3099-08d4195f9618 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:CO2PR04MB2184;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J4ktAvk/d01cODmfEI2q4ZUsy/Fpv0VkYv31O8Hwqhw X-Microsoft-Exchange-Diagnostics: 1; CO2PR04MB2184; 31:6QSlqPE64idoytthv6SQKitKOs6ohRPwnhDayC+sSfD+ZbyX36sfD6BV2tgzNkLmhXl75L2bE3NvXbpwxtFRgXlPToAkh5EHNdrNUwcSobmRtTV40yXMNmtEXfT95qvrmiRdioARS0fywQyESfs/giqzuB1CngInvFJGDY8RHwMBZsfbtzKrrjyq7i79EB5MYnohmdC7ONFne6RBZkwzXOXJzoA/egm3k/quR0gz+r6b2VC41Bp1gvGUVByf/NDZDBPvNxnZ1uAckf1uBHcJgLBI9GFxllVvng1HQyaW7Dw=; 20:5T63hWRj1qaW6+94WtkikV4wVgYv0ggbKbLNLw3NQNlGvsQR/um/ajPjs4UM1O/pbgX7ZhFSJQbqOCIkelkjTHNQV9isY7rNPWx2s9CIoVV328w4xF5H5RO5WEZOtaPDiaxFNLMC22xdRznV657XI45Eyw42zyj1ehsjw/E1zmRGI9DRn77rsfJpWBMrD9oyEkbhKfA31LIXjkUPPKYxICak14uDM8ZUJxCle47Nj7xDBi/JAxdaMucqpl4C1Cx79hrjJKHYkHn747LpEdl9V25BN3FjF4qJa8cy66CL3WybuMZV391yiwxZb77eYXWjY5bdkJDQq3FwuOsj8JCADon+ZvTuL1fDmVWmUXl6HkSoncaohl36AfExgJiLg8EBOnj1ZfPoVowv0KGHmWZFjkyJn/GX7JLqPicdHkSD4RWtAAfi80Bbmcmeik4Wqpvz8pKmt8Zy8KWzIIXUbnbnpmwWdtaNHtXtvXP3qXx7Yhn/XElYZcrBbXUydVIRIAFV X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(79135771888625); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001)(6055026)(6041248)(20161123560025)(20161123555025)(20161123562025)(20161123564025)(6072148); SRVR:CO2PR04MB2184; BCL:0; PCL:0; RULEID:; SRVR:CO2PR04MB2184; X-Microsoft-Exchange-Diagnostics: 1; CO2PR04MB2184; 4:HIrDoF9nJt5WdUZYOYdAiQMpLSTUwOHaIWH3R6AGN0XdU0lZyrgvWSZG2Fy73g7o8RliZuh+gtYqAWPq/GLMt4Tv4ruzm7US/so0pFxirhf07ITzreobqV3ZDOAELed8zuzBEdBcn+0x8gO5Wsu4bp1PJkCsnZPlGl3YK8WS61a5mt9agrWXTnC/Z8YzgZwAXt5y1nkpYvwhFiMRveMtonh3t5JHMHdasj2JBV/h57HewqadnV6J7TEegJFnNMO5wYc0T8DuWSNcO6s0dyuGA1PR6h6+s0b/BuTZNohi34THjd6oRekL2kXk0TlvyLmA0g5XXqfdbFKRz1WtxLxc3evUkB2KtUnG5M8zknWH4qbwzM5eTZsJOEHAdWvZQ3U1rd05FKwyfZIZl6Qz6qUZuQEbnrpiy+/4X7oBrmVHRTLawpwz81MDLe2ha+MDEH/uKAY9qEJT0rqCDPSxqZs6Wut+snx/F+1kn6glT1XJgXgUNqZicVlbmoLZUJN9lsic9CQO10NwVo9IcVtgSAWb69nyUULMFW2qISPg2wq3upl7lOFTIkP9+uahvaVszOxfEhdf3KDTuTgyql2Y3DgENn94KHRMz09DV4/7jSyJr5CvLGxFaIDF6dOoh92s6WBw9CmRWaWLhcFemSPoCU5NTQ== X-Forefront-PRVS: 0142F22657 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(6009001)(7916002)(199003)(189002)(92566002)(81156014)(81166006)(68736007)(38730400001)(2950100002)(39410400001)(50226002)(42882006)(39450400002)(8676002)(733004)(69596002)(6486002)(66066001)(6666003)(50986999)(47776003)(101416001)(76176999)(106356001)(107886002)(33646002)(42186005)(2361001)(53416004)(2351001)(4326007)(36756003)(5003940100001)(189998001)(105586002)(4001430100002)(2906002)(5660300001)(6916009)(3846002)(6116002)(97736004)(305945005)(48376002)(7736002)(50466002)(110136003)(7846002)(7099028)(5005270100013); DIR:OUT; SFP:1102; SCL:1; SRVR:CO2PR04MB2184; H:ztester-Precision-T3600.hgst.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: wdc.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CO2PR04MB2184; 23:BM3MtgPVDEaSxrxUiPh0yZEkoDXSd8a09BUcV1/Kb?= =?us-ascii?Q?ICcYc56Okj2O1jYgpSTiz+yF2gIRja3lGrJFnHhrtZmzwI8HeDQCzXjrvEkI?= =?us-ascii?Q?6KSDU1CfhQp+yzqdAfWiVnboBaCIe8PudE1rVFc0/qJAA04JqKKQxvBYaAWH?= =?us-ascii?Q?2Rm6f7T5I6ShevmmHeIIPyhyhsp8+m9Gz4+WRoxM6zsufuXiWg88IU47oT63?= =?us-ascii?Q?/jQZxEzMeUKyQdlgyUlYYk9XlVZ7/+QJlI2UOkd+adQ5DvCKbf5qxphomQ33?= =?us-ascii?Q?uv2BZ1G3xHYHJ9M8R2vmwEuRyVyIFS7PpBa/34TZ+Sa+ddhaAnZnx7vC/hHH?= =?us-ascii?Q?mz+7M62MXvoww/cYUTPnMDTIKZAKm5bXvIl41ycupk3MdRU7CilA4Vrm5TjR?= =?us-ascii?Q?CFbo1AwWQwerwLZxq36bINOyWLYjPcMJ5Pai17tE24d4WiMLjbC3YneLww8X?= =?us-ascii?Q?WZ3zELrgt5xEQ7iALSg7BbqmlyjfqmoxKnIT10f7x60u5r1/+Yvw4izaKIuu?= =?us-ascii?Q?WpmqDjSBio51BRgfu9c+9oxh6db9YwoMM0+lpf0fXb9t6MNcE3Y45xYnp/xY?= =?us-ascii?Q?9GQIwT+6objji/O01yNM570g9o0fIZCZsCQTI+UJPwviUg2NxtgwdscvvqTF?= =?us-ascii?Q?gfm/0iVNe4uQ8hqg57UrPmtzbOur7fBlplqSFJXsmpvY+BxjgeWvZ7/Y+VnA?= =?us-ascii?Q?d94foUDsXephujiEo51HIkvl3KrrigU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Q6z8QbBgC2rm69IrSR6X8RgaBbhTKIvfDrG4l9StFzDhBX8l8HLT3TtnhBpgvvvGZVuJUCLHCMF47Z2Iy8Gqu8spmMT0a4xFxe1Ia6Ee/aZZ0dy/HsJZyKOuhs5ENbgROuL5NSbrUMXeajxjm/cG X-OriginatorOrg: hgst.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Nov 2016 20:29:29.1636 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO2PR04MB2184 Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add the command structure, optional command set support (ONCS) bit and a new error code for the Write Zeroes command. Signed-off-by: Chaitanya Kulkarni Reviewed-by: Christoph Hellwig --- include/linux/nvme.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/include/linux/nvme.h b/include/linux/nvme.h index 9f3b488..5bf1d2d 100644 --- a/include/linux/nvme.h +++ b/include/linux/nvme.h @@ -242,6 +242,7 @@ enum { NVME_CTRL_ONCS_COMPARE = 1 << 0, NVME_CTRL_ONCS_WRITE_UNCORRECTABLE = 1 << 1, NVME_CTRL_ONCS_DSM = 1 << 2, + NVME_CTRL_ONCS_WRITE_ZEROES = 1 << 3, NVME_CTRL_VWC_PRESENT = 1 << 0, }; @@ -558,6 +559,23 @@ struct nvme_dsm_range { __le64 slba; }; +struct nvme_write_zeroes_cmd { + __u8 opcode; + __u8 flags; + __u16 command_id; + __le32 nsid; + __u64 rsvd2; + __le64 metadata; + union nvme_data_ptr dptr; + __le64 slba; + __le16 length; + __le16 control; + __le32 dsmgmt; + __le32 reftag; + __le16 apptag; + __le16 appmask; +}; + /* Admin commands */ enum nvme_admin_opcode { @@ -857,6 +875,7 @@ struct nvme_command { struct nvme_download_firmware dlfw; struct nvme_format_cmd format; struct nvme_dsm_cmd dsm; + struct nvme_write_zeroes_cmd write_zeroes; struct nvme_abort_cmd abort; struct nvme_get_log_page_command get_log_page; struct nvmf_common_command fabrics; @@ -947,6 +966,7 @@ enum { NVME_SC_BAD_ATTRIBUTES = 0x180, NVME_SC_INVALID_PI = 0x181, NVME_SC_READ_ONLY = 0x182, + NVME_SC_ONCS_NOT_SUPPORTED = 0x183, /* * I/O Command Set Specific - Fabrics commands: