Skip to content

Commit f381c3b

Browse files
committed
types: add performance attribute structures
These for the performance characteristics feature: 1Ch. Signed-off-by: Tokunori Ikegami <[email protected]>
1 parent 555d4c1 commit f381c3b

2 files changed

Lines changed: 72 additions & 3 deletions

File tree

src/nvme/types.h

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@
2121
* NVMe standard definitions
2222
*/
2323

24+
#define NVME_UUID_LEN 16
25+
#define NVME_UUID_LEN_STRING 37 /* 1b4e28ba-2fa1-11d2-883f-0016d3cca427 + \0 */
26+
2427
/**
2528
* NVME_GET() - extract field from complex value
2629
* @value: The original value of a complex field
@@ -5997,6 +6000,75 @@ enum nvme_apst_entry {
59976000
NVME_APST_ENTRY_ITPT_MASK = 0xffffff,
59986001
};
59996002

6003+
/**
6004+
* struct nvme_std_perf_attr - Standard performance attribute structure
6005+
* @rsvd0: Reserved
6006+
* @r4karl: Random 4 KiB average read latency
6007+
* @rsvd5: Reserved
6008+
*/
6009+
struct nvme_std_perf_attr {
6010+
__u8 rsvd0[4];
6011+
__u8 r4karl;
6012+
__u8 rsvd5[4091];
6013+
};
6014+
6015+
/**
6016+
* struct nvme_perf_attr_id - Performance attribute identifier structure
6017+
* @id: Performance attribute identifier
6018+
*/
6019+
struct nvme_perf_attr_id {
6020+
__u8 id[NVME_UUID_LEN];
6021+
};
6022+
6023+
/**
6024+
* struct nvme_perf_attr_id_list - Performance attribute identifier list structure
6025+
* @attrtyp: Bits 7-3: Reserved
6026+
* Bits 2-0: Attribute type
6027+
* @msvspa: Maximum saveable vendor specific performance attributes
6028+
* @usvspa: Unused saveable vendor specific performance attributes
6029+
* @rsvd3: Reserved
6030+
* @id_list: Performance attribute identifier list
6031+
* @rsvd1024: Reserved
6032+
*/
6033+
struct nvme_perf_attr_id_list {
6034+
__u8 attrtyp;
6035+
__u8 msvspa;
6036+
__u8 usvspa;
6037+
__u8 rsvd3[13];
6038+
struct nvme_perf_attr_id id_list[63];
6039+
__u8 rsvd1024[3072];
6040+
};
6041+
6042+
/**
6043+
* struct nvme_vs_perf_attr - Vendor specific performance attribute structure
6044+
* @paid: Performance attribute identifier
6045+
* @rsvd16: Reserved
6046+
* @attrl: Attribute Length
6047+
* @vs: Vendor specific
6048+
*/
6049+
struct nvme_vs_perf_attr {
6050+
__u8 paid[16];
6051+
__u8 rsvd16[14];
6052+
__le16 attrl;
6053+
__u8 vs[4064];
6054+
};
6055+
6056+
/**
6057+
* struct nvme_perf_characteristics - Performance attribute structure
6058+
* @std_perf: Standard performance attribute
6059+
* @id_list: Performance attribute identifier list
6060+
* @vs_perf: Vendor specific performance attribute
6061+
* @attr_buf: Attribute buffer
6062+
*/
6063+
struct nvme_perf_characteristics {
6064+
union {
6065+
struct nvme_std_perf_attr std_perf[0];
6066+
struct nvme_perf_attr_id_list id_list[0];
6067+
struct nvme_vs_perf_attr vs_perf[0];
6068+
__u8 attr_buf[4096];
6069+
};
6070+
};
6071+
60006072
/**
60016073
* struct nvme_metadata_element_desc - Metadata Element Descriptor
60026074
* @type: Element Type (ET)

src/nvme/util.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -646,9 +646,6 @@ enum nvme_version {
646646
*/
647647
const char *nvme_get_version(enum nvme_version type);
648648

649-
#define NVME_UUID_LEN_STRING 37 /* 1b4e28ba-2fa1-11d2-883f-0016d3cca427 + \0 */
650-
#define NVME_UUID_LEN 16
651-
652649
/**
653650
* nvme_uuid_to_string - Return string represenation of encoded UUID
654651
* @uuid: Binary encoded input UUID

0 commit comments

Comments
 (0)