]> www.infradead.org Git - users/sagi/libnvme.git/commitdiff
ioctl: export nvme_{g,s}et_features_iocs_profile()
authorCaleb Sander <csander@purestorage.com>
Thu, 14 Sep 2023 21:14:13 +0000 (15:14 -0600)
committerDaniel Wagner <wagi@monom.org>
Wed, 20 Sep 2023 08:33:57 +0000 (10:33 +0200)
nvme_get_features_iocs_profile() and nvme_set_features_iocs_profile()
are defined but not exorted in libnvme.so.
nvme_set_features_iocs_profile()'s prototype was also removed,
so add it back.
IOCSI is a 9-bit value, so fix its bitmask and change its type to u16.

Signed-off-by: Caleb Sander <csander@purestorage.com>
src/libnvme.map
src/nvme/ioctl.c
src/nvme/ioctl.h
src/nvme/types.h

index 29f4c180d9d5161089f844e508fa0c01203d84d0..5215c284ba05cd5c4512488aa3c5174682ef0cf1 100644 (file)
@@ -6,9 +6,11 @@ LIBNVME_1_6 {
                nvme_ctrl_get_src_addr;
                nvme_ctrl_release_fd;
                nvme_get_features_host_mem_buf2;
+               nvme_get_features_iocs_profile;
                nvme_host_release_fds;
                nvme_ns_release_fd;
                nvme_root_release_fds;
+               nvme_set_features_iocs_profile;
                nvme_subsystem_get_iopolicy;
                nvme_subsystem_release_fds;
                nvme_set_debug;
index 24bfd8e4bc002343d4b3426fb550ade4e52895a0..a183f50172488ff21972a1821a4adaa077fd1b24 100644 (file)
@@ -887,7 +887,7 @@ int nvme_set_features_write_protect(int fd, enum nvme_feat_nswpcfg_state state,
                                   false, result);
 }
 
-int nvme_set_features_iocs_profile(int fd, __u8 iocsi, bool save)
+int nvme_set_features_iocs_profile(int fd, __u16 iocsi, bool save)
 {
        __u32 value = NVME_SET(iocsi, FEAT_IOCSP_IOCSCI);
 
index 916fa87113dc27ec5d90fdc745644aed1e77426a..ff58ad35b19f6b601ca4b644bf2f34c3345b3044 100644 (file)
@@ -2551,6 +2551,17 @@ int nvme_set_features_resv_persist(int fd, bool ptpl, bool save, __u32 *result);
 int nvme_set_features_write_protect(int fd, enum nvme_feat_nswpcfg_state state,
                                    bool save, __u32 *result);
 
+/**
+ * nvme_set_features_iocs_profile() - Set I/O command set profile feature
+ * @fd:                File descriptor of nvme device
+ * @iocsi:     I/O Command Set Combination Index
+ * @save:      Save value across power states
+ *
+ * Return: The nvme command status if a response was received (see
+ * &enum nvme_status_field) or -1 with errno set otherwise.
+ */
+int nvme_set_features_iocs_profile(int fd, __u16 iocsi, bool save);
+
 /**
  * nvme_get_features() - Retrieve a feature attribute
  * @args:      &struct nvme_get_features_args argument structure
index 5c7eecca8c6a03df40407aa7dde59f4ba767f77b..b1bc72f7bdb7d55b9d967adfda23216e78d793c5 100644 (file)
@@ -7020,7 +7020,7 @@ enum nvme_feat {
        NVME_FEAT_WP_WPS_SHIFT          = 0,
        NVME_FEAT_WP_WPS_MASK           = 0x7,
        NVME_FEAT_IOCSP_IOCSCI_SHIFT    = 0,
-       NVME_FEAT_IOCSP_IOCSCI_MASK     = 0xff,
+       NVME_FEAT_IOCSP_IOCSCI_MASK     = 0x1ff,
        NVME_FEAT_FDP_ENABLED_SHIFT     = 0,
        NVME_FEAT_FDP_ENABLED_MASK      = 0x1,
        NVME_FEAT_FDP_INDEX_SHIFT       = 8,