NVMe-oF Target transport plugin API. More...
Data Structures | |
union | nvmf_h2c_msg |
union | nvmf_c2h_msg |
struct | spdk_nvmf_dif_info |
struct | spdk_nvmf_stripped_data |
struct | spdk_nvmf_request |
struct | spdk_nvmf_qpair |
struct | spdk_nvmf_transport_poll_group |
struct | spdk_nvmf_poll_group |
struct | spdk_nvmf_listener |
struct | spdk_nvmf_ctrlr_data |
A subset of struct spdk_nvme_ctrlr_data that are emulated by a fabrics device. More... | |
struct | spdk_nvmf_transport |
struct | spdk_nvmf_transport_ops |
struct | spdk_nvmf_registers |
A subset of struct spdk_nvme_registers that are emulated by a fabrics device. More... | |
struct | spdk_nvmf_ctrlr_feat |
struct | spdk_nvmf_ctrlr_migr_data |
Macros | |
#define | SPDK_NVMF_MAX_SGL_ENTRIES 16 |
#define | NVMF_REQ_MAX_BUFFERS (SPDK_NVMF_MAX_SGL_ENTRIES * 2 + 1) |
#define | SPDK_NVMF_MIGR_MAX_PENDING_AERS 256 |
#define | SPDK_NVMF_MAX_ASYNC_EVENTS 4 |
#define | NVMF_DATA_BUFFER_ALIGNMENT VALUE_4KB |
#define | NVMF_DATA_BUFFER_MASK (NVMF_DATA_BUFFER_ALIGNMENT - 1LL) |
#define | SPDK_NVMF_DEFAULT_ACCEPT_POLL_RATE_US 10000 |
#define | MAX_MEMPOOL_NAME_LENGTH 40 |
#define | SPDK_NVMF_TRANSPORT_REGISTER(name, transport_ops) |
Typedefs | |
typedef void(* | spdk_nvmf_state_change_done) (void *cb_arg, int status) |
typedef void(* | spdk_nvmf_transport_qpair_fini_cb) (void *cb_arg) |
Functions | |
SPDK_STATIC_ASSERT (sizeof(union nvmf_h2c_msg)==64, "Incorrect size") | |
SPDK_STATIC_ASSERT (sizeof(union nvmf_c2h_msg)==16, "Incorrect size") | |
SPDK_STATIC_ASSERT (sizeof(struct spdk_nvmf_request)==808, "Incorrect size") | |
static int32_t | spdk_nvmf_qpair_get_numa_id (struct spdk_nvmf_qpair *qpair) |
void | spdk_nvmf_transport_register (const struct spdk_nvmf_transport_ops *ops) |
Register the operations for a given transport type. | |
int | spdk_nvmf_ctrlr_connect (struct spdk_nvmf_request *req) |
void | spdk_nvmf_tgt_new_qpair (struct spdk_nvmf_tgt *tgt, struct spdk_nvmf_qpair *qpair) |
Function to be called for each newly discovered qpair. | |
static bool | spdk_nvmf_qpair_is_active (struct spdk_nvmf_qpair *qpair) |
SPDK_STATIC_ASSERT (sizeof(struct spdk_nvmf_registers)==40, "Incorrect size") | |
const struct spdk_nvmf_registers * | spdk_nvmf_ctrlr_get_regs (struct spdk_nvmf_ctrlr *ctrlr) |
void | spdk_nvmf_request_free_buffers (struct spdk_nvmf_request *req, struct spdk_nvmf_transport_poll_group *group, struct spdk_nvmf_transport *transport) |
int | spdk_nvmf_request_get_buffers (struct spdk_nvmf_request *req, struct spdk_nvmf_transport_poll_group *group, struct spdk_nvmf_transport *transport, uint32_t length) |
bool | spdk_nvmf_request_get_dif_ctx (struct spdk_nvmf_request *req, struct spdk_dif_ctx *dif_ctx) |
void | spdk_nvmf_request_exec (struct spdk_nvmf_request *req) |
void | spdk_nvmf_request_exec_fabrics (struct spdk_nvmf_request *req) |
int | spdk_nvmf_request_free (struct spdk_nvmf_request *req) |
int | spdk_nvmf_request_complete (struct spdk_nvmf_request *req) |
void | spdk_nvmf_request_zcopy_start (struct spdk_nvmf_request *req) |
void | spdk_nvmf_request_zcopy_end (struct spdk_nvmf_request *req, bool commit) |
static bool | spdk_nvmf_request_using_zcopy (const struct spdk_nvmf_request *req) |
void | spdk_nvmf_poll_group_remove (struct spdk_nvmf_qpair *qpair) |
Remove the given qpair from the poll group. | |
struct spdk_nvmf_subsystem * | spdk_nvmf_ctrlr_get_subsystem (struct spdk_nvmf_ctrlr *ctrlr) |
Get the NVMe-oF subsystem associated with this controller. | |
uint16_t | spdk_nvmf_ctrlr_get_id (struct spdk_nvmf_ctrlr *ctrlr) |
Get the NVMe-oF controller ID. | |
SPDK_STATIC_ASSERT (sizeof(struct spdk_nvmf_ctrlr_feat)==40, "Incorrect size") | |
SPDK_STATIC_ASSERT (offsetof(struct spdk_nvmf_ctrlr_migr_data, regs) - offsetof(struct spdk_nvmf_ctrlr_migr_data, data_size)==16, "Incorrect header size") | |
SPDK_STATIC_ASSERT (offsetof(struct spdk_nvmf_ctrlr_migr_data, feat) - offsetof(struct spdk_nvmf_ctrlr_migr_data, regs)==256, "Incorrect regs size") | |
SPDK_STATIC_ASSERT (offsetof(struct spdk_nvmf_ctrlr_migr_data, cntlid) - offsetof(struct spdk_nvmf_ctrlr_migr_data, feat)==256, "Incorrect feat size") | |
SPDK_STATIC_ASSERT (sizeof(struct spdk_nvmf_ctrlr_migr_data)==4096, "Incorrect size") | |
int | spdk_nvmf_ctrlr_save_migr_data (struct spdk_nvmf_ctrlr *ctrlr, struct spdk_nvmf_ctrlr_migr_data *data) |
Save the NVMe-oF controller state and configuration. | |
int | spdk_nvmf_ctrlr_restore_migr_data (struct spdk_nvmf_ctrlr *ctrlr, const struct spdk_nvmf_ctrlr_migr_data *data) |
Restore the NVMe-oF controller state and configuration. | |
static enum spdk_nvme_data_transfer | spdk_nvmf_req_get_xfer (struct spdk_nvmf_request *req) |
int | spdk_nvmf_ctrlr_async_event_error_event (struct spdk_nvmf_ctrlr *ctrlr, enum spdk_nvme_async_event_info_error info) |
Complete Asynchronous Event as Error. | |
void | spdk_nvmf_ctrlr_abort_aer (struct spdk_nvmf_ctrlr *ctrlr) |
Abort outstanding Asynchronous Event Requests (AERs). | |
NVMe-oF Target transport plugin API.
#define SPDK_NVMF_TRANSPORT_REGISTER | ( | name, | |
transport_ops ) |
void spdk_nvmf_ctrlr_abort_aer | ( | struct spdk_nvmf_ctrlr * | ctrlr | ) |
Abort outstanding Asynchronous Event Requests (AERs).
Completes AERs with ABORTED_BY_REQUEST status code.
ctrlr | Controller whose AERs are going to be aborted. |
int spdk_nvmf_ctrlr_async_event_error_event | ( | struct spdk_nvmf_ctrlr * | ctrlr, |
enum spdk_nvme_async_event_info_error | info ) |
Complete Asynchronous Event as Error.
ctrlr | Controller whose AER is going to be completed. |
info | Asynchronous Event Error Information to be reported. |
uint16_t spdk_nvmf_ctrlr_get_id | ( | struct spdk_nvmf_ctrlr * | ctrlr | ) |
Get the NVMe-oF controller ID.
ctrlr | The NVMe-oF controller |
struct spdk_nvmf_subsystem * spdk_nvmf_ctrlr_get_subsystem | ( | struct spdk_nvmf_ctrlr * | ctrlr | ) |
Get the NVMe-oF subsystem associated with this controller.
ctrlr | The NVMe-oF controller |
int spdk_nvmf_ctrlr_restore_migr_data | ( | struct spdk_nvmf_ctrlr * | ctrlr, |
const struct spdk_nvmf_ctrlr_migr_data * | data ) |
Restore the NVMe-oF controller state and configuration.
The API is experimental.
It is allowed to restore the data only when the nvmf subsystem is in paused state.
To preserve thread safety this function must be executed on the same thread the NVMe-OF controller was created.
AERs shall be restored using spdk_nvmf_request_exec after this function is executed.
ctrlr | The NVMe-oF controller |
data | The NVMe-oF controller state and configuration to be restored |
int spdk_nvmf_ctrlr_save_migr_data | ( | struct spdk_nvmf_ctrlr * | ctrlr, |
struct spdk_nvmf_ctrlr_migr_data * | data ) |
Save the NVMe-oF controller state and configuration.
The API is experimental.
It is allowed to save the data only when the nvmf subsystem is in paused state i.e. there are no outstanding cmds in nvmf layer (other than aer), pending async event completions are getting blocked.
To preserve thread safety this function must be executed on the same thread the NVMe-OF controller was created.
ctrlr | The NVMe-oF controller |
data | The NVMe-oF controller state and configuration to be saved |
void spdk_nvmf_poll_group_remove | ( | struct spdk_nvmf_qpair * | qpair | ) |
Remove the given qpair from the poll group.
qpair | The qpair to remove. |
void spdk_nvmf_tgt_new_qpair | ( | struct spdk_nvmf_tgt * | tgt, |
struct spdk_nvmf_qpair * | qpair ) |
Function to be called for each newly discovered qpair.
tgt | The nvmf target |
qpair | The newly discovered qpair. |
void spdk_nvmf_transport_register | ( | const struct spdk_nvmf_transport_ops * | ops | ) |
Register the operations for a given transport type.
This function should be invoked by referencing the macro SPDK_NVMF_TRANSPORT_REGISTER macro in the transport's .c file.
ops | The operations associated with an NVMe-oF transport. |