Skip to content

Commit 90a65d3

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 90a65d3

2 files changed

Lines changed: 71 additions & 1 deletion

File tree

src/nvme/types.h

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

24+
#define NVME_UUID_LEN 16
25+
2426
/**
2527
* NVME_GET() - extract field from complex value
2628
* @value: The original value of a complex field
@@ -5997,6 +5999,75 @@ enum nvme_apst_entry {
59975999
NVME_APST_ENTRY_ITPT_MASK = 0xffffff,
59986000
};
59996001

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

src/nvme/util.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -647,7 +647,6 @@ enum nvme_version {
647647
const char *nvme_get_version(enum nvme_version type);
648648

649649
#define NVME_UUID_LEN_STRING 37 /* 1b4e28ba-2fa1-11d2-883f-0016d3cca427 + \0 */
650-
#define NVME_UUID_LEN 16
651650

652651
/**
653652
* nvme_uuid_to_string - Return string represenation of encoded UUID

0 commit comments

Comments
 (0)