NVMe over Fabrics target public API. More...
Data Structures | |
struct | spdk_nvmf_target_opts |
struct | spdk_nvmf_transport_opts |
struct | spdk_nvmf_listen_opts |
struct | spdk_nvmf_poll_group_stat |
struct | spdk_nvmf_referral_opts |
struct | spdk_nvmf_host_opts |
struct | spdk_nvmf_listener_opts |
struct | spdk_nvmf_ns_opts |
NVMe-oF target namespace creation options. More... | |
struct | spdk_nvmf_registrant_info |
struct | spdk_nvmf_reservation_info |
struct | spdk_nvmf_ns_reservation_ops |
Macros | |
#define | NVMF_TGT_NAME_MAX_LENGTH 256 |
#define | SPDK_TLS_PSK_MAX_LEN 200 |
#define | SPDK_NVMF_MAX_NUM_REGISTRANTS 16 |
Typedefs | |
typedef void(* | spdk_nvmf_tgt_subsystem_listen_done_fn) (void *ctx, int status) |
Function to be called once asynchronous listen add and remove operations are completed. | |
typedef void | spdk_nvmf_tgt_destroy_done_fn(void *ctx, int status) |
typedef void(* | spdk_nvmf_poll_group_destroy_done_fn) (void *cb_arg, int status) |
typedef void(* | nvmf_qpair_disconnect_cb) (void *ctx) |
typedef void(* | nvmf_subsystem_destroy_cb) (void *cb_arg) |
typedef void(* | spdk_nvmf_subsystem_state_change_done) (struct spdk_nvmf_subsystem *subsystem, void *cb_arg, int status) |
Function to be called once the subsystem has changed state. | |
typedef void(* | spdk_nvmf_transport_create_done_cb) (void *cb_arg, struct spdk_nvmf_transport *transport) |
typedef void(* | spdk_nvmf_transport_destroy_done_cb) (void *cb_arg) |
typedef void(* | spdk_nvmf_tgt_add_transport_done_fn) (void *cb_arg, int status) |
Function to be called once transport add is complete. | |
typedef void(* | spdk_nvmf_tgt_pause_polling_cb_fn) (void *cb_arg, int status) |
Function to be called once target pause is complete. | |
typedef void(* | spdk_nvmf_tgt_resume_polling_cb_fn) (void *cb_arg, int status) |
Function to be called once target resume is complete. | |
Enumerations | |
enum | spdk_nvmf_tgt_discovery_filter { SPDK_NVMF_TGT_DISCOVERY_MATCH_ANY = 0 , SPDK_NVMF_TGT_DISCOVERY_MATCH_TRANSPORT_TYPE = 1u << 0u , SPDK_NVMF_TGT_DISCOVERY_MATCH_TRANSPORT_ADDRESS = 1u << 1u , SPDK_NVMF_TGT_DISCOVERY_MATCH_TRANSPORT_SVCID = 1u << 2u } |
Specify filter rules which are applied during discovery log generation. More... | |
Functions | |
SPDK_STATIC_ASSERT (sizeof(struct spdk_nvmf_transport_opts)==72, "Incorrect size") | |
SPDK_STATIC_ASSERT (sizeof(struct spdk_nvmf_listen_opts)==32, "Incorrect size") | |
void | spdk_nvmf_listen_opts_init (struct spdk_nvmf_listen_opts *opts, size_t opts_size) |
Initialize listen options. | |
int | spdk_nvmf_tgt_add_referral (struct spdk_nvmf_tgt *tgt, const struct spdk_nvmf_referral_opts *opts) |
Add a discovery service referral to an NVMe-oF target. | |
int | spdk_nvmf_tgt_remove_referral (struct spdk_nvmf_tgt *tgt, const struct spdk_nvmf_referral_opts *opts) |
Remove a discovery service referral from an NVMeoF target. | |
struct spdk_nvmf_tgt * | spdk_nvmf_tgt_create (struct spdk_nvmf_target_opts *opts) |
Construct an NVMe-oF target. | |
void | spdk_nvmf_tgt_destroy (struct spdk_nvmf_tgt *tgt, spdk_nvmf_tgt_destroy_done_fn cb_fn, void *cb_arg) |
Destroy an NVMe-oF target. | |
const char * | spdk_nvmf_tgt_get_name (struct spdk_nvmf_tgt *tgt) |
Get the name of an NVMe-oF target. | |
struct spdk_nvmf_tgt * | spdk_nvmf_get_tgt (const char *name) |
Get a pointer to an NVMe-oF target. | |
struct spdk_nvmf_tgt * | spdk_nvmf_get_first_tgt (void) |
Get the pointer to the first NVMe-oF target. | |
struct spdk_nvmf_tgt * | spdk_nvmf_get_next_tgt (struct spdk_nvmf_tgt *prev) |
Get the pointer to the first NVMe-oF target. | |
void | spdk_nvmf_tgt_write_config_json (struct spdk_json_write_ctx *w, struct spdk_nvmf_tgt *tgt) |
Write NVMe-oF target configuration into provided JSON context. | |
int | spdk_nvmf_tgt_listen_ext (struct spdk_nvmf_tgt *tgt, const struct spdk_nvme_transport_id *trid, struct spdk_nvmf_listen_opts *opts) |
Begin accepting new connections at the address provided. | |
int | spdk_nvmf_tgt_stop_listen (struct spdk_nvmf_tgt *tgt, struct spdk_nvme_transport_id *trid) |
Stop accepting new connections at the provided address. | |
struct spdk_nvmf_poll_group * | spdk_nvmf_poll_group_create (struct spdk_nvmf_tgt *tgt) |
Create a poll group. | |
struct spdk_nvmf_poll_group * | spdk_nvmf_get_optimal_poll_group (struct spdk_nvmf_qpair *qpair) |
Get optimal nvmf poll group for the qpair. | |
void | spdk_nvmf_poll_group_destroy (struct spdk_nvmf_poll_group *group, spdk_nvmf_poll_group_destroy_done_fn cb_fn, void *cb_arg) |
Destroy a poll group. | |
int | spdk_nvmf_poll_group_add (struct spdk_nvmf_poll_group *group, struct spdk_nvmf_qpair *qpair) |
Add the given qpair to the poll group. | |
int | spdk_nvmf_qpair_disconnect (struct spdk_nvmf_qpair *qpair) |
Disconnect an NVMe-oF qpair. | |
int | spdk_nvmf_qpair_get_peer_trid (struct spdk_nvmf_qpair *qpair, struct spdk_nvme_transport_id *trid) |
Get the peer's transport ID for this queue pair. | |
int | spdk_nvmf_qpair_get_local_trid (struct spdk_nvmf_qpair *qpair, struct spdk_nvme_transport_id *trid) |
Get the local transport ID for this queue pair. | |
int | spdk_nvmf_qpair_get_listen_trid (struct spdk_nvmf_qpair *qpair, struct spdk_nvme_transport_id *trid) |
Get the associated listener transport ID for this queue pair. | |
struct spdk_nvmf_subsystem * | spdk_nvmf_subsystem_create (struct spdk_nvmf_tgt *tgt, const char *nqn, enum spdk_nvmf_subtype type, uint32_t num_ns) |
Create an NVMe-oF subsystem. | |
int | spdk_nvmf_subsystem_destroy (struct spdk_nvmf_subsystem *subsystem, nvmf_subsystem_destroy_cb cpl_cb, void *cpl_cb_arg) |
Destroy an NVMe-oF subsystem. | |
int | spdk_nvmf_subsystem_start (struct spdk_nvmf_subsystem *subsystem, spdk_nvmf_subsystem_state_change_done cb_fn, void *cb_arg) |
Transition an NVMe-oF subsystem from Inactive to Active state. | |
int | spdk_nvmf_subsystem_stop (struct spdk_nvmf_subsystem *subsystem, spdk_nvmf_subsystem_state_change_done cb_fn, void *cb_arg) |
Transition an NVMe-oF subsystem from Active to Inactive state. | |
int | spdk_nvmf_subsystem_pause (struct spdk_nvmf_subsystem *subsystem, uint32_t nsid, spdk_nvmf_subsystem_state_change_done cb_fn, void *cb_arg) |
Transition an NVMe-oF subsystem from Active to Paused state. | |
int | spdk_nvmf_subsystem_resume (struct spdk_nvmf_subsystem *subsystem, spdk_nvmf_subsystem_state_change_done cb_fn, void *cb_arg) |
Transition an NVMe-oF subsystem from Paused to Active state. | |
struct spdk_nvmf_subsystem * | spdk_nvmf_tgt_find_subsystem (struct spdk_nvmf_tgt *tgt, const char *subnqn) |
Search the target for a subsystem with the given NQN. | |
struct spdk_nvmf_subsystem * | spdk_nvmf_subsystem_get_first (struct spdk_nvmf_tgt *tgt) |
Begin iterating over all known subsystems. | |
struct spdk_nvmf_subsystem * | spdk_nvmf_subsystem_get_next (struct spdk_nvmf_subsystem *subsystem) |
Continue iterating over all known subsystems. | |
int | spdk_nvmf_ns_add_host (struct spdk_nvmf_subsystem *subsystem, uint32_t nsid, const char *hostnqn, uint32_t flags) |
Make the specified namespace visible to the specified host. | |
int | spdk_nvmf_ns_remove_host (struct spdk_nvmf_subsystem *subsystem, uint32_t nsid, const char *hostnqn, uint32_t flags) |
Make the specified namespace not visible to the specified host. | |
int | spdk_nvmf_subsystem_add_host (struct spdk_nvmf_subsystem *subsystem, const char *hostnqn, const struct spdk_json_val *params) |
Allow the given host NQN to connect to the given subsystem. | |
int | spdk_nvmf_subsystem_add_host_ext (struct spdk_nvmf_subsystem *subsystem, const char *hostnqn, struct spdk_nvmf_host_opts *opts) |
Allow the given host to connect to the given subsystem. | |
int | spdk_nvmf_subsystem_remove_host (struct spdk_nvmf_subsystem *subsystem, const char *hostnqn) |
Remove the given host NQN from the list of allowed hosts. | |
int | spdk_nvmf_subsystem_disconnect_host (struct spdk_nvmf_subsystem *subsystem, const char *hostnqn, spdk_nvmf_tgt_subsystem_listen_done_fn cb_fn, void *cb_arg) |
Disconnect all connections originating from the provided hostnqn. | |
int | spdk_nvmf_subsystem_set_allow_any_host (struct spdk_nvmf_subsystem *subsystem, bool allow_any_host) |
Set whether a subsystem should allow any host or only hosts in the allowed list. | |
bool | spdk_nvmf_subsystem_get_allow_any_host (const struct spdk_nvmf_subsystem *subsystem) |
Check whether a subsystem should allow any host or only hosts in the allowed list. | |
bool | spdk_nvmf_subsystem_host_allowed (struct spdk_nvmf_subsystem *subsystem, const char *hostnqn) |
Check if the given host is allowed to connect to the subsystem. | |
struct spdk_nvmf_host * | spdk_nvmf_subsystem_get_first_host (struct spdk_nvmf_subsystem *subsystem) |
Get the first allowed host in a subsystem. | |
struct spdk_nvmf_host * | spdk_nvmf_subsystem_get_next_host (struct spdk_nvmf_subsystem *subsystem, struct spdk_nvmf_host *prev_host) |
Get the next allowed host in a subsystem. | |
const char * | spdk_nvmf_host_get_nqn (const struct spdk_nvmf_host *host) |
Get a host's NQN. | |
void | spdk_nvmf_subsystem_add_listener (struct spdk_nvmf_subsystem *subsystem, struct spdk_nvme_transport_id *trid, spdk_nvmf_tgt_subsystem_listen_done_fn cb_fn, void *cb_arg) |
Accept new connections on the address provided. | |
SPDK_STATIC_ASSERT (sizeof(struct spdk_nvmf_listener_opts)==24, "Incorrect size") | |
void | spdk_nvmf_subsystem_listener_opts_init (struct spdk_nvmf_listener_opts *opts, size_t size) |
Initialize options structure for listener creation. | |
void | spdk_nvmf_subsystem_add_listener_ext (struct spdk_nvmf_subsystem *subsystem, struct spdk_nvme_transport_id *trid, spdk_nvmf_tgt_subsystem_listen_done_fn cb_fn, void *cb_arg, struct spdk_nvmf_listener_opts *opts) |
Accept new connections on the address provided. | |
int | spdk_nvmf_subsystem_remove_listener (struct spdk_nvmf_subsystem *subsystem, const struct spdk_nvme_transport_id *trid) |
Remove the listener from subsystem. | |
bool | spdk_nvmf_subsystem_listener_allowed (struct spdk_nvmf_subsystem *subsystem, const struct spdk_nvme_transport_id *trid) |
Check if connections originated from the given address are allowed to connect to the subsystem. | |
struct spdk_nvmf_subsystem_listener * | spdk_nvmf_subsystem_get_first_listener (struct spdk_nvmf_subsystem *subsystem) |
Get the first allowed listen address in the subsystem. | |
struct spdk_nvmf_subsystem_listener * | spdk_nvmf_subsystem_get_next_listener (struct spdk_nvmf_subsystem *subsystem, struct spdk_nvmf_subsystem_listener *prev_listener) |
Get the next allowed listen address in a subsystem. | |
const struct spdk_nvme_transport_id * | spdk_nvmf_subsystem_listener_get_trid (struct spdk_nvmf_subsystem_listener *listener) |
Get a listen address' transport ID. | |
void | spdk_nvmf_subsystem_allow_any_listener (struct spdk_nvmf_subsystem *subsystem, bool allow_any_listener) |
Set whether a subsystem should allow any listen address or only addresses in the allowed list. | |
bool | spdk_nvmf_subsystem_any_listener_allowed (struct spdk_nvmf_subsystem *subsystem) |
Check whether a subsystem allows any listen address or only addresses in the allowed list. | |
int | spdk_nvmf_subsystem_set_ana_reporting (struct spdk_nvmf_subsystem *subsystem, bool ana_reporting) |
Set whether a subsystem supports Asymmetric Namespace Access (ANA) reporting. | |
bool | spdk_nvmf_subsystem_get_ana_reporting (struct spdk_nvmf_subsystem *subsystem) |
Get whether a subsystem supports Asymmetric Namespace Access (ANA) reporting. | |
void | spdk_nvmf_subsystem_set_ana_state (struct spdk_nvmf_subsystem *subsystem, const struct spdk_nvme_transport_id *trid, enum spdk_nvme_ana_state ana_state, uint32_t anagrpid, spdk_nvmf_tgt_subsystem_listen_done_fn cb_fn, void *cb_arg) |
Set Asymmetric Namespace Access (ANA) state for the specified ANA group id. | |
int | spdk_nvmf_subsystem_get_ana_state (struct spdk_nvmf_subsystem *subsystem, const struct spdk_nvme_transport_id *trid, uint32_t anagrpid, enum spdk_nvme_ana_state *ana_state) |
Get Asymmetric Namespace Access (ANA) state for the specified ANA group id. | |
int | spdk_nvmf_subsystem_set_cntlid_range (struct spdk_nvmf_subsystem *subsystem, uint16_t min_cntlid, uint16_t max_cntlid) |
Sets the controller ID range for a subsystem. | |
SPDK_STATIC_ASSERT (sizeof(struct spdk_nvmf_ns_opts)==72, "Incorrect size") | |
void | spdk_nvmf_ns_opts_get_defaults (struct spdk_nvmf_ns_opts *opts, size_t opts_size) |
Get default namespace creation options. | |
uint32_t | spdk_nvmf_subsystem_add_ns_ext (struct spdk_nvmf_subsystem *subsystem, const char *bdev_name, const struct spdk_nvmf_ns_opts *opts, size_t opts_size, const char *ptpl_file) |
Add a namespace to a subsystems in the PAUSED or INACTIVE states. | |
int | spdk_nvmf_subsystem_remove_ns (struct spdk_nvmf_subsystem *subsystem, uint32_t nsid) |
Remove a namespace from a subsystem. | |
struct spdk_nvmf_ns * | spdk_nvmf_subsystem_get_first_ns (struct spdk_nvmf_subsystem *subsystem) |
Get the first allocated namespace in a subsystem. | |
struct spdk_nvmf_ns * | spdk_nvmf_subsystem_get_next_ns (struct spdk_nvmf_subsystem *subsystem, struct spdk_nvmf_ns *prev_ns) |
Get the next allocated namespace in a subsystem. | |
struct spdk_nvmf_ns * | spdk_nvmf_subsystem_get_ns (struct spdk_nvmf_subsystem *subsystem, uint32_t nsid) |
Get a namespace in a subsystem by NSID. | |
uint32_t | spdk_nvmf_subsystem_get_max_namespaces (const struct spdk_nvmf_subsystem *subsystem) |
Get the maximum number of namespaces allowed in a subsystem. | |
uint16_t | spdk_nvmf_subsystem_get_min_cntlid (const struct spdk_nvmf_subsystem *subsystem) |
Get the minimum controller ID allowed in a subsystem. | |
uint16_t | spdk_nvmf_subsystem_get_max_cntlid (const struct spdk_nvmf_subsystem *subsystem) |
Get the maximum controller ID allowed in a subsystem. | |
uint32_t | spdk_nvmf_ns_get_id (const struct spdk_nvmf_ns *ns) |
Get a namespace's NSID. | |
struct spdk_bdev * | spdk_nvmf_ns_get_bdev (struct spdk_nvmf_ns *ns) |
Get a namespace's associated bdev. | |
void | spdk_nvmf_ns_get_opts (const struct spdk_nvmf_ns *ns, struct spdk_nvmf_ns_opts *opts, size_t opts_size) |
Get the options specified for a namespace. | |
const char * | spdk_nvmf_subsystem_get_sn (const struct spdk_nvmf_subsystem *subsystem) |
Get the serial number of the specified subsystem. | |
int | spdk_nvmf_subsystem_set_sn (struct spdk_nvmf_subsystem *subsystem, const char *sn) |
Set the serial number for the specified subsystem. | |
const char * | spdk_nvmf_subsystem_get_mn (const struct spdk_nvmf_subsystem *subsystem) |
Get the model number of the specified subsystem. | |
int | spdk_nvmf_subsystem_set_mn (struct spdk_nvmf_subsystem *subsystem, const char *mn) |
Set the model number for the specified subsystem. | |
const char * | spdk_nvmf_subsystem_get_nqn (const struct spdk_nvmf_subsystem *subsystem) |
Get the NQN of the specified subsystem. | |
enum spdk_nvmf_subtype | spdk_nvmf_subsystem_get_type (struct spdk_nvmf_subsystem *subsystem) |
Get the type of the specified subsystem. | |
uint32_t | spdk_nvmf_subsystem_get_max_nsid (struct spdk_nvmf_subsystem *subsystem) |
Get maximum namespace id of the specified subsystem. | |
bool | spdk_nvmf_subsystem_is_discovery (struct spdk_nvmf_subsystem *subsystem) |
Checks whether a given subsystem is a discovery subsystem. | |
bool | spdk_nvmf_transport_opts_init (const char *transport_name, struct spdk_nvmf_transport_opts *opts, size_t opts_size) |
Initialize transport options. | |
struct spdk_nvmf_transport * | spdk_nvmf_transport_create (const char *transport_name, struct spdk_nvmf_transport_opts *opts) |
Create a protocol transport - deprecated, please use spdk_nvmf_transport_create_async. | |
int | spdk_nvmf_transport_create_async (const char *transport_name, struct spdk_nvmf_transport_opts *opts, spdk_nvmf_transport_create_done_cb cb_fn, void *cb_arg) |
Create a protocol transport. | |
int | spdk_nvmf_transport_destroy (struct spdk_nvmf_transport *transport, spdk_nvmf_transport_destroy_done_cb cb_fn, void *cb_arg) |
Destroy a protocol transport. | |
struct spdk_nvmf_transport * | spdk_nvmf_tgt_get_transport (struct spdk_nvmf_tgt *tgt, const char *transport_name) |
Get an existing transport from the target. | |
struct spdk_nvmf_transport * | spdk_nvmf_transport_get_first (struct spdk_nvmf_tgt *tgt) |
Get the first transport registered with the given target. | |
struct spdk_nvmf_transport * | spdk_nvmf_transport_get_next (struct spdk_nvmf_transport *transport) |
Get the next transport in a target's list. | |
const struct spdk_nvmf_transport_opts * | spdk_nvmf_get_transport_opts (struct spdk_nvmf_transport *transport) |
Get the opts for a given transport. | |
spdk_nvme_transport_type_t | spdk_nvmf_get_transport_type (struct spdk_nvmf_transport *transport) |
Get the transport type for a given transport. | |
const char * | spdk_nvmf_get_transport_name (struct spdk_nvmf_transport *transport) |
Get the transport name for a given transport. | |
void | spdk_nvmf_tgt_add_transport (struct spdk_nvmf_tgt *tgt, struct spdk_nvmf_transport *transport, spdk_nvmf_tgt_add_transport_done_fn cb_fn, void *cb_arg) |
Add a transport to a target. | |
int | spdk_nvmf_tgt_pause_polling (struct spdk_nvmf_tgt *tgt, spdk_nvmf_tgt_pause_polling_cb_fn cb_fn, void *cb_arg) |
Pause polling on the given target. | |
int | spdk_nvmf_tgt_resume_polling (struct spdk_nvmf_tgt *tgt, spdk_nvmf_tgt_resume_polling_cb_fn cb_fn, void *cb_arg) |
Resume polling on the given target. | |
int | spdk_nvmf_transport_listen (struct spdk_nvmf_transport *transport, const struct spdk_nvme_transport_id *trid, struct spdk_nvmf_listen_opts *opts) |
Add listener to transport and begin accepting new connections. | |
int | spdk_nvmf_transport_stop_listen (struct spdk_nvmf_transport *transport, const struct spdk_nvme_transport_id *trid) |
Remove listener from transport and stop accepting new connections. | |
int | spdk_nvmf_transport_stop_listen_async (struct spdk_nvmf_transport *transport, const struct spdk_nvme_transport_id *trid, struct spdk_nvmf_subsystem *subsystem, spdk_nvmf_tgt_subsystem_listen_done_fn cb_fn, void *cb_arg) |
Stop accepting new connections at the provided address. | |
void | spdk_nvmf_poll_group_dump_stat (struct spdk_nvmf_poll_group *group, struct spdk_json_write_ctx *w) |
Dump poll group statistics into JSON. | |
void | spdk_nvmf_rdma_init_hooks (struct spdk_nvme_rdma_hooks *hooks) |
Set the global hooks for the RDMA transport, if necessary. | |
void | spdk_nvmf_set_custom_ns_reservation_ops (const struct spdk_nvmf_ns_reservation_ops *ops) |
Set custom handlers for namespace reservation operations. | |
NVMe over Fabrics target public API.
typedef void(* spdk_nvmf_subsystem_state_change_done) (struct spdk_nvmf_subsystem *subsystem, void *cb_arg, int status) |
Function to be called once the subsystem has changed state.
subsystem | NVMe-oF subsystem that has changed state. |
cb_arg | Argument passed to callback function. |
status | 0 if it completed successfully, or negative errno if it failed. |
typedef void(* spdk_nvmf_tgt_add_transport_done_fn) (void *cb_arg, int status) |
Function to be called once transport add is complete.
cb_arg | Callback argument passed to this function. |
status | 0 if it completed successfully, or negative errno if it failed. |
typedef void(* spdk_nvmf_tgt_pause_polling_cb_fn) (void *cb_arg, int status) |
Function to be called once target pause is complete.
cb_arg | Callback argument passed to this function. |
status | 0 if it completed successfully, or negative errno if it failed. |
typedef void(* spdk_nvmf_tgt_resume_polling_cb_fn) (void *cb_arg, int status) |
Function to be called once target resume is complete.
cb_arg | Callback argument passed to this function. |
status | 0 if it completed successfully, or negative errno if it failed. |
typedef void(* spdk_nvmf_tgt_subsystem_listen_done_fn) (void *ctx, int status) |
Function to be called once asynchronous listen add and remove operations are completed.
See spdk_nvmf_subsystem_add_listener() and spdk_nvmf_transport_stop_listen_async().
ctx | Context argument passed to this function. |
status | 0 if it completed successfully, or negative errno if it failed. |
Specify filter rules which are applied during discovery log generation.
struct spdk_nvmf_tgt * spdk_nvmf_get_first_tgt | ( | void | ) |
Get the pointer to the first NVMe-oF target.
Combined with spdk_nvmf_get_next_tgt to iterate over all available targets.
struct spdk_nvmf_tgt * spdk_nvmf_get_next_tgt | ( | struct spdk_nvmf_tgt * | prev | ) |
Get the pointer to the first NVMe-oF target.
Combined with spdk_nvmf_get_first_tgt to iterate over all available targets.
prev | A pointer to the last NVMe-oF target. |
struct spdk_nvmf_poll_group * spdk_nvmf_get_optimal_poll_group | ( | struct spdk_nvmf_qpair * | qpair | ) |
Get optimal nvmf poll group for the qpair.
qpair | Requested qpair |
struct spdk_nvmf_tgt * spdk_nvmf_get_tgt | ( | const char * | name | ) |
Get a pointer to an NVMe-oF target.
In order to support some legacy applications and RPC methods that may rely on the concept that there is only one target, the name parameter can be passed as NULL. If there is only one available target, that target will be returned. Otherwise, name is a required parameter.
name | The name provided when the target was created. |
const char * spdk_nvmf_get_transport_name | ( | struct spdk_nvmf_transport * | transport | ) |
Get the transport name for a given transport.
transport | The transport to query |
const struct spdk_nvmf_transport_opts * spdk_nvmf_get_transport_opts | ( | struct spdk_nvmf_transport * | transport | ) |
Get the opts for a given transport.
transport | The transport to query |
spdk_nvme_transport_type_t spdk_nvmf_get_transport_type | ( | struct spdk_nvmf_transport * | transport | ) |
Get the transport type for a given transport.
transport | The transport to query |
const char * spdk_nvmf_host_get_nqn | ( | const struct spdk_nvmf_host * | host | ) |
Get a host's NQN.
host | Host to query. |
void spdk_nvmf_listen_opts_init | ( | struct spdk_nvmf_listen_opts * | opts, |
size_t | opts_size ) |
Initialize listen options.
opts | Listener options. |
opts_size | Must be set to sizeof(struct spdk_nvmf_listen_opts). |
int spdk_nvmf_ns_add_host | ( | struct spdk_nvmf_subsystem * | subsystem, |
uint32_t | nsid, | ||
const char * | hostnqn, | ||
uint32_t | flags ) |
Make the specified namespace visible to the specified host.
May only be performed on subsystems in the PAUSED or INACTIVE states.
subsystem | Subsystem the namespace belong to. |
nsid | Namespace ID to be made visible. |
hostnqn | The NQN for the host. |
flags | Must be zero (reserved for future use). |
struct spdk_bdev * spdk_nvmf_ns_get_bdev | ( | struct spdk_nvmf_ns * | ns | ) |
Get a namespace's associated bdev.
ns | Namespace to query. |
uint32_t spdk_nvmf_ns_get_id | ( | const struct spdk_nvmf_ns * | ns | ) |
Get a namespace's NSID.
ns | Namespace to query. |
void spdk_nvmf_ns_get_opts | ( | const struct spdk_nvmf_ns * | ns, |
struct spdk_nvmf_ns_opts * | opts, | ||
size_t | opts_size ) |
Get the options specified for a namespace.
ns | Namespace to query. |
opts | Output parameter for options. |
opts_size | sizeof(*opts) |
void spdk_nvmf_ns_opts_get_defaults | ( | struct spdk_nvmf_ns_opts * | opts, |
size_t | opts_size ) |
Get default namespace creation options.
opts | Namespace options to fill with defaults. |
opts_size | sizeof(struct spdk_nvmf_ns_opts) |
int spdk_nvmf_ns_remove_host | ( | struct spdk_nvmf_subsystem * | subsystem, |
uint32_t | nsid, | ||
const char * | hostnqn, | ||
uint32_t | flags ) |
Make the specified namespace not visible to the specified host.
May only be performed on subsystems in the PAUSED or INACTIVE states.
subsystem | Subsystem the namespace belong to. |
nsid | Namespace ID to be made not visible. |
hostnqn | The NQN for the host. |
flags | Must be zero (reserved for future use). |
int spdk_nvmf_poll_group_add | ( | struct spdk_nvmf_poll_group * | group, |
struct spdk_nvmf_qpair * | qpair ) |
Add the given qpair to the poll group.
group | The group to add qpair to. |
qpair | The qpair to add. |
struct spdk_nvmf_poll_group * spdk_nvmf_poll_group_create | ( | struct spdk_nvmf_tgt * | tgt | ) |
Create a poll group.
tgt | The target to create a poll group. |
void spdk_nvmf_poll_group_destroy | ( | struct spdk_nvmf_poll_group * | group, |
spdk_nvmf_poll_group_destroy_done_fn | cb_fn, | ||
void * | cb_arg ) |
Destroy a poll group.
group | The poll group to destroy. |
cb_fn | A callback that will be called once the poll group is destroyed. |
cb_arg | A context argument passed to cb_fn. |
void spdk_nvmf_poll_group_dump_stat | ( | struct spdk_nvmf_poll_group * | group, |
struct spdk_json_write_ctx * | w ) |
Dump poll group statistics into JSON.
group | The group which statistics should be dumped. |
w | The JSON write context to which statistics should be dumped. |
int spdk_nvmf_qpair_disconnect | ( | struct spdk_nvmf_qpair * | qpair | ) |
Disconnect an NVMe-oF qpair.
qpair | The NVMe-oF qpair to disconnect. |
int spdk_nvmf_qpair_get_listen_trid | ( | struct spdk_nvmf_qpair * | qpair, |
struct spdk_nvme_transport_id * | trid ) |
Get the associated listener transport ID for this queue pair.
This function will first zero the trid structure, and then fill in the relevant trid fields to identify the listener. The relevant fields will depend on the transport, but the subnqn will never be a relevant field for purposes of this function.
qpair | The NVMe-oF qpair |
trid | Output parameter that will contain the transport id. |
int spdk_nvmf_qpair_get_local_trid | ( | struct spdk_nvmf_qpair * | qpair, |
struct spdk_nvme_transport_id * | trid ) |
Get the local transport ID for this queue pair.
This function will first zero the trid structure, and then fill in the relevant trid fields to identify the listener. The relevant fields will depend on the transport, but the subnqn will never be a relevant field for purposes of this function.
qpair | The NVMe-oF qpair |
trid | Output parameter that will contain the transport id. |
int spdk_nvmf_qpair_get_peer_trid | ( | struct spdk_nvmf_qpair * | qpair, |
struct spdk_nvme_transport_id * | trid ) |
Get the peer's transport ID for this queue pair.
This function will first zero the trid structure, and then fill in the relevant trid fields to identify the listener. The relevant fields will depend on the transport, but the subnqn will never be a relevant field for purposes of this function.
qpair | The NVMe-oF qpair |
trid | Output parameter that will contain the transport id. |
void spdk_nvmf_rdma_init_hooks | ( | struct spdk_nvme_rdma_hooks * | hooks | ) |
Set the global hooks for the RDMA transport, if necessary.
This call is optional and must be performed prior to probing for any devices. By default, the RDMA transport will use the ibverbs library to create protection domains and register memory. This is a mechanism to subvert that and use an existing registration.
This function may only be called one time per process.
hooks | for initializing global hooks |
void spdk_nvmf_set_custom_ns_reservation_ops | ( | const struct spdk_nvmf_ns_reservation_ops * | ops | ) |
Set custom handlers for namespace reservation operations.
This call allows to override the default namespace reservation operations with custom handlers. This function may only be called before any namespace has been added.
ops | The reservation ops handers |
int spdk_nvmf_subsystem_add_host | ( | struct spdk_nvmf_subsystem * | subsystem, |
const char * | hostnqn, | ||
const struct spdk_json_val * | params ) |
Allow the given host NQN to connect to the given subsystem.
Adding a host that's already allowed results in an error.
subsystem | Subsystem to add host to. |
hostnqn | The NQN for the host. |
params | Transport specific parameters. |
int spdk_nvmf_subsystem_add_host_ext | ( | struct spdk_nvmf_subsystem * | subsystem, |
const char * | hostnqn, | ||
struct spdk_nvmf_host_opts * | opts ) |
Allow the given host to connect to the given subsystem.
subsystem | Subsystem to add host to. |
hostnqn | Host's NQN. |
opts | Host's options. |
void spdk_nvmf_subsystem_add_listener | ( | struct spdk_nvmf_subsystem * | subsystem, |
struct spdk_nvme_transport_id * | trid, | ||
spdk_nvmf_tgt_subsystem_listen_done_fn | cb_fn, | ||
void * | cb_arg ) |
Accept new connections on the address provided.
This does not start the listener. Use spdk_nvmf_tgt_listen_ext() for that.
May only be performed on subsystems in the PAUSED or INACTIVE states. No namespaces are required to be paused.
subsystem | Subsystem to add listener to. |
trid | The address to accept connections from. |
cb_fn | A callback that will be called once the association is complete. |
cb_arg | Argument passed to cb_fn. |
void spdk_nvmf_subsystem_add_listener_ext | ( | struct spdk_nvmf_subsystem * | subsystem, |
struct spdk_nvme_transport_id * | trid, | ||
spdk_nvmf_tgt_subsystem_listen_done_fn | cb_fn, | ||
void * | cb_arg, | ||
struct spdk_nvmf_listener_opts * | opts ) |
Accept new connections on the address provided.
This does not start the listener. Use spdk_nvmf_tgt_listen_ext() for that.
May only be performed on subsystems in the PAUSED or INACTIVE states. No namespaces are required to be paused.
subsystem | Subsystem to add listener to. |
trid | The address to accept connections from. |
cb_fn | A callback that will be called once the association is complete. |
cb_arg | Argument passed to cb_fn. |
opts | NULL or options requested for listener creation. |
uint32_t spdk_nvmf_subsystem_add_ns_ext | ( | struct spdk_nvmf_subsystem * | subsystem, |
const char * | bdev_name, | ||
const struct spdk_nvmf_ns_opts * | opts, | ||
size_t | opts_size, | ||
const char * | ptpl_file ) |
Add a namespace to a subsystems in the PAUSED or INACTIVE states.
May only be performed on subsystems in the PAUSED or INACTIVE states.
subsystem | Subsystem to add namespace to. |
bdev_name | Block device name to add as a namespace. |
opts | Namespace options, or NULL to use defaults. |
opts_size | sizeof(*opts) |
ptpl_file | Persist through power loss file path. |
void spdk_nvmf_subsystem_allow_any_listener | ( | struct spdk_nvmf_subsystem * | subsystem, |
bool | allow_any_listener ) |
Set whether a subsystem should allow any listen address or only addresses in the allowed list.
subsystem | Subsystem to allow dynamic listener assignment. |
allow_any_listener | true to allow dynamic listener assignment for this subsystem, or false to enforce the list configured during subsystem setup. |
bool spdk_nvmf_subsystem_any_listener_allowed | ( | struct spdk_nvmf_subsystem * | subsystem | ) |
Check whether a subsystem allows any listen address or only addresses in the allowed list.
subsystem | Subsystem to query. |
struct spdk_nvmf_subsystem * spdk_nvmf_subsystem_create | ( | struct spdk_nvmf_tgt * | tgt, |
const char * | nqn, | ||
enum spdk_nvmf_subtype | type, | ||
uint32_t | num_ns ) |
Create an NVMe-oF subsystem.
Subsystems are in one of three states: Inactive, Active, Paused. This state affects which operations may be performed on the subsystem. Upon creation, the subsystem will be in the Inactive state and may be activated by calling spdk_nvmf_subsystem_start(). No I/O will be processed in the Inactive or Paused states, but changes to the state of the subsystem may be made.
tgt | The NVMe-oF target that will own this subsystem. |
nqn | The NVMe qualified name of this subsystem. |
type | Whether this subsystem is an I/O subsystem or a Discovery subsystem. |
num_ns | The maximum number of namespaces this subsystem may contain. |
int spdk_nvmf_subsystem_destroy | ( | struct spdk_nvmf_subsystem * | subsystem, |
nvmf_subsystem_destroy_cb | cpl_cb, | ||
void * | cpl_cb_arg ) |
Destroy an NVMe-oF subsystem.
A subsystem may only be destroyed when in the Inactive state. See spdk_nvmf_subsystem_stop(). A subsystem may be destroyed asynchronously, in that case cpl_cb will be called
subsystem | The NVMe-oF subsystem to destroy. |
cpl_cb | Optional callback to be called if the subsystem is destroyed asynchronously, only called if return value is -EINPROGRESS |
cpl_cb_arg | Optional user context to be passed to cpl_cb |
0 | if subsystem is destroyed, cpl_cb is not called is that case |
-EINVAl | if subsystem is a NULL pointer |
-EAGAIN | if subsystem is not in INACTIVE state |
-EALREADY | if subsystem destruction is already started |
-EINPROGRESS | if subsystem is destroyed asynchronously, cpl_cb will be called in that case |
int spdk_nvmf_subsystem_disconnect_host | ( | struct spdk_nvmf_subsystem * | subsystem, |
const char * | hostnqn, | ||
spdk_nvmf_tgt_subsystem_listen_done_fn | cb_fn, | ||
void * | cb_arg ) |
Disconnect all connections originating from the provided hostnqn.
To disconnect and block all new connections from a host, first call spdk_nvmf_subsystem_remove_host() to remove it from the list of allowed hosts, then call spdk_nvmf_subsystem_disconnect_host() to close any remaining connections.
subsystem | Subsystem to operate on |
hostnqn | The NQN for the host |
cb_fn | The function to call on completion. |
cb_arg | The argument to pass to the cb_fn. |
bool spdk_nvmf_subsystem_get_allow_any_host | ( | const struct spdk_nvmf_subsystem * | subsystem | ) |
Check whether a subsystem should allow any host or only hosts in the allowed list.
subsystem | Subsystem to query. |
bool spdk_nvmf_subsystem_get_ana_reporting | ( | struct spdk_nvmf_subsystem * | subsystem | ) |
Get whether a subsystem supports Asymmetric Namespace Access (ANA) reporting.
subsystem | Subsystem to check |
int spdk_nvmf_subsystem_get_ana_state | ( | struct spdk_nvmf_subsystem * | subsystem, |
const struct spdk_nvme_transport_id * | trid, | ||
uint32_t | anagrpid, | ||
enum spdk_nvme_ana_state * | ana_state ) |
Get Asymmetric Namespace Access (ANA) state for the specified ANA group id.
subsystem | Subsystem to operate on |
trid | Address for which the ANA is to be looked up |
anagrpid | The ANA group ID to check for |
ana_state | Output parameter that will contain the ANA state |
struct spdk_nvmf_subsystem * spdk_nvmf_subsystem_get_first | ( | struct spdk_nvmf_tgt * | tgt | ) |
Begin iterating over all known subsystems.
If no subsystems are present, return NULL.
tgt | The NVMe-oF target to iterate. |
struct spdk_nvmf_host * spdk_nvmf_subsystem_get_first_host | ( | struct spdk_nvmf_subsystem * | subsystem | ) |
Get the first allowed host in a subsystem.
subsystem | Subsystem to query. |
struct spdk_nvmf_subsystem_listener * spdk_nvmf_subsystem_get_first_listener | ( | struct spdk_nvmf_subsystem * | subsystem | ) |
Get the first allowed listen address in the subsystem.
subsystem | Subsystem to query. |
struct spdk_nvmf_ns * spdk_nvmf_subsystem_get_first_ns | ( | struct spdk_nvmf_subsystem * | subsystem | ) |
Get the first allocated namespace in a subsystem.
subsystem | Subsystem to query. |
uint16_t spdk_nvmf_subsystem_get_max_cntlid | ( | const struct spdk_nvmf_subsystem * | subsystem | ) |
Get the maximum controller ID allowed in a subsystem.
subsystem | Subsystem to query. |
uint32_t spdk_nvmf_subsystem_get_max_namespaces | ( | const struct spdk_nvmf_subsystem * | subsystem | ) |
Get the maximum number of namespaces allowed in a subsystem.
subsystem | Subsystem to query. |
uint32_t spdk_nvmf_subsystem_get_max_nsid | ( | struct spdk_nvmf_subsystem * | subsystem | ) |
Get maximum namespace id of the specified subsystem.
subsystem | Subsystem to query. |
uint16_t spdk_nvmf_subsystem_get_min_cntlid | ( | const struct spdk_nvmf_subsystem * | subsystem | ) |
Get the minimum controller ID allowed in a subsystem.
subsystem | Subsystem to query. |
const char * spdk_nvmf_subsystem_get_mn | ( | const struct spdk_nvmf_subsystem * | subsystem | ) |
Get the model number of the specified subsystem.
subsystem | Subsystem to query. |
struct spdk_nvmf_subsystem * spdk_nvmf_subsystem_get_next | ( | struct spdk_nvmf_subsystem * | subsystem | ) |
Continue iterating over all known subsystems.
If no additional subsystems, return NULL.
subsystem | Previous subsystem returned from spdk_nvmf_subsystem_get_first or spdk_nvmf_subsystem_get_next. |
struct spdk_nvmf_host * spdk_nvmf_subsystem_get_next_host | ( | struct spdk_nvmf_subsystem * | subsystem, |
struct spdk_nvmf_host * | prev_host ) |
Get the next allowed host in a subsystem.
subsystem | Subsystem to query. |
prev_host | Previous host returned from this function. |
struct spdk_nvmf_subsystem_listener * spdk_nvmf_subsystem_get_next_listener | ( | struct spdk_nvmf_subsystem * | subsystem, |
struct spdk_nvmf_subsystem_listener * | prev_listener ) |
Get the next allowed listen address in a subsystem.
subsystem | Subsystem to query. |
prev_listener | Previous listen address for this subsystem. |
struct spdk_nvmf_ns * spdk_nvmf_subsystem_get_next_ns | ( | struct spdk_nvmf_subsystem * | subsystem, |
struct spdk_nvmf_ns * | prev_ns ) |
Get the next allocated namespace in a subsystem.
subsystem | Subsystem to query. |
prev_ns | Previous ns returned from this function. |
const char * spdk_nvmf_subsystem_get_nqn | ( | const struct spdk_nvmf_subsystem * | subsystem | ) |
Get the NQN of the specified subsystem.
subsystem | Subsystem to query. |
struct spdk_nvmf_ns * spdk_nvmf_subsystem_get_ns | ( | struct spdk_nvmf_subsystem * | subsystem, |
uint32_t | nsid ) |
Get a namespace in a subsystem by NSID.
subsystem | Subsystem to search. |
nsid | Namespace ID to find. |
const char * spdk_nvmf_subsystem_get_sn | ( | const struct spdk_nvmf_subsystem * | subsystem | ) |
Get the serial number of the specified subsystem.
subsystem | Subsystem to query. |
enum spdk_nvmf_subtype spdk_nvmf_subsystem_get_type | ( | struct spdk_nvmf_subsystem * | subsystem | ) |
Get the type of the specified subsystem.
subsystem | Subsystem to query. |
bool spdk_nvmf_subsystem_host_allowed | ( | struct spdk_nvmf_subsystem * | subsystem, |
const char * | hostnqn ) |
Check if the given host is allowed to connect to the subsystem.
subsystem | The subsystem to query. |
hostnqn | The NQN of the host. |
bool spdk_nvmf_subsystem_is_discovery | ( | struct spdk_nvmf_subsystem * | subsystem | ) |
Checks whether a given subsystem is a discovery subsystem.
subsystem | Subsystem to check. |
bool spdk_nvmf_subsystem_listener_allowed | ( | struct spdk_nvmf_subsystem * | subsystem, |
const struct spdk_nvme_transport_id * | trid ) |
Check if connections originated from the given address are allowed to connect to the subsystem.
subsystem | The subsystem to query. |
trid | The listen address. |
const struct spdk_nvme_transport_id * spdk_nvmf_subsystem_listener_get_trid | ( | struct spdk_nvmf_subsystem_listener * | listener | ) |
Get a listen address' transport ID.
listener | This listener. |
void spdk_nvmf_subsystem_listener_opts_init | ( | struct spdk_nvmf_listener_opts * | opts, |
size_t | size ) |
Initialize options structure for listener creation.
opts | Options structure to initialize. |
size | Size of the structure. |
int spdk_nvmf_subsystem_pause | ( | struct spdk_nvmf_subsystem * | subsystem, |
uint32_t | nsid, | ||
spdk_nvmf_subsystem_state_change_done | cb_fn, | ||
void * | cb_arg ) |
Transition an NVMe-oF subsystem from Active to Paused state.
In a paused state, all admin queues are frozen across the whole subsystem. If a namespace ID is provided, all commands to that namespace are quiesced and incoming commands for that namespace are queued until the subsystem is resumed.
subsystem | The NVMe-oF subsystem. |
nsid | The namespace to pause. If 0, pause no namespaces. |
cb_fn | A function that will be called once the subsystem has changed state. |
cb_arg | Argument passed to cb_fn. |
int spdk_nvmf_subsystem_remove_host | ( | struct spdk_nvmf_subsystem * | subsystem, |
const char * | hostnqn ) |
Remove the given host NQN from the list of allowed hosts.
This call only removes the host from the allowed list of hosts. If a host with the given NQN is already connected it will not be disconnected, but it will not be able to create new connections.
subsystem | Subsystem to remove host from. |
hostnqn | The NQN for the host. |
int spdk_nvmf_subsystem_remove_listener | ( | struct spdk_nvmf_subsystem * | subsystem, |
const struct spdk_nvme_transport_id * | trid ) |
Remove the listener from subsystem.
New connections to the address won't be propagated to the subsystem. However to stop listening at target level one must use the spdk_nvmf_tgt_stop_listen().
May only be performed on subsystems in the PAUSED or INACTIVE states. No namespaces are required to be paused.
subsystem | Subsystem to remove listener from. |
trid | The address to no longer accept connections from. |
int spdk_nvmf_subsystem_remove_ns | ( | struct spdk_nvmf_subsystem * | subsystem, |
uint32_t | nsid ) |
Remove a namespace from a subsystem.
May only be performed on subsystems in the PAUSED or INACTIVE states. Additionally, the namespace must be paused.
subsystem | Subsystem the namespace belong to. |
nsid | Namespace ID to be removed. |
int spdk_nvmf_subsystem_resume | ( | struct spdk_nvmf_subsystem * | subsystem, |
spdk_nvmf_subsystem_state_change_done | cb_fn, | ||
void * | cb_arg ) |
Transition an NVMe-oF subsystem from Paused to Active state.
This resumes the entire subsystem, including any paused namespaces.
subsystem | The NVMe-oF subsystem. |
cb_fn | A function that will be called once the subsystem has changed state. |
cb_arg | Argument passed to cb_fn. |
int spdk_nvmf_subsystem_set_allow_any_host | ( | struct spdk_nvmf_subsystem * | subsystem, |
bool | allow_any_host ) |
Set whether a subsystem should allow any host or only hosts in the allowed list.
subsystem | Subsystem to modify. |
allow_any_host | true to allow any host to connect to this subsystem, or false to enforce the list configured with spdk_nvmf_subsystem_add_host(). |
int spdk_nvmf_subsystem_set_ana_reporting | ( | struct spdk_nvmf_subsystem * | subsystem, |
bool | ana_reporting ) |
Set whether a subsystem supports Asymmetric Namespace Access (ANA) reporting.
May only be performed on subsystems in the INACTIVE state.
subsystem | Subsystem to modify. |
ana_reporting | true to support or false not to support ANA reporting. |
void spdk_nvmf_subsystem_set_ana_state | ( | struct spdk_nvmf_subsystem * | subsystem, |
const struct spdk_nvme_transport_id * | trid, | ||
enum spdk_nvme_ana_state | ana_state, | ||
uint32_t | anagrpid, | ||
spdk_nvmf_tgt_subsystem_listen_done_fn | cb_fn, | ||
void * | cb_arg ) |
Set Asymmetric Namespace Access (ANA) state for the specified ANA group id.
May only be performed on subsystems in the INACTIVE or PAUSED state.
subsystem | Subsystem to operate on |
trid | Address for which the new state will apply |
ana_state | The ANA state which is to be set |
anagrpid | The ANA group ID to operate on |
cb_fn | The function to call on completion |
cb_arg | The argument to pass to the cb_fn |
int spdk_nvmf_subsystem_set_cntlid_range | ( | struct spdk_nvmf_subsystem * | subsystem, |
uint16_t | min_cntlid, | ||
uint16_t | max_cntlid ) |
Sets the controller ID range for a subsystem.
Valid range is [1, 0xFFEF]. May only be performed on subsystems in the INACTIVE state.
subsystem | Subsystem to modify. |
min_cntlid | Minimum controller ID. |
max_cntlid | Maximum controller ID. |
int spdk_nvmf_subsystem_set_mn | ( | struct spdk_nvmf_subsystem * | subsystem, |
const char * | mn ) |
Set the model number for the specified subsystem.
subsystem | Subsystem to set for. |
mn | model number to set. |
int spdk_nvmf_subsystem_set_sn | ( | struct spdk_nvmf_subsystem * | subsystem, |
const char * | sn ) |
Set the serial number for the specified subsystem.
subsystem | Subsystem to set for. |
sn | serial number to set. |
int spdk_nvmf_subsystem_start | ( | struct spdk_nvmf_subsystem * | subsystem, |
spdk_nvmf_subsystem_state_change_done | cb_fn, | ||
void * | cb_arg ) |
Transition an NVMe-oF subsystem from Inactive to Active state.
subsystem | The NVMe-oF subsystem. |
cb_fn | A function that will be called once the subsystem has changed state. |
cb_arg | Argument passed to cb_fn. |
int spdk_nvmf_subsystem_stop | ( | struct spdk_nvmf_subsystem * | subsystem, |
spdk_nvmf_subsystem_state_change_done | cb_fn, | ||
void * | cb_arg ) |
Transition an NVMe-oF subsystem from Active to Inactive state.
subsystem | The NVMe-oF subsystem. |
cb_fn | A function that will be called once the subsystem has changed state. |
cb_arg | Argument passed to cb_fn. |
int spdk_nvmf_tgt_add_referral | ( | struct spdk_nvmf_tgt * | tgt, |
const struct spdk_nvmf_referral_opts * | opts ) |
Add a discovery service referral to an NVMe-oF target.
tgt | The target to which the referral will be added |
opts | Options describing the referral referral. |
void spdk_nvmf_tgt_add_transport | ( | struct spdk_nvmf_tgt * | tgt, |
struct spdk_nvmf_transport * | transport, | ||
spdk_nvmf_tgt_add_transport_done_fn | cb_fn, | ||
void * | cb_arg ) |
Add a transport to a target.
tgt | The NVMe-oF target |
transport | The transport to add |
cb_fn | A callback that will be called once the transport is created |
cb_arg | A context argument passed to cb_fn. |
struct spdk_nvmf_tgt * spdk_nvmf_tgt_create | ( | struct spdk_nvmf_target_opts * | opts | ) |
Construct an NVMe-oF target.
opts | a pointer to an spdk_nvmf_target_opts structure. |
void spdk_nvmf_tgt_destroy | ( | struct spdk_nvmf_tgt * | tgt, |
spdk_nvmf_tgt_destroy_done_fn | cb_fn, | ||
void * | cb_arg ) |
Destroy an NVMe-oF target.
tgt | The target to destroy. This releases all resources. |
cb_fn | A callback that will be called once the target is destroyed |
cb_arg | A context argument passed to cb_fn. |
struct spdk_nvmf_subsystem * spdk_nvmf_tgt_find_subsystem | ( | struct spdk_nvmf_tgt * | tgt, |
const char * | subnqn ) |
Search the target for a subsystem with the given NQN.
tgt | The NVMe-oF target to search from. |
subnqn | NQN of the subsystem. |
const char * spdk_nvmf_tgt_get_name | ( | struct spdk_nvmf_tgt * | tgt | ) |
Get the name of an NVMe-oF target.
tgt | The target from which to get the name. |
struct spdk_nvmf_transport * spdk_nvmf_tgt_get_transport | ( | struct spdk_nvmf_tgt * | tgt, |
const char * | transport_name ) |
Get an existing transport from the target.
tgt | The NVMe-oF target |
transport_name | The name of the transport type to get. |
int spdk_nvmf_tgt_listen_ext | ( | struct spdk_nvmf_tgt * | tgt, |
const struct spdk_nvme_transport_id * | trid, | ||
struct spdk_nvmf_listen_opts * | opts ) |
Begin accepting new connections at the address provided.
The connections will be matched with a subsystem, which may or may not allow the connection based on a subsystem-specific list of allowed hosts. See spdk_nvmf_subsystem_add_host() and spdk_nvmf_subsystem_add_listener()
tgt | The target associated with this listen address. |
trid | The address to listen at. |
opts | Listener options. |
int spdk_nvmf_tgt_pause_polling | ( | struct spdk_nvmf_tgt * | tgt, |
spdk_nvmf_tgt_pause_polling_cb_fn | cb_fn, | ||
void * | cb_arg ) |
Pause polling on the given target.
tgt | The target to pause |
cb_fn | A callback that will be called once the target is paused |
cb_arg | A context argument passed to cb_fn. |
int spdk_nvmf_tgt_remove_referral | ( | struct spdk_nvmf_tgt * | tgt, |
const struct spdk_nvmf_referral_opts * | opts ) |
Remove a discovery service referral from an NVMeoF target.
tgt | The target from which the referral will be removed |
opts | Options describing the referral referral. |
int spdk_nvmf_tgt_resume_polling | ( | struct spdk_nvmf_tgt * | tgt, |
spdk_nvmf_tgt_resume_polling_cb_fn | cb_fn, | ||
void * | cb_arg ) |
Resume polling on the given target.
tgt | The target to resume |
cb_fn | A callback that will be called once the target is resumed |
cb_arg | A context argument passed to cb_fn. |
int spdk_nvmf_tgt_stop_listen | ( | struct spdk_nvmf_tgt * | tgt, |
struct spdk_nvme_transport_id * | trid ) |
Stop accepting new connections at the provided address.
This is a counterpart to spdk_nvmf_tgt_listen_ext().
tgt | The target associated with the listen address. |
trid | The address to stop listening at. |
void spdk_nvmf_tgt_write_config_json | ( | struct spdk_json_write_ctx * | w, |
struct spdk_nvmf_tgt * | tgt ) |
Write NVMe-oF target configuration into provided JSON context.
w | JSON write context |
tgt | The NVMe-oF target |
struct spdk_nvmf_transport * spdk_nvmf_transport_create | ( | const char * | transport_name, |
struct spdk_nvmf_transport_opts * | opts ) |
Create a protocol transport - deprecated, please use spdk_nvmf_transport_create_async.
transport_name | The transport type to create |
opts | The transport options (e.g. max_io_size). It should not be NULL, and opts_size pointed in this structure should not be zero value. |
int spdk_nvmf_transport_create_async | ( | const char * | transport_name, |
struct spdk_nvmf_transport_opts * | opts, | ||
spdk_nvmf_transport_create_done_cb | cb_fn, | ||
void * | cb_arg ) |
Create a protocol transport.
The callback will be executed asynchronously - i.e. spdk_nvmf_transport_create_async will always return prior to cb_fn
being called.
transport_name | The transport type to create |
opts | The transport options (e.g. max_io_size). It should not be NULL, and opts_size pointed in this structure should not be zero value. |
cb_fn | A callback that will be called once the transport is created |
cb_arg | A context argument passed to cb_fn. |
cb_fn
will not be executed then). int spdk_nvmf_transport_destroy | ( | struct spdk_nvmf_transport * | transport, |
spdk_nvmf_transport_destroy_done_cb | cb_fn, | ||
void * | cb_arg ) |
Destroy a protocol transport.
transport | The transport to destroy |
cb_fn | A callback that will be called once the transport is destroyed |
cb_arg | A context argument passed to cb_fn. |
struct spdk_nvmf_transport * spdk_nvmf_transport_get_first | ( | struct spdk_nvmf_tgt * | tgt | ) |
Get the first transport registered with the given target.
tgt | The NVMe-oF target |
struct spdk_nvmf_transport * spdk_nvmf_transport_get_next | ( | struct spdk_nvmf_transport * | transport | ) |
Get the next transport in a target's list.
transport | A handle to a transport object |
int spdk_nvmf_transport_listen | ( | struct spdk_nvmf_transport * | transport, |
const struct spdk_nvme_transport_id * | trid, | ||
struct spdk_nvmf_listen_opts * | opts ) |
Add listener to transport and begin accepting new connections.
transport | The transport to add listener to. |
trid | The address to listen at. |
opts | Listener options. |
bool spdk_nvmf_transport_opts_init | ( | const char * | transport_name, |
struct spdk_nvmf_transport_opts * | opts, | ||
size_t | opts_size ) |
Initialize transport options.
transport_name | The transport type to create |
opts | The transport options (e.g. max_io_size) |
opts_size | Must be set to sizeof(struct spdk_nvmf_transport_opts). |
int spdk_nvmf_transport_stop_listen | ( | struct spdk_nvmf_transport * | transport, |
const struct spdk_nvme_transport_id * | trid ) |
Remove listener from transport and stop accepting new connections.
transport | The transport to remove listener from |
trid | Address to stop listen at |
int spdk_nvmf_transport_stop_listen_async | ( | struct spdk_nvmf_transport * | transport, |
const struct spdk_nvme_transport_id * | trid, | ||
struct spdk_nvmf_subsystem * | subsystem, | ||
spdk_nvmf_tgt_subsystem_listen_done_fn | cb_fn, | ||
void * | cb_arg ) |
Stop accepting new connections at the provided address.
This is a counterpart to spdk_nvmf_tgt_listen_ext(). It differs from spdk_nvmf_transport_stop_listen() in that it also destroys qpairs that are connected to the specified listener. Because this function disconnects the qpairs, it has to be asynchronous.
The subsystem is matched using the subsystem parameter, not the subnqn field in the trid.
transport | The transport associated with the listen address. |
trid | The address to stop listening at. subnqn must be an empty string. |
subsystem | The subsystem to match for qpairs with the specified trid. If NULL, it will disconnect all qpairs with the specified trid. |
cb_fn | The function to call on completion. |
cb_arg | The argument to pass to the cb_fn. |