NVMe driver public API extension for Key-Value Command Set. More...
Macros | |
| #define | SPDK_NVME_KV_KEY_MIN_LEN 1 |
| Minimum length of a key in bytes. | |
| #define | SPDK_NVME_KV_KEY_MAX_LEN 16 |
| Maximum length of a key in bytes (per the NVMe Key-Value Command Set Specification). | |
Functions | |
| const struct spdk_nvme_kv_ns_data * | spdk_nvme_kv_ns_get_data (const struct spdk_nvme_ns *ns) |
| Get the Key-Value Command Set Specific Identify Namespace data as defined by the NVMe Key-Value Command Set Specification. | |
| const struct spdk_nvme_kv_ctrlr_data * | spdk_nvme_kv_ctrlr_get_data (const struct spdk_nvme_ctrlr *ctrlr) |
| Get the Key-Value Command Set Specific Identify Controller data as defined by the NVMe Key-Value Command Set Specification. | |
| int | spdk_nvme_kv_store (struct spdk_nvme_ns *ns, struct spdk_nvme_qpair *qpair, const void *key, uint8_t key_len, const void *value, uint32_t value_len, spdk_nvme_cmd_cb cb_fn, void *cb_arg, uint8_t options) |
| Submit a KV Store command to the specified NVMe namespace. | |
| int | spdk_nvme_kv_retrieve (struct spdk_nvme_ns *ns, struct spdk_nvme_qpair *qpair, const void *key, uint8_t key_len, void *value, uint32_t value_len, spdk_nvme_cmd_cb cb_fn, void *cb_arg, uint8_t options) |
| Submit a KV Retrieve command to the specified NVMe namespace. | |
| int | spdk_nvme_kv_delete (struct spdk_nvme_ns *ns, struct spdk_nvme_qpair *qpair, const void *key, uint8_t key_len, spdk_nvme_cmd_cb cb_fn, void *cb_arg) |
| Submit a KV Delete command to the specified NVMe namespace. | |
| int | spdk_nvme_kv_exist (struct spdk_nvme_ns *ns, struct spdk_nvme_qpair *qpair, const void *key, uint8_t key_len, spdk_nvme_cmd_cb cb_fn, void *cb_arg) |
| Submit a KV Exist command to the specified NVMe namespace. | |
| int | spdk_nvme_kv_list (struct spdk_nvme_ns *ns, struct spdk_nvme_qpair *qpair, const void *start_key, uint8_t start_key_len, void *buffer, uint32_t buffer_len, spdk_nvme_cmd_cb cb_fn, void *cb_arg) |
| Submit a KV List command to the specified NVMe namespace. | |
NVMe driver public API extension for Key-Value Command Set.
| const struct spdk_nvme_kv_ctrlr_data * spdk_nvme_kv_ctrlr_get_data | ( | const struct spdk_nvme_ctrlr * | ctrlr | ) |
Get the Key-Value Command Set Specific Identify Controller data as defined by the NVMe Key-Value Command Set Specification.
This function is thread safe and can be called at any point while the controller is attached to the SPDK NVMe driver.
| ctrlr | Opaque handle to NVMe controller. |
| int spdk_nvme_kv_delete | ( | struct spdk_nvme_ns * | ns, |
| struct spdk_nvme_qpair * | qpair, | ||
| const void * | key, | ||
| uint8_t | key_len, | ||
| spdk_nvme_cmd_cb | cb_fn, | ||
| void * | cb_arg ) |
Submit a KV Delete command to the specified NVMe namespace.
The command is submitted to a qpair allocated by spdk_nvme_ctrlr_alloc_io_qpair(). The user must ensure that only one thread submits I/O on a given qpair at any given time.
| ns | NVMe namespace to submit the KV Delete command. |
| qpair | I/O queue pair to submit the request. |
| key | Pointer to the key buffer. |
| key_len | Length of the key in bytes (SPDK_NVME_KV_KEY_MIN_LEN to SPDK_NVME_KV_KEY_MAX_LEN). |
| cb_fn | Callback function to invoke when the I/O is completed. |
| cb_arg | Argument to pass to the callback function. |
| int spdk_nvme_kv_exist | ( | struct spdk_nvme_ns * | ns, |
| struct spdk_nvme_qpair * | qpair, | ||
| const void * | key, | ||
| uint8_t | key_len, | ||
| spdk_nvme_cmd_cb | cb_fn, | ||
| void * | cb_arg ) |
Submit a KV Exist command to the specified NVMe namespace.
The command is submitted to a qpair allocated by spdk_nvme_ctrlr_alloc_io_qpair(). The user must ensure that only one thread submits I/O on a given qpair at any given time.
| ns | NVMe namespace to submit the KV Exist command. |
| qpair | I/O queue pair to submit the request. |
| key | Pointer to the key buffer. |
| key_len | Length of the key in bytes (SPDK_NVME_KV_KEY_MIN_LEN to SPDK_NVME_KV_KEY_MAX_LEN). |
| cb_fn | Callback function to invoke when the I/O is completed. |
| cb_arg | Argument to pass to the callback function. |
| int spdk_nvme_kv_list | ( | struct spdk_nvme_ns * | ns, |
| struct spdk_nvme_qpair * | qpair, | ||
| const void * | start_key, | ||
| uint8_t | start_key_len, | ||
| void * | buffer, | ||
| uint32_t | buffer_len, | ||
| spdk_nvme_cmd_cb | cb_fn, | ||
| void * | cb_arg ) |
Submit a KV List command to the specified NVMe namespace.
The command is submitted to a qpair allocated by spdk_nvme_ctrlr_alloc_io_qpair(). The user must ensure that only one thread submits I/O on a given qpair at any given time.
| ns | NVMe namespace to submit the KV List command. |
| qpair | I/O queue pair to submit the request. |
| start_key | Pointer to the starting key for iteration (may be NULL for all keys). |
| start_key_len | Length of the starting key in bytes (0-16). |
| buffer | Pointer to the buffer to store the list of keys. |
| buffer_len | Length of the buffer in bytes. |
| cb_fn | Callback function to invoke when the I/O is completed. |
| cb_arg | Argument to pass to the callback function. |
| const struct spdk_nvme_kv_ns_data * spdk_nvme_kv_ns_get_data | ( | const struct spdk_nvme_ns * | ns | ) |
Get the Key-Value Command Set Specific Identify Namespace data as defined by the NVMe Key-Value Command Set Specification.
This function is thread safe and can be called at any point while the controller is attached to the SPDK NVMe driver.
| ns | Namespace. |
| int spdk_nvme_kv_retrieve | ( | struct spdk_nvme_ns * | ns, |
| struct spdk_nvme_qpair * | qpair, | ||
| const void * | key, | ||
| uint8_t | key_len, | ||
| void * | value, | ||
| uint32_t | value_len, | ||
| spdk_nvme_cmd_cb | cb_fn, | ||
| void * | cb_arg, | ||
| uint8_t | options ) |
Submit a KV Retrieve command to the specified NVMe namespace.
The command is submitted to a qpair allocated by spdk_nvme_ctrlr_alloc_io_qpair(). The user must ensure that only one thread submits I/O on a given qpair at any given time.
| ns | NVMe namespace to submit the KV Retrieve command. |
| qpair | I/O queue pair to submit the request. |
| key | Pointer to the key buffer. |
| key_len | Length of the key in bytes (SPDK_NVME_KV_KEY_MIN_LEN to SPDK_NVME_KV_KEY_MAX_LEN). |
| value | Pointer to the value buffer to store the retrieved value. |
| value_len | Length of the value buffer in bytes. |
| cb_fn | Callback function to invoke when the I/O is completed. |
| cb_arg | Argument to pass to the callback function. |
| options | Retrieve options, see spdk_nvme_kv_retrieve_option in nvme_spec.h. |
| int spdk_nvme_kv_store | ( | struct spdk_nvme_ns * | ns, |
| struct spdk_nvme_qpair * | qpair, | ||
| const void * | key, | ||
| uint8_t | key_len, | ||
| const void * | value, | ||
| uint32_t | value_len, | ||
| spdk_nvme_cmd_cb | cb_fn, | ||
| void * | cb_arg, | ||
| uint8_t | options ) |
Submit a KV Store command to the specified NVMe namespace.
The command is submitted to a qpair allocated by spdk_nvme_ctrlr_alloc_io_qpair(). The user must ensure that only one thread submits I/O on a given qpair at any given time.
| ns | NVMe namespace to submit the KV Store command. |
| qpair | I/O queue pair to submit the request. |
| key | Pointer to the key buffer. |
| key_len | Length of the key in bytes (SPDK_NVME_KV_KEY_MIN_LEN to SPDK_NVME_KV_KEY_MAX_LEN). |
| value | Pointer to the value buffer. |
| value_len | Length of the value in bytes. |
| cb_fn | Callback function to invoke when the I/O is completed. |
| cb_arg | Argument to pass to the callback function. |
| options | Store options, see spdk_nvme_kv_store_option in nvme_spec.h. |