summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorMaxim Levitsky2019-09-13 15:36:26 +0200
committerMax Reitz2019-10-28 11:34:30 +0100
commite0dd95e3738c5868ddea932aa0f1998900eeaf58 (patch)
tree864daac9d63c94a7a6d422d31c411d95a6995df5 /include
parentblock/block-copy: increase buffered copy request (diff)
downloadqemu-e0dd95e3738c5868ddea932aa0f1998900eeaf58.tar.gz
qemu-e0dd95e3738c5868ddea932aa0f1998900eeaf58.tar.xz
qemu-e0dd95e3738c5868ddea932aa0f1998900eeaf58.zip
block/nvme: add support for write zeros
Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com> Message-id: 20190913133627.28450-2-mlevitsk@redhat.com Reviewed-by: John Snow <jsnow@redhat.com> Signed-off-by: Max Reitz <mreitz@redhat.com>
Diffstat (limited to 'include')
-rw-r--r--include/block/nvme.h19
1 files changed, 18 insertions, 1 deletions
diff --git a/include/block/nvme.h b/include/block/nvme.h
index 3ec8efcc43..ab5943b90a 100644
--- a/include/block/nvme.h
+++ b/include/block/nvme.h
@@ -653,12 +653,29 @@ typedef struct NvmeIdNs {
uint8_t mc;
uint8_t dpc;
uint8_t dps;
- uint8_t res30[98];
+
+ uint8_t nmic;
+ uint8_t rescap;
+ uint8_t fpi;
+ uint8_t dlfeat;
+
+ uint8_t res34[94];
NvmeLBAF lbaf[16];
uint8_t res192[192];
uint8_t vs[3712];
} NvmeIdNs;
+
+/*Deallocate Logical Block Features*/
+#define NVME_ID_NS_DLFEAT_GUARD_CRC(dlfeat) ((dlfeat) & 0x10)
+#define NVME_ID_NS_DLFEAT_WRITE_ZEROES(dlfeat) ((dlfeat) & 0x08)
+
+#define NVME_ID_NS_DLFEAT_READ_BEHAVIOR(dlfeat) ((dlfeat) & 0x7)
+#define NVME_ID_NS_DLFEAT_READ_BEHAVIOR_UNDEFINED 0
+#define NVME_ID_NS_DLFEAT_READ_BEHAVIOR_ZEROES 1
+#define NVME_ID_NS_DLFEAT_READ_BEHAVIOR_ONES 2
+
+
#define NVME_ID_NS_NSFEAT_THIN(nsfeat) ((nsfeat & 0x1))
#define NVME_ID_NS_FLBAS_EXTENDED(flbas) ((flbas >> 4) & 0x1)
#define NVME_ID_NS_FLBAS_INDEX(flbas) ((flbas & 0xf))