Commit 54219afe authored by Simon A. F. Lund's avatar Simon A. F. Lund Committed by Tomasz Zawadzki
Browse files

nvme/spec: add accessors to, and commented members of, zone-descriptors



The struct-accessors are added and named matching the fields defined in
the spec. to be used by the fio_plugin/nvme and other consumers of the
driver-layer. Comments to be consumed doc-generators as well as human
readers of the header-file.

The identify example is updated with the change.

Signed-off-by: default avatarSimon A. F. Lund <simon.lund@samsung.com>
Change-Id: I8d6cb82e095c5dcbc06fe892e17ce83dc0062735
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4835


Reviewed-by: default avatarPaul Luse <paul.e.luse@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
parent 6fafaa5d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -780,7 +780,7 @@ print_zns_zone_report(void)
	for (i = 0; i < g_zone_report->nr_zones; i++) {
		struct spdk_nvme_zns_zone_desc *desc = &g_zone_report->descs[i];
		printf("Zone: %"PRIu64" ZSLBA: 0x%016"PRIx64" ZCAP: 0x%016"PRIx64" WP: 0x%016"PRIx64" ZS: %x ZT: %x ZA: %x\n",
		       i, desc->zslba, desc->zcap, desc->wp, desc->zs >> 4, desc->zt, desc->za);
		       i, desc->zslba, desc->zcap, desc->wp, desc->zs, desc->zt, desc->za.raw);
	}
	free(g_zone_report);
	g_zone_report = NULL;
+41 −4
Original line number Diff line number Diff line
@@ -3109,13 +3109,50 @@ enum spdk_nvme_zns_zone_state {
};

struct spdk_nvme_zns_zone_desc {
	uint8_t zt;
	uint8_t zs;
	uint8_t za;
	uint8_t reserved3[5];
	/** Zone Type */
	uint8_t zt		: 4;

	uint8_t rsvd0		: 4;

	uint8_t rsvd1		: 4;

	/** Zone State */
	uint8_t zs		: 4;

	/**
	 * Zone Attributes
	 */
	union {
		uint8_t raw;

		struct {
			/** Zone Finished by controller */
			uint8_t zfc: 1;

			/** Zone Finish Recommended */
			uint8_t zfr: 1;

			/** Reset Zone Recommended */
			uint8_t rzr: 1;

			uint8_t rsvd3 : 4;

			/** Zone Descriptor Valid */
			uint8_t zdev: 1;
		} bits;
	} za;

	uint8_t reserved[5];

	/** Zone Capacity (in number of LBAs) */
	uint64_t zcap;

	/** Zone Start LBA */
	uint64_t zslba;

	/** Write Pointer (LBA) */
	uint64_t wp;

	uint8_t reserved32[32];
};
SPDK_STATIC_ASSERT(sizeof(struct spdk_nvme_zns_zone_desc) == 64, "Incorrect size");