Skip to content

Commit

Permalink
ioctl: add nvme_get_log_ave_discover()
Browse files Browse the repository at this point in the history
Since added the NVMe 2.1 log page.

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
  • Loading branch information
ikegami-t committed Jan 7, 2025
1 parent 3f8a7a5 commit acb90d1
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/nvme/ioctl.h
Original file line number Diff line number Diff line change
Expand Up @@ -2362,6 +2362,22 @@ static inline int nvme_get_log_host_discover(int fd, bool allhoste, bool rae, __
return nvme_get_log_page(fd, NVME_LOG_PAGE_PDU_SIZE, &args);
}

/**
* nvme_get_log_ave_discover() - Retrieve AVE Discovery Log
* @fd: File descriptor of nvme device
* @rae: Retain asynchronous events
* @len: The allocated length of the log page
* @log: User address to store the log page
*
* Return: The nvme command status if a response was received (see
* &enum nvme_status_field) or -1 with errno set otherwise
*/
static inline int nvme_get_log_ave_discover(int fd, bool rae, __u32 len,
struct nvme_ave_discover_log *log)
{
return nvme_get_nsid_log(fd, rae, NVME_LOG_LID_AVE_DISCOVER, NVME_NSID_ALL, len, log);
}

/**
* nvme_get_log_media_unit_stat() - Retrieve Media Unit Status
* @fd: File descriptor of nvme device
Expand Down
50 changes: 50 additions & 0 deletions src/nvme/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -6957,6 +6957,56 @@ struct nvme_host_discover_log {
struct nvme_host_ext_discover_log hedlpe[];
};

/**
* struct nvme_ave_tr_record - AVE Transport Record
* @aveadrfam: AVE Address Family
* @rsvd1: Reserved
* @avetrsvcid: AVE Transport Service Identifier
* @avetraddr: AVE Transport Address
*/
struct nvme_ave_tr_record {
__u8 aveadrfam;
__u8 rsvd1;
__le16 avetrsvcid;
__u8 avetraddr[16];
};

/**
* struct nvme_ave_discover_log_entry - AVE Discovery Log Entry
* @tel: Total Entry Length
* @avenqn: AVE NQN
* @numatr: Number of AVE Transport Records
* @rsvd229: Reserved
* @atr: AVE Transport Record List
*/
struct nvme_ave_discover_log_entry {
__le32 tel;
char avenqn[224];
__u8 numatr;
__u8 rsvd229[3];
struct nvme_ave_tr_record atr[];
};

/**
* struct nvme_ave_discover_log - AVE Discovery Log
* @genctr: Generation Counter
* @numrec: Number of Records
* @recfmt: Record Format
* @rsvd18: Reserved
* @tadlpl: Total AVE Discovery Log Page Length
* @rsvd24: Reserved
* @adlpe: AVE Discovery Log Page Entry List
*/
struct nvme_ave_discover_log {
__le64 genctr;
__le64 numrec;
__le16 recfmt;
__u8 rsvd18[2];
__le32 tadlpl;
__u8 rsvd24[1000];
struct nvme_ave_discover_log_entry adlpe[];
};

/**
* struct nvme_mi_read_nvm_ss_info - NVM Subsystem Information Data Structure
* @nump: Number of Ports
Expand Down

0 comments on commit acb90d1

Please sign in to comment.