Nvme block device abstraction layer. More...
Data Structures | |
struct | spdk_bdev_nvme_ctrlr_opts |
struct | spdk_bdev_nvme_opts |
Functions | |
SPDK_STATIC_ASSERT (sizeof(struct spdk_bdev_nvme_opts)==120, "Incorrect size") | |
int | spdk_bdev_nvme_create (struct spdk_nvme_transport_id *trid, const char *base_name, const char **names, uint32_t count, spdk_bdev_nvme_create_cb cb_fn, void *cb_ctx, struct spdk_nvme_ctrlr_opts *drv_opts, struct spdk_bdev_nvme_ctrlr_opts *bdev_opts) |
Connect to the NVMe controller and populate namespaces as bdevs. | |
void | spdk_bdev_nvme_set_multipath_policy (const char *name, enum spdk_bdev_nvme_multipath_policy policy, enum spdk_bdev_nvme_multipath_selector selector, uint32_t rr_min_io, spdk_bdev_nvme_set_multipath_policy_cb cb_fn, void *cb_arg) |
Set multipath policy of the NVMe bdev. | |
void | spdk_bdev_nvme_get_default_ctrlr_opts (struct spdk_bdev_nvme_ctrlr_opts *opts) |
void | spdk_bdev_nvme_get_opts (struct spdk_bdev_nvme_opts *opts, size_t opts_size) |
Get the default value for bdev nvme options. | |
int | spdk_bdev_nvme_set_opts (const struct spdk_bdev_nvme_opts *opts) |
Set the bdev nvme options. | |
int | spdk_bdev_nvme_delete (const char *name, const struct spdk_nvme_path_id *path_id, spdk_bdev_nvme_delete_cb delete_cb, void *cb_ctx) |
Delete the specified NVMe controller, or one of its paths. | |
Nvme block device abstraction layer.
int spdk_bdev_nvme_create | ( | struct spdk_nvme_transport_id * | trid, |
const char * | base_name, | ||
const char ** | names, | ||
uint32_t | count, | ||
spdk_bdev_nvme_create_cb | cb_fn, | ||
void * | cb_ctx, | ||
struct spdk_nvme_ctrlr_opts * | drv_opts, | ||
struct spdk_bdev_nvme_ctrlr_opts * | bdev_opts ) |
Connect to the NVMe controller and populate namespaces as bdevs.
trid | Transport ID for nvme controller. |
base_name | Base name for the nvme subsystem. |
names | Pointer to string array to get bdev names. |
count | Maximum count of the string array 'names'. Restricts the length of 'names' array only, not the count of bdevs created. |
cb_fn | Callback function to be called after all the bdevs are created or updated if already created. |
cb_ctx | Context to pass to cb_fn. |
drv_opts | NVMe driver options. |
bdev_opts | NVMe bdev options. |
int spdk_bdev_nvme_delete | ( | const char * | name, |
const struct spdk_nvme_path_id * | path_id, | ||
spdk_bdev_nvme_delete_cb | delete_cb, | ||
void * | cb_ctx ) |
Delete the specified NVMe controller, or one of its paths.
NOTE: When path_id is specified and it is the only path_id associated with NVMe controller the path is removed and the NVMe controller gets deleted.
name | NVMe controller name. |
path_id | The specified path to remove (optional). |
delete_cb | Callback function on delete complete (optional). |
cb_ctx | Context passed to callback (optional). |
void spdk_bdev_nvme_get_opts | ( | struct spdk_bdev_nvme_opts * | opts, |
size_t | opts_size ) |
Get the default value for bdev nvme options.
[out] | opts | Bdev nvme options object to be filled with default values. |
opts_size | Must be set to sizeof(struct spdk_bdev_nvme_opts). |
void spdk_bdev_nvme_set_multipath_policy | ( | const char * | name, |
enum spdk_bdev_nvme_multipath_policy | policy, | ||
enum spdk_bdev_nvme_multipath_selector | selector, | ||
uint32_t | rr_min_io, | ||
spdk_bdev_nvme_set_multipath_policy_cb | cb_fn, | ||
void * | cb_arg ) |
Set multipath policy of the NVMe bdev.
name | NVMe bdev name. |
policy | Multipath policy (active-passive or active-active). |
selector | Multipath selector (round_robin, queue_depth). |
rr_min_io | Number of IO to route to a path before switching to another for round-robin. |
cb_fn | Function to be called back after completion. |
cb_arg | Argument passed to the callback function. |
int spdk_bdev_nvme_set_opts | ( | const struct spdk_bdev_nvme_opts * | opts | ) |
Set the bdev nvme options.
opts | New value of bdev nvme options to be set. |