From 069b5367667a8879b4e5cece718bd09743fbcd0f Mon Sep 17 00:00:00 2001 From: Niklas Cassel Date: Thu, 17 Sep 2020 11:06:10 +0000 Subject: [PATCH] nvme_spec: add Zoned Namespace Command Set Specific identify data structures Add the I/O Command Set Specific Identify Namespace Data Structure and the I/O Command Set Specific Identify Controller Data Structure for the Zoned Namespace Command Set. These data structures are defined in the NVMe Zoned Namespace Command Set Specification. Signed-off-by: Niklas Cassel Change-Id: I1434765ecbb22e1020c6b299cd05ba8a614b1cda Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4310 Tested-by: SPDK CI Jenkins Community-CI: Broadcom CI Reviewed-by: Jim Harris Reviewed-by: Ben Walker --- include/spdk/nvme_spec.h | 53 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/include/spdk/nvme_spec.h b/include/spdk/nvme_spec.h index 91166e3ba4..613b6e32ef 100644 --- a/include/spdk/nvme_spec.h +++ b/include/spdk/nvme_spec.h @@ -1986,6 +1986,14 @@ struct __attribute__((packed)) __attribute__((aligned)) spdk_nvme_ctrlr_data { }; SPDK_STATIC_ASSERT(sizeof(struct spdk_nvme_ctrlr_data) == 4096, "Incorrect size"); +struct spdk_nvme_ctrlr_data_zns { + /** zone append size limit */ + uint8_t zasl; + + uint8_t reserved1[4095]; +}; +SPDK_STATIC_ASSERT(sizeof(struct spdk_nvme_ctrlr_data_zns) == 4096, "Incorrect size"); + struct __attribute__((packed)) spdk_nvme_primary_ctrl_capabilities { /** controller id */ uint16_t cntlid; @@ -2262,6 +2270,51 @@ struct spdk_nvme_ns_data { }; SPDK_STATIC_ASSERT(sizeof(struct spdk_nvme_ns_data) == 4096, "Incorrect size"); +struct spdk_nvme_ns_data_zns { + /** zone operation characteristics */ + struct { + uint16_t variable_zone_capacity : 1; + uint16_t zone_active_excursions : 1; + uint16_t reserved0 : 14; + } zoc; + + /** optional zoned command support */ + struct { + uint16_t read_across_zone_boundaries : 1; + uint16_t reserved0 : 15; + } ozcs; + + /** maximum active resources */ + uint32_t mar; + + /** maximum open resources */ + uint32_t mor; + + /** reset recommended limit */ + uint32_t rrl; + + /** finish recommended limit */ + uint32_t frl; + + uint8_t reserved20[2796]; + + /** zns lba format extension support */ + struct { + /** zone size */ + uint64_t zsze; + + /** zone descriptor extension size */ + uint64_t zdes : 8; + + uint64_t reserved15 : 56; + } lbafe[16]; + + uint8_t reserved3072[768]; + + uint8_t vendor_specific[256]; +}; +SPDK_STATIC_ASSERT(sizeof(struct spdk_nvme_ns_data_zns) == 4096, "Incorrect size"); + /** * Deallocated logical block features - read value */