-
Notifications
You must be signed in to change notification settings - Fork 152
ioctl: add nvme_get_egid_log() #936
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
7625faf
ioctl: add nvme_get_endgid_log()
ikegami-t 36665fc
ioctl: add nvme_get_log_rotational_media_info()
ikegami-t f8ee240
ioctl: add nvme_get_log_dispersed_ns_participating_nss()
ikegami-t 4eadbce
ioctl: add nvme_get_log_mgmt_addr_list()
ikegami-t b010126
ioctl: add nvme_get_log_reachability_groups()
ikegami-t 2b012cf
ioctl: add nvme_get_log_reachability_associations()
ikegami-t 9a5b0e4
ioctl: add nvme_get_log_changed_alloc_ns_list()
ikegami-t 3f8a7a5
ioctl: add nvme_get_log_host_discover()
ikegami-t acb90d1
ioctl: add nvme_get_log_ave_discover()
ikegami-t 30bd194
ioctl: add nvme_get_log_pull_model_ddc_req()
ikegami-t File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1370,6 +1370,30 @@ static inline int nvme_get_nsid_log(int fd, bool rae, | |
| return nvme_get_log_page(fd, NVME_LOG_PAGE_PDU_SIZE, &args); | ||
| } | ||
|
|
||
| static inline int nvme_get_endgid_log(int fd, bool rae, enum nvme_cmd_get_log_lid lid, __u16 endgid, | ||
| __u32 len, void *log) | ||
| { | ||
| struct nvme_get_log_args args = { | ||
| .lpo = 0, | ||
| .result = NULL, | ||
| .log = log, | ||
| .args_size = sizeof(args), | ||
| .fd = fd, | ||
| .timeout = NVME_DEFAULT_IOCTL_TIMEOUT, | ||
| .lid = lid, | ||
| .len = len, | ||
| .nsid = NVME_NSID_NONE, | ||
| .csi = NVME_CSI_NVM, | ||
| .lsi = endgid, | ||
| .lsp = NVME_LOG_LSP_NONE, | ||
| .uuidx = NVME_LOG_LSP_NONE, | ||
| .rae = rae, | ||
| .ot = false, | ||
| }; | ||
|
|
||
| return nvme_get_log_page(fd, NVME_LOG_PAGE_PDU_SIZE, &args); | ||
| } | ||
|
|
||
| static inline int nvme_get_log_simple(int fd, enum nvme_cmd_get_log_lid lid, | ||
| __u32 len, void *log) | ||
| { | ||
|
|
@@ -2095,6 +2119,55 @@ static inline int nvme_get_log_boot_partition(int fd, bool rae, | |
| return nvme_get_log_page(fd, NVME_LOG_PAGE_PDU_SIZE, &args); | ||
| } | ||
|
|
||
| /** | ||
| * nvme_get_log_rotational_media_info() - Retrieve Rotational Media Information Log | ||
| * @fd: File descriptor of nvme device | ||
| * @endgid: Endurance Group Identifier | ||
| * @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_rotational_media_info(int fd, __u16 endgid, __u32 len, | ||
| struct nvme_rotational_media_info_log *log) | ||
| { | ||
| return nvme_get_endgid_log(fd, false, NVME_LOG_LID_ROTATIONAL_MEDIA_INFO, endgid, len, log); | ||
| } | ||
|
|
||
| /** | ||
| * nvme_get_log_dispersed_ns_participating_nss() - Retrieve Dispersed Namespace Participating NVM | ||
| * Subsystems Log | ||
| * @fd: File descriptor of nvme device | ||
| * @nsid: Namespace Identifier | ||
| * @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_dispersed_ns_participating_nss(int fd, __u32 nsid, __u32 len, | ||
| struct nvme_dispersed_ns_participating_nss_log *log) | ||
| { | ||
| return nvme_get_nsid_log(fd, false, NVME_LOG_LID_DISPERSED_NS_PARTICIPATING_NSS, nsid, len, | ||
| log); | ||
| } | ||
|
|
||
| /** | ||
| * nvme_get_log_mgmt_addr_list() - Retrieve Management Address List Log | ||
| * @fd: File descriptor of nvme device | ||
| * @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_mgmt_addr_list(int fd, __u32 len, | ||
| struct nvme_mgmt_addr_list_log *log) | ||
| { | ||
| return nvme_get_log_simple(fd, NVME_LOG_LID_MGMT_ADDR_LIST, len, log); | ||
| } | ||
|
|
||
| /** | ||
| * nvme_get_log_phy_rx_eom() - Retrieve Physical Interface Receiver Eye Opening Measurement Log | ||
| * @fd: File descriptor of nvme device | ||
|
|
@@ -2130,6 +2203,93 @@ static inline int nvme_get_log_phy_rx_eom(int fd, __u8 lsp, __u16 controller, | |
| return nvme_get_log_page(fd, NVME_LOG_PAGE_PDU_SIZE, &args); | ||
| } | ||
|
|
||
| /** | ||
| * nvme_get_log_reachability_groups() - Retrieve Reachability Groups Log | ||
| * @fd: File descriptor of nvme device | ||
| * @rgo: Return groups only | ||
| * @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_reachability_groups(int fd, __u32 len, bool rgo, bool rae, | ||
| struct nvme_reachability_groups_log *log) | ||
| { | ||
| struct nvme_get_log_args args = { | ||
| .lpo = 0, | ||
| .result = NULL, | ||
| .log = log, | ||
| .args_size = sizeof(args), | ||
| .fd = fd, | ||
| .timeout = NVME_DEFAULT_IOCTL_TIMEOUT, | ||
| .lid = NVME_LOG_LID_REACHABILITY_GROUPS, | ||
| .len = len, | ||
| .nsid = NVME_NSID_ALL, | ||
| .csi = NVME_CSI_NVM, | ||
| .lsi = NVME_LOG_LSI_NONE, | ||
| .lsp = rgo, | ||
| .uuidx = NVME_LOG_LSP_NONE, | ||
| .rae = rae, | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Timeout missing? |
||
| .ot = false, | ||
| }; | ||
|
|
||
| return nvme_get_log_page(fd, NVME_LOG_PAGE_PDU_SIZE, &args); | ||
| } | ||
|
|
||
| /** | ||
| * nvme_get_log_reachability_associations() - Retrieve Reachability Associations Log | ||
| * @fd: File descriptor of nvme device | ||
| * @rao: Return associations only | ||
| * @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_reachability_associations(int fd, bool rao, bool rae, __u32 len, | ||
| struct nvme_reachability_associations_log *log) | ||
| { | ||
| struct nvme_get_log_args args = { | ||
| .lpo = 0, | ||
| .result = NULL, | ||
| .log = log, | ||
| .args_size = sizeof(args), | ||
| .fd = fd, | ||
| .timeout = NVME_DEFAULT_IOCTL_TIMEOUT, | ||
| .lid = NVME_LOG_LID_REACHABILITY_ASSOCIATIONS, | ||
| .len = len, | ||
| .nsid = NVME_NSID_ALL, | ||
| .csi = NVME_CSI_NVM, | ||
| .lsi = NVME_LOG_LSI_NONE, | ||
| .lsp = rao, | ||
| .uuidx = NVME_LOG_LSP_NONE, | ||
| .rae = rae, | ||
igaw marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| .ot = false, | ||
| }; | ||
|
|
||
| return nvme_get_log_page(fd, NVME_LOG_PAGE_PDU_SIZE, &args); | ||
| } | ||
|
|
||
| /** | ||
| * nvme_get_log_changed_alloc_ns_list() - Retrieve Changed Allocated Namespace List 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_changed_alloc_ns_list(int fd, bool rae, __u32 len, | ||
| struct nvme_ns_list *log) | ||
| { | ||
| return nvme_get_nsid_log(fd, rae, NVME_LOG_LID_CHANGED_ALLOC_NS_LIST, NVME_NSID_ALL, len, | ||
| log); | ||
| } | ||
|
|
||
| /** | ||
| * nvme_get_log_discovery() - Retrieve Discovery log page | ||
| * @fd: File descriptor of nvme device | ||
|
|
@@ -2167,6 +2327,73 @@ static inline int nvme_get_log_discovery(int fd, bool rae, | |
| return nvme_get_log_page(fd, NVME_LOG_PAGE_PDU_SIZE, &args); | ||
| } | ||
|
|
||
| /** | ||
| * nvme_get_log_host_discover() - Retrieve Host Discovery Log | ||
| * @fd: File descriptor of nvme device | ||
| * @allhoste: All host entries | ||
| * @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_host_discover(int fd, bool allhoste, bool rae, __u32 len, | ||
| struct nvme_host_discover_log *log) | ||
| { | ||
| struct nvme_get_log_args args = { | ||
| .lpo = 0, | ||
| .result = NULL, | ||
| .log = log, | ||
| .args_size = sizeof(args), | ||
| .fd = fd, | ||
| .timeout = NVME_DEFAULT_IOCTL_TIMEOUT, | ||
| .lid = NVME_LOG_LID_HOST_DISCOVER, | ||
| .len = len, | ||
| .nsid = NVME_NSID_ALL, | ||
| .csi = NVME_CSI_NVM, | ||
| .lsi = NVME_LOG_LSI_NONE, | ||
| .lsp = allhoste, | ||
igaw marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| .uuidx = NVME_LOG_LSP_NONE, | ||
| .rae = rae, | ||
| .ot = false, | ||
| }; | ||
|
|
||
| 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_pull_model_ddc_req() - Retrieve Pull Model DDC Request 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_pull_model_ddc_req(int fd, bool rae, __u32 len, | ||
| struct nvme_pull_model_ddc_req_log *log) | ||
| { | ||
| return nvme_get_nsid_log(fd, rae, NVME_LOG_LID_PULL_MODEL_DDC_REQ, NVME_NSID_ALL, len, log); | ||
| } | ||
|
|
||
| /** | ||
| * nvme_get_log_media_unit_stat() - Retrieve Media Unit Status | ||
| * @fd: File descriptor of nvme device | ||
|
|
||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.