* [PATCH 3/5] nvme.h: add Write Zeroes definitions
@ 2016-11-16 7:06 ` chaitany kulkarni
0 siblings, 0 replies; 8+ messages in thread
From: chaitany kulkarni @ 2016-11-16 7:06 UTC (permalink / raw
To: axboe; +Cc: martin.petersen, keith.busch, linux-nvme, linux-block
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@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
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 3/5] nvme.h: add Write Zeroes definitions
@ 2016-11-16 7:06 ` chaitany kulkarni
0 siblings, 0 replies; 8+ messages in thread
From: chaitany kulkarni @ 2016-11-16 7:06 UTC (permalink / raw
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
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH 3/5] nvme.h: add Write Zeroes definitions
2016-11-16 7:06 ` chaitany kulkarni
@ 2016-11-16 16:48 ` Sagi Grimberg
-1 siblings, 0 replies; 8+ messages in thread
From: Sagi Grimberg @ 2016-11-16 16:48 UTC (permalink / raw
To: chaitany kulkarni, axboe
Cc: martin.petersen, keith.busch, linux-nvme, linux-block
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 3/5] nvme.h: add Write Zeroes definitions
@ 2016-11-16 16:48 ` Sagi Grimberg
0 siblings, 0 replies; 8+ messages in thread
From: Sagi Grimberg @ 2016-11-16 16:48 UTC (permalink / raw
Reviewed-by: Sagi Grimberg <sagi at grimberg.me>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 3/5] nvme.h: add Write Zeroes definitions
2016-11-16 7:06 ` chaitany kulkarni
@ 2016-11-17 10:30 ` Christoph Hellwig
-1 siblings, 0 replies; 8+ messages in thread
From: Christoph Hellwig @ 2016-11-17 10:30 UTC (permalink / raw
To: chaitany kulkarni
Cc: axboe, martin.petersen, keith.busch, linux-nvme, linux-block
On Tue, Nov 15, 2016 at 11:06:58PM -0800, chaitany kulkarni wrote:
> 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@hgst.com>
Unlike the other patches this one looks white space damaged by a mail
client (and it also arrived out of sequence).
With the whitespaces fixed up this looks good:
Reviewed-by: Christoph Hellwig <hch@lst.de>
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 3/5] nvme.h: add Write Zeroes definitions
@ 2016-11-17 10:30 ` Christoph Hellwig
0 siblings, 0 replies; 8+ messages in thread
From: Christoph Hellwig @ 2016-11-17 10:30 UTC (permalink / raw
On Tue, Nov 15, 2016@11:06:58PM -0800, chaitany kulkarni wrote:
> 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>
Unlike the other patches this one looks white space damaged by a mail
client (and it also arrived out of sequence).
With the whitespaces fixed up this looks good:
Reviewed-by: Christoph Hellwig <hch at lst.de>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 3/5] nvme.h: add Write Zeroes definitions
2016-11-17 10:30 ` Christoph Hellwig
@ 2016-11-18 9:33 ` chaitany kulkarni
-1 siblings, 0 replies; 8+ messages in thread
From: chaitany kulkarni @ 2016-11-18 9:33 UTC (permalink / raw
To: Christoph Hellwig
Cc: axboe, Martin K. Petersen, Keith Busch, linux-nvme, linux-block
I'll resend entire series with v2 prefix and add whitespaces fix along
with other comments.
On Thu, Nov 17, 2016 at 2:30 AM, Christoph Hellwig <hch@infradead.org> wrote:
> On Tue, Nov 15, 2016 at 11:06:58PM -0800, chaitany kulkarni wrote:
>> 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@hgst.com>
>
> Unlike the other patches this one looks white space damaged by a mail
> client (and it also arrived out of sequence).
>
> With the whitespaces fixed up this looks good:
>
> Reviewed-by: Christoph Hellwig <hch@lst.de>
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 3/5] nvme.h: add Write Zeroes definitions
@ 2016-11-18 9:33 ` chaitany kulkarni
0 siblings, 0 replies; 8+ messages in thread
From: chaitany kulkarni @ 2016-11-18 9:33 UTC (permalink / raw
I'll resend entire series with v2 prefix and add whitespaces fix along
with other comments.
On Thu, Nov 17, 2016@2:30 AM, Christoph Hellwig <hch@infradead.org> wrote:
> On Tue, Nov 15, 2016@11:06:58PM -0800, chaitany kulkarni wrote:
>> 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>
>
> Unlike the other patches this one looks white space damaged by a mail
> client (and it also arrived out of sequence).
>
> With the whitespaces fixed up this looks good:
>
> Reviewed-by: Christoph Hellwig <hch at lst.de>
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2016-11-18 9:33 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-16 7:06 [PATCH 3/5] nvme.h: add Write Zeroes definitions chaitany kulkarni
2016-11-16 7:06 ` chaitany kulkarni
2016-11-16 16:48 ` Sagi Grimberg
2016-11-16 16:48 ` Sagi Grimberg
2016-11-17 10:30 ` Christoph Hellwig
2016-11-17 10:30 ` Christoph Hellwig
2016-11-18 9:33 ` chaitany kulkarni
2016-11-18 9:33 ` chaitany kulkarni
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.