nvmf_transport.h File Reference

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_request
 
struct  spdk_nvmf_qpair
 
struct  spdk_nvmf_transport_pg_cache_buf
 
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...
 

Macros

#define SPDK_NVMF_MAX_SGL_ENTRIES   16
 
#define NVMF_REQ_MAX_BUFFERS   (SPDK_NVMF_MAX_SGL_ENTRIES * 2)
 
#define NVMF_DATA_BUFFER_ALIGNMENT   VALUE_4KB
 
#define NVMF_DATA_BUFFER_MASK   (NVMF_DATA_BUFFER_ALIGNMENT - 1LL)
 
#define SPDK_NVMF_TRANSPORT_REGISTER(name, transport_ops)
 

Typedefs

typedef void(* spdk_nvmf_state_change_done) (void *cb_arg, int status)
 

Enumerations

enum  spdk_nvmf_qpair_state { SPDK_NVMF_QPAIR_UNINITIALIZED = 0, SPDK_NVMF_QPAIR_ACTIVE, SPDK_NVMF_QPAIR_DEACTIVATING, SPDK_NVMF_QPAIR_ERROR }
 

Functions

 SPDK_STATIC_ASSERT (sizeof(union nvmf_h2c_msg)==64, "Incorrect size")
 
 SPDK_STATIC_ASSERT (sizeof(union nvmf_c2h_msg)==16, "Incorrect size")
 
void spdk_nvmf_transport_register (const struct spdk_nvmf_transport_ops *ops)
 Register the operations for a given transport type. More...
 
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. More...
 
const struct spdk_nvmf_registersspdk_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)
 
int spdk_nvmf_request_get_buffers_multi (struct spdk_nvmf_request *req, struct spdk_nvmf_transport_poll_group *group, struct spdk_nvmf_transport *transport, uint32_t *lengths, uint32_t num_lengths)
 
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_poll_group_remove (struct spdk_nvmf_qpair *qpair)
 Remove the given qpair from the poll group. More...
 
struct spdk_nvmf_subsystem * spdk_nvmf_ctrlr_get_subsystem (struct spdk_nvmf_ctrlr *ctrlr)
 Get the NVMe-oF subsystem associated with this controller. More...
 
static enum spdk_nvme_data_transfer spdk_nvmf_req_get_xfer (struct spdk_nvmf_request *req)
 

Detailed Description

NVMe-oF Target transport plugin API.

Macro Definition Documentation

◆ SPDK_NVMF_TRANSPORT_REGISTER

#define SPDK_NVMF_TRANSPORT_REGISTER (   name,
  transport_ops 
)
Value:
static void __attribute__((constructor)) _spdk_nvmf_transport_register_##name(void) \
{ \
spdk_nvmf_transport_register(transport_ops); \
}\

Function Documentation

◆ spdk_nvmf_ctrlr_get_subsystem()

struct spdk_nvmf_subsystem* spdk_nvmf_ctrlr_get_subsystem ( struct spdk_nvmf_ctrlr *  ctrlr)

Get the NVMe-oF subsystem associated with this controller.

Parameters
ctrlrThe NVMe-oF controller
Returns
The NVMe-oF subsystem

◆ spdk_nvmf_poll_group_remove()

void spdk_nvmf_poll_group_remove ( struct spdk_nvmf_qpair qpair)

Remove the given qpair from the poll group.

Parameters
qpairThe qpair to remove.

◆ spdk_nvmf_tgt_new_qpair()

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.

Parameters
tgtThe nvmf target
qpairThe newly discovered qpair.

◆ spdk_nvmf_transport_register()

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.

Parameters
opsThe operations associated with an NVMe-oF transport.