@@ -1639,6 +1639,127 @@ static inline int nvme_get_log_predictable_lat_event(int fd, bool rae,
16391639 return nvme_get_log_page (fd , NVME_LOG_PAGE_PDU_SIZE , & args );
16401640}
16411641
1642+ /**
1643+ * nvme_get_log_fdp_configurations() - Get list of Flexible Data Placement configurations
1644+ * @fd: File descriptor of nvme device
1645+ * @egid: Endurance group identifier
1646+ * @offset: Offset into log page
1647+ * @len: Length (in bytes) of provided user buffer to hold the log data
1648+ * @log: Log page data buffer
1649+ */
1650+ static inline int nvme_get_log_fdp_configurations (int fd , __u16 egid ,
1651+ __u32 offset , __u32 len , void * log )
1652+ {
1653+ struct nvme_get_log_args args = {
1654+ .lpo = offset ,
1655+ .result = NULL ,
1656+ .log = log ,
1657+ .args_size = sizeof (args ),
1658+ .fd = fd ,
1659+ .timeout = NVME_DEFAULT_IOCTL_TIMEOUT ,
1660+ .lid = NVME_LOG_LID_FDP_CONFIGS ,
1661+ .len = len ,
1662+ .nsid = NVME_NSID_NONE ,
1663+ .csi = NVME_CSI_NVM ,
1664+ .lsi = egid ,
1665+ .lsp = NVME_LOG_LSP_NONE ,
1666+ .uuidx = NVME_UUID_NONE ,
1667+ };
1668+
1669+ return nvme_get_log (& args );
1670+ }
1671+
1672+ /**
1673+ * nvme_get_log_reclaim_unit_handle_usage() - Get reclaim unit handle usage
1674+ * @fd: File descriptor of nvme device
1675+ * @nsid: Namespace identifier
1676+ * @egid: Endurance group identifier
1677+ * @offset: Offset into log page
1678+ * @len: Length (in bytes) of provided user buffer to hold the log data
1679+ * @log: Log page data buffer
1680+ */
1681+ static inline int nvme_get_log_reclaim_unit_handle_usage (int fd , __u32 nsid , __u16 egid ,
1682+ __u32 offset , __u32 len , void * log )
1683+ {
1684+ struct nvme_get_log_args args = {
1685+ .lpo = offset ,
1686+ .result = NULL ,
1687+ .log = log ,
1688+ .args_size = sizeof (args ),
1689+ .fd = fd ,
1690+ .timeout = NVME_DEFAULT_IOCTL_TIMEOUT ,
1691+ .lid = NVME_LOG_LID_FDP_RUH_USAGE ,
1692+ .len = len ,
1693+ .nsid = nsid ,
1694+ .csi = NVME_CSI_NVM ,
1695+ .lsi = egid ,
1696+ .lsp = NVME_LOG_LSP_NONE ,
1697+ .uuidx = NVME_UUID_NONE ,
1698+ };
1699+
1700+ return nvme_get_log (& args );
1701+ }
1702+
1703+ /**
1704+ * nvme_get_log_fdp_stats() - Get Flexible Data Placement statistics
1705+ * @fd: File descriptor of nvme device
1706+ * @egid: Endurance group identifier
1707+ * @offset: Offset into log page
1708+ * @len: Length (in bytes) of provided user buffer to hold the log data
1709+ * @log: Log page data buffer
1710+ */
1711+ static inline int nvme_get_log_fdp_stats (int fd , __u16 egid , __u32 offset , __u32 len , void * log )
1712+ {
1713+ struct nvme_get_log_args args = {
1714+ .lpo = offset ,
1715+ .result = NULL ,
1716+ .log = log ,
1717+ .args_size = sizeof (args ),
1718+ .fd = fd ,
1719+ .timeout = NVME_DEFAULT_IOCTL_TIMEOUT ,
1720+ .lid = NVME_LOG_LID_FDP_STATS ,
1721+ .len = len ,
1722+ .nsid = NVME_NSID_NONE ,
1723+ .csi = NVME_CSI_NVM ,
1724+ .lsi = egid ,
1725+ .lsp = NVME_LOG_LSP_NONE ,
1726+ .uuidx = NVME_UUID_NONE ,
1727+ };
1728+
1729+ return nvme_get_log (& args );
1730+ }
1731+
1732+ /**
1733+ * nvme_get_log_fdp_events() - Get Flexible Data Placement events
1734+ * @fd: File descriptor of nvme device
1735+ * @egid: Endurance group identifier
1736+ * @host_events: Whether to report host or controller events
1737+ * @offset: Offset into log page
1738+ * @len: Length (in bytes) of provided user buffer to hold the log data
1739+ * @log: Log page data buffer
1740+ */
1741+ static inline int nvme_get_log_fdp_events (int fd , __u16 egid , bool host_events , __u32 offset ,
1742+ __u32 len , void * log )
1743+ {
1744+ struct nvme_get_log_args args = {
1745+ .lpo = offset ,
1746+ .result = NULL ,
1747+ .log = log ,
1748+ .args_size = sizeof (args ),
1749+ .fd = fd ,
1750+ .timeout = NVME_DEFAULT_IOCTL_TIMEOUT ,
1751+ .lid = NVME_LOG_LID_FDP_EVENTS ,
1752+ .len = len ,
1753+ .nsid = NVME_NSID_NONE ,
1754+ .csi = NVME_CSI_NVM ,
1755+ .lsi = egid ,
1756+ .lsp = (__u8 )(host_events ? 0x1 : 0x0 ),
1757+ .uuidx = NVME_UUID_NONE ,
1758+ };
1759+
1760+ return nvme_get_log (& args );
1761+ }
1762+
16421763/**
16431764 * nvme_get_log_ana() - Retrieve Asymmetric Namespace Access log page
16441765 * @fd: File descriptor of nvme device
@@ -3604,6 +3725,77 @@ int nvme_resv_release(struct nvme_resv_release_args *args);
36043725 */
36053726int nvme_resv_report (struct nvme_resv_report_args * args );
36063727
3728+ /**
3729+ * nvme_io_mgmt_recv() - I/O Management Receive command
3730+ * @args: &struct nvme_io_mgmt_recv_args argument structure
3731+ *
3732+ * Return: The nvme command status if a response was received (see
3733+ * &enum nvme_status_field) or -1 with errno set otherwise.
3734+ */
3735+ int nvme_io_mgmt_recv (struct nvme_io_mgmt_recv_args * args );
3736+
3737+ /**
3738+ * nvme_fdp_reclaim_unit_handle_status() - Get reclaim unit handle status
3739+ * @fd: File descriptor of nvme device
3740+ * @nsid: Namespace identifier
3741+ * @data_len: Length of response buffer
3742+ * @data: Response buffer
3743+ *
3744+ * Return: The nvme command status if a response was received (see
3745+ * &enum nvme_status_field) or -1 with errno set otherwise.
3746+ */
3747+ static inline int nvme_fdp_reclaim_unit_handle_status (int fd , __u32 nsid ,
3748+ __u32 data_len , void * data )
3749+ {
3750+ struct nvme_io_mgmt_recv_args args = {
3751+ .data = data ,
3752+ .args_size = sizeof (args ),
3753+ .fd = fd ,
3754+ .nsid = nsid ,
3755+ .data_len = data_len ,
3756+ .timeout = NVME_DEFAULT_IOCTL_TIMEOUT ,
3757+ .mo = NVME_IO_MGMT_RECV_RUH_STATUS ,
3758+ };
3759+
3760+ return nvme_io_mgmt_recv (& args );
3761+ }
3762+
3763+ /**
3764+ * nvme_io_mgmt_send() - I/O Management Send command
3765+ * @args: &struct nvme_io_mgmt_send_args argument structure
3766+ *
3767+ * Return: The nvme command status if a response was received (see
3768+ * &enum nvme_status_field) or -1 with errno set otherwise.
3769+ */
3770+ int nvme_io_mgmt_send (struct nvme_io_mgmt_send_args * args );
3771+
3772+ /**
3773+ * nvme_fdp_reclaim_unit_handle_update() - Update a list of reclaim unit handles
3774+ * @fd: File descriptor of nvme device
3775+ * @nsid: Namespace identifier
3776+ * @npids: Number of placement identifiers
3777+ * @pids: List of placement identifiers
3778+ *
3779+ * Return: The nvme command status if a response was received (see
3780+ * &enum nvme_status_field) or -1 with errno set otherwise.
3781+ */
3782+ static inline int nvme_fdp_reclaim_unit_handle_update (int fd , __u32 nsid ,
3783+ unsigned int npids , __u16 * pids )
3784+ {
3785+ struct nvme_io_mgmt_send_args args = {
3786+ .data = (void * )pids ,
3787+ .args_size = sizeof (args ),
3788+ .fd = fd ,
3789+ .nsid = nsid ,
3790+ .data_len = (__u32 )(npids * sizeof (__u16 )),
3791+ .timeout = NVME_DEFAULT_IOCTL_TIMEOUT ,
3792+ .mos = (__u16 )(npids - 1 ),
3793+ .mo = NVME_IO_MGMT_SEND_RUH_UPDATE ,
3794+ };
3795+
3796+ return nvme_io_mgmt_send (& args );
3797+ }
3798+
36073799/**
36083800 * nvme_zns_mgmt_send() - ZNS management send command
36093801 * @args: &struct nvme_zns_mgmt_send_args argument structure
0 commit comments