Skip to content

Commit d13211d

Browse files
ikegami-tigaw
authored andcommitted
ioctl: add nvme_get_log_ave_discover()
Since added the NVMe 2.1 log page. Signed-off-by: Tokunori Ikegami <[email protected]>
1 parent 9048fa7 commit d13211d

2 files changed

Lines changed: 66 additions & 0 deletions

File tree

src/nvme/ioctl.h

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2362,6 +2362,22 @@ static inline int nvme_get_log_host_discover(int fd, bool allhoste, bool rae, __
23622362
return nvme_get_log_page(fd, NVME_LOG_PAGE_PDU_SIZE, &args);
23632363
}
23642364

2365+
/**
2366+
* nvme_get_log_ave_discover() - Retrieve AVE Discovery Log
2367+
* @fd: File descriptor of nvme device
2368+
* @rae: Retain asynchronous events
2369+
* @len: The allocated length of the log page
2370+
* @log: User address to store the log page
2371+
*
2372+
* Return: The nvme command status if a response was received (see
2373+
* &enum nvme_status_field) or -1 with errno set otherwise
2374+
*/
2375+
static inline int nvme_get_log_ave_discover(int fd, bool rae, __u32 len,
2376+
struct nvme_ave_discover_log *log)
2377+
{
2378+
return nvme_get_nsid_log(fd, rae, NVME_LOG_LID_AVE_DISCOVER, NVME_NSID_ALL, len, log);
2379+
}
2380+
23652381
/**
23662382
* nvme_get_log_media_unit_stat() - Retrieve Media Unit Status
23672383
* @fd: File descriptor of nvme device

src/nvme/types.h

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6957,6 +6957,56 @@ struct nvme_host_discover_log {
69576957
struct nvme_host_ext_discover_log hedlpe[];
69586958
};
69596959

6960+
/**
6961+
* struct nvme_ave_tr_record - AVE Transport Record
6962+
* @aveadrfam: AVE Address Family
6963+
* @rsvd1: Reserved
6964+
* @avetrsvcid: AVE Transport Service Identifier
6965+
* @avetraddr: AVE Transport Address
6966+
*/
6967+
struct nvme_ave_tr_record {
6968+
__u8 aveadrfam;
6969+
__u8 rsvd1;
6970+
__le16 avetrsvcid;
6971+
__u8 avetraddr[16];
6972+
};
6973+
6974+
/**
6975+
* struct nvme_ave_discover_log_entry - AVE Discovery Log Entry
6976+
* @tel: Total Entry Length
6977+
* @avenqn: AVE NQN
6978+
* @numatr: Number of AVE Transport Records
6979+
* @rsvd229: Reserved
6980+
* @atr: AVE Transport Record List
6981+
*/
6982+
struct nvme_ave_discover_log_entry {
6983+
__le32 tel;
6984+
char avenqn[224];
6985+
__u8 numatr;
6986+
__u8 rsvd229[3];
6987+
struct nvme_ave_tr_record atr[];
6988+
};
6989+
6990+
/**
6991+
* struct nvme_ave_discover_log - AVE Discovery Log
6992+
* @genctr: Generation Counter
6993+
* @numrec: Number of Records
6994+
* @recfmt: Record Format
6995+
* @rsvd18: Reserved
6996+
* @tadlpl: Total AVE Discovery Log Page Length
6997+
* @rsvd24: Reserved
6998+
* @adlpe: AVE Discovery Log Page Entry List
6999+
*/
7000+
struct nvme_ave_discover_log {
7001+
__le64 genctr;
7002+
__le64 numrec;
7003+
__le16 recfmt;
7004+
__u8 rsvd18[2];
7005+
__le32 tadlpl;
7006+
__u8 rsvd24[1000];
7007+
struct nvme_ave_discover_log_entry adlpe[];
7008+
};
7009+
69607010
/**
69617011
* struct nvme_mi_read_nvm_ss_info - NVM Subsystem Information Data Structure
69627012
* @nump: Number of Ports

0 commit comments

Comments
 (0)