From: chaitanya.kulkarni@hgst.com (Chaitanya Kulkarni)
Subject: [PATCH V2 3/5] nvme.h: add Write Zeroes definitions
Date: Wed, 30 Nov 2016 12:29:00 -0800 [thread overview]
Message-ID: <1480537742-15190-3-git-send-email-chaitanya.kulkarni@hgst.com> (raw)
In-Reply-To: <1480537742-15190-1-git-send-email-chaitanya.kulkarni@hgst.com>
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 <chaitanya.kulkarni at hgst.com>
---
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:
--
1.8.3.1
next prev parent reply other threads:[~2016-11-30 20:29 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-30 20:28 [PATCH V2 1/5] block: add async variant of blkdev_issue_zeroout Chaitanya Kulkarni
2016-11-30 20:28 ` [PATCH V2 2/5] block: add support for REQ_OP_WRITE_ZEROES Chaitanya Kulkarni
2016-12-01 10:00 ` Christoph Hellwig
2016-11-30 20:29 ` Chaitanya Kulkarni [this message]
2016-12-01 10:00 ` [PATCH V2 3/5] nvme.h: add Write Zeroes definitions Christoph Hellwig
2016-11-30 20:29 ` [PATCH V2 4/5] nvme: add support for the Write Zeroes command Chaitanya Kulkarni
2016-12-01 10:01 ` Christoph Hellwig
2016-11-30 20:29 ` [PATCH V2 5/5] nvmet: " Chaitanya Kulkarni
2016-12-01 10:01 ` Christoph Hellwig
2016-12-01 10:00 ` [PATCH V2 1/5] block: add async variant of blkdev_issue_zeroout Christoph Hellwig
2016-12-01 14:59 ` Jens Axboe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1480537742-15190-3-git-send-email-chaitanya.kulkarni@hgst.com \
--to=chaitanya.kulkarni@hgst.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).