Commit 672b4711 authored by James Bergsten's avatar James Bergsten Committed by Changpeng Liu
Browse files

nvme_spec: Add data structures for NVMe Telemetry Log page and Interrupt Coalescing Feature



Adding two NVMe Specification data structures for near future use.

Change-Id: Ic492dc35846239dd771c6a5e210b4f3978cdd03c
Signed-off-by: default avatarJames Bergsten <jamesx.bergsten@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/444292


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarChangpeng Liu <changpeng.liu@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
parent 8ccf24ed
Loading
Loading
Loading
Loading
+46 −1
Original line number Diff line number Diff line
@@ -791,6 +791,7 @@ enum spdk_nvme_feat {
	SPDK_NVME_FEAT_VOLATILE_WRITE_CACHE			= 0x06,
	/** cdw11 layout defined by \ref spdk_nvme_feat_number_of_queues */
	SPDK_NVME_FEAT_NUMBER_OF_QUEUES				= 0x07,
	/** cdw11 layout defined by \ref spdk_nvme_feat_interrupt_coalescing */
	SPDK_NVME_FEAT_INTERRUPT_COALESCING			= 0x08,
	/** cdw11 layout defined by \ref spdk_nvme_feat_interrupt_vector_configuration */
	SPDK_NVME_FEAT_INTERRUPT_VECTOR_CONFIGURATION		= 0x09,
@@ -1788,7 +1789,16 @@ enum spdk_nvme_log_page {
	/** Command effects log (optional) */
	SPDK_NVME_LOG_COMMAND_EFFECTS_LOG	= 0x05,

	/* 0x06-0x6F - reserved */
	/** Device self test (optional) */
	SPDK_NVME_LOG_DEVICE_SELF_TEST	= 0x06,

	/** Host initiated telemetry log (optional) */
	SPDK_NVME_LOG_TELEMETRY_HOST_INITIATED	= 0x07,

	/** Controller initiated telemetry log (optional) */
	SPDK_NVME_LOG_TELEMETRY_CTRLR_INITIATED	= 0x08,

	/* 0x09-0x6F - reserved */

	/** Discovery(refer to the NVMe over Fabrics specification) */
	SPDK_NVME_LOG_DISCOVERY		= 0x70,
@@ -1920,6 +1930,24 @@ struct spdk_nvme_cmds_and_effect_log_page {
};
SPDK_STATIC_ASSERT(sizeof(struct spdk_nvme_cmds_and_effect_log_page) == 4096, "Incorrect size");

/*
 * Get Log Page – Telemetry Host/Controller Initiated Log (Log Identifiers 07h/08h)
 */
struct spdk_nvme_telemetry_log_page_hdr {
	uint8_t    lpi;			/* Log page identifier */
	uint8_t    rsvd[4];
	uint8_t    ieee_oui[3];
	uint16_t   dalb1;		/* Data area 1 last block */
	uint16_t   dalb2;		/* Data area 2 last block */
	uint16_t   dalb3;		/* Data area 3 last block */
	uint8_t    rsvd1[368];
	uint8_t    ctrlr_avail;		/* Controller initiated data avail */
	uint8_t    ctrlr_gen;		/* Controller initiated telemetry data generation */
	uint8_t    rsnident[128];	/* Reason identifier */
	uint8_t    telemetry_datablock[0];
};
SPDK_STATIC_ASSERT(sizeof(struct spdk_nvme_telemetry_log_page_hdr) == 512, "Incorrect size");

/**
 * Asynchronous Event Type
 */
@@ -2133,6 +2161,23 @@ union spdk_nvme_feat_number_of_queues {
};
SPDK_STATIC_ASSERT(sizeof(union spdk_nvme_feat_number_of_queues) == 4, "Incorrect size");

/**
 * Data used by Set Features/Get Features \ref SPDK_NVME_FEAT_INTERRUPT_COALESCING
 */
union spdk_nvme_feat_interrupt_coalescing {
	uint32_t raw;
	struct {
		/** Aggregation Threshold */
		uint32_t thr : 8;

		/** Aggregration time */
		uint32_t time : 8;

		uint32_t reserved : 16;
	} bits;
};
SPDK_STATIC_ASSERT(sizeof(union spdk_nvme_feat_interrupt_coalescing) == 4, "Incorrect size");

/**
 * Data used by Set Features/Get Features \ref SPDK_NVME_FEAT_INTERRUPT_VECTOR_CONFIGURATION
 */