NVIDIA DOCA SDK Data Center on a Chip Framework Documentation
doca_transport.c File Reference
#include "spdk/nvmf_transport.h"
#include "spdk/util.h"
#include "spdk/thread.h"
#include <spdk/nvme_spec.h>
#include <doca_error.h>
#include <doca_log.h>
#include <doca_dev.h>
#include <doca_dpa.h>
#include <doca_pe.h>
#include <doca_transport_common.h>
#include "nvme_pci_common.h"
#include "nvme_pci_type_config.h"
#include "nvmf_doca_io.h"
Include dependency graph for doca_transport.c:

Go to the source code of this file.

Data Structures

struct  nvmf_doca_nvme_registers
 
struct  nvmf_doca_emulation_manager
 
struct  nvmf_doca_admin_qp
 
struct  nvmf_doca_pci_dev_poll_group
 
struct  nvmf_doca_poll_group
 
struct  nvmf_doca_pci_dev_admin
 
struct  nvmf_doca_admin_poll_group
 
struct  nvmf_doca_transport
 
struct  nvmf_doca_poll_group_delete_io_sq_ctx
 
struct  nvmf_doca_poll_group_delete_io_cq_ctx
 
struct  nvmf_doca_create_admin_qp_ctx
 
struct  nvmf_doca_poll_group_create_io_sq_ctx
 
struct  nvmf_doca_poll_group_create_io_cq_ctx
 

Macros

#define HOTPLUG_TIMEOUT_IN_MICROS   (5 * 1000 * 1000) /* Set timeout to 5 seconds */
 
#define NVMF_DOCA_DEFAULT_MAX_QUEUE_DEPTH   512
 
#define NVMF_DOCA_DEFAULT_MAX_QPAIRS_PER_CTRLR   128
 
#define NVMF_DOCA_DEFAULT_IN_CAPSULE_DATA_SIZE   4096
 
#define NVMF_DOCA_DEFAULT_MAX_IO_SIZE   131072
 
#define NVMF_DOCA_DEFAULT_IO_UINT_SIZE   128
 
#define NVMF_DOCA_DEFAULT_AQ_DEPTH   256
 
#define NVMF_DOCA_DEFAULT_NUM_SHARED_BUFFER   1
 
#define NVMF_DOCA_DEFAULT_BUFFER_CACHE_SIZE   0
 
#define NVMF_DOCA_DIF_INSERT_OR_STRIP   false
 
#define NVMF_DOCA_DEFAULT_ABORT_TIMEOUT_SEC   1
 
#define NVMF_ADMIN_QUEUE_ID   0
 
#define ADMIN_QP_POLL_RATE_LIMIT   1000
 
#define TAILQ_FOREACH_SAFE(var, head, field, tvar)    for ((var) = ((head)->tqh_first); (var) && ((tvar) = ((var)->field.tqe_next), 1); (var) = (tvar))
 
#define NVME_PAGE_SIZE   4096
 
#define IDENTIFY_CMD_DATA_BUFFER_SIZE   4096
 
#define FEAT_CMD_LBA_RANGE_SIZE   4096
 
#define FEAT_CMD_AUTONOMOUS_POWER_STATE_TRANSITION_SIZE   256
 
#define FEAT_CMD_TIMESTAMP_SIZE   8
 
#define FEAT_CMD_HOST_BEHAVIOR_SUPPORT_SIZE   512
 
#define FEAT_CMD_HOST_IDENTIFIER_EXT_SIZE   16
 
#define FEAT_CMD_HOST_IDENTIFIER_SIZE   8
 
#define LBA_SIZE   512
 

Enumerations

enum  nvmf_doca_listener_state {
  NVMF_DOCA_LISTENER_UNINITIALIZED , NVMF_DOCA_LISTENER_INITIALIZING , NVMF_DOCA_LISTENER_INITIALIZATION_ERROR , NVMF_DOCA_LISTENER_INITIALIZED ,
  NVMF_DOCA_LISTENER_RESETTING
}
 

Functions

 DOCA_LOG_REGISTER (NVME_EMULATION_DOCA_TRANSPORT)
 
static void post_cqe_from_response (struct nvmf_doca_request *request, void *arg)
 
static void nvmf_doca_on_post_cqe_complete (struct nvmf_doca_cq *cq, union doca_data user_data)
 
static void nvmf_doca_on_fetch_sqe_complete (struct nvmf_doca_sq *sq, struct nvmf_doca_sqe *sqe, uint16_t sqe_idx)
 
static void nvmf_doca_on_copy_data_complete (struct nvmf_doca_sq *sq, struct doca_buf *dst, struct doca_buf *src, union doca_data user_data)
 
static void nvmf_doca_on_post_nvm_cqe_complete (struct nvmf_doca_cq *cq, union doca_data user_data)
 
static void nvmf_doca_on_fetch_nvm_sqe_complete (struct nvmf_doca_sq *sq, struct nvmf_doca_sqe *sqe, uint16_t sqe_idx)
 
static void nvmf_doca_on_copy_nvm_data_complete (struct nvmf_doca_sq *sq, struct doca_buf *dst, struct doca_buf *src, union doca_data user_data)
 
static void nvmf_doca_pci_dev_admin_reset_continue (struct nvmf_doca_pci_dev_admin *pci_dev_admin)
 
static void handle_controller_register_events (struct doca_devemu_pci_dev *pci_dev, const struct bar_region_config *config)
 
static void nvmf_doca_destroy_pci_dev_poll_group (struct nvmf_doca_pci_dev_poll_group *pci_dev_pg)
 
static void nvmf_doca_destroy_admin_qp_continue (struct nvmf_doca_pci_dev_admin *pci_dev_admin)
 
static void nvmf_doca_on_initialization_error (void *cb_arg)
 
static void nvmf_doca_on_admin_sq_stop (struct nvmf_doca_sq *sq)
 
static doca_error_t nvmf_doca_create_host_mmap (struct doca_devemu_pci_dev *pci_dev, struct doca_dev *emulation_manager, struct doca_mmap **mmap_out)
 
static void buffers_ready_copy_data_dpu_to_host (struct nvmf_doca_request *request)
 
static void buffers_ready_copy_data_host_to_dpu (struct nvmf_doca_request *request)
 
static void nvmf_doca_opts_init (struct spdk_nvmf_transport_opts *opts)
 
static struct nvmf_doca_poll_groupchoose_poll_group (struct nvmf_doca_transport *transport)
 
static struct nvmf_doca_pci_dev_poll_groupget_pci_dev_poll_group (struct nvmf_doca_poll_group *doca_poll_group, struct doca_devemu_pci_dev *pci_dev)
 
static doca_error_t nvmf_doca_destroy_emulation_manager (struct nvmf_doca_emulation_manager *doca_emulation_manager)
 
static doca_error_t nvmf_doca_pci_type_create_and_start (struct nvmf_doca_emulation_manager *doca_emulation_manager)
 
static doca_error_t nvmf_doca_create_emulation_manager (struct doca_devinfo *dev_info, struct nvmf_doca_emulation_manager **ret_emulation_manager)
 
static int nvmf_doca_admin_poll_group_poll (void *arg)
 
static void nvmf_doca_admin_poll_group_destroy (struct nvmf_doca_admin_poll_group *admin_pg)
 
static doca_error_t nvmf_doca_admin_poll_group_create (struct nvmf_doca_admin_poll_group *admin_pg)
 
static struct spdk_nvmf_transport * nvmf_doca_create (struct spdk_nvmf_transport_opts *opts)
 
static void nvmf_doca_dump_opts (struct spdk_nvmf_transport *transport, struct spdk_json_write_ctx *w)
 
static int nvmf_doca_destroy (struct spdk_nvmf_transport *transport, spdk_nvmf_transport_destroy_done_cb cb_fn, void *cb_arg)
 
static struct nvmf_doca_pci_dev_adminnvmf_doca_transport_find_pci_dev_admin (struct nvmf_doca_transport *doca_transport, const char *vuid)
 
static doca_error_t check_for_duplicate (struct nvmf_doca_transport *doca_transport, const char *vuid)
 
static doca_error_t find_emulation_manager_and_function_by_vuid (struct nvmf_doca_transport *doca_transport, const char *vuid, struct nvmf_doca_emulation_manager **ret_emulation_manager, struct doca_dev_rep **ret_device_rep)
 
static void nvmf_doca_on_admin_cq_stop (struct nvmf_doca_io *io)
 
static void devemu_state_changed_cb (const union doca_data user_data, struct doca_ctx *ctx, enum doca_ctx_states prev_state, enum doca_ctx_states next_state)
 
static void nvmf_doca_pci_dev_poll_group_stop_io_sq (void *ctx)
 
static void nvmf_doca_pci_dev_poll_group_stop_io_sq_done (void *ctx)
 
static void nvmf_doca_admin_qp_stop_all_io_sqs (struct nvmf_doca_admin_qp *admin_qp)
 
static void nvmf_doca_pci_dev_poll_group_stop_io_cq (void *ctx)
 
static void nvmf_doca_pci_dev_poll_group_stop_io_cq_done (void *ctx)
 
static void nvmf_doca_admin_qp_stop_all_io_cqs (struct nvmf_doca_admin_qp *admin_qp)
 
static doca_error_t nvmf_doca_create_pci_dev_poll_group (struct nvmf_doca_pci_dev_admin *pci_dev_admin, struct nvmf_doca_admin_qp *admin_qp, struct nvmf_doca_poll_group *doca_poll_group, struct nvmf_doca_pci_dev_poll_group **ret_pci_dev_pg)
 
static void nvmf_doca_destroy_admin_qp_done (void *cb_arg)
 
static void nvmf_doca_destroy_admin_qp (void *cb_arg)
 
static void nvmf_doca_create_admin_qp_done (void *cb_arg)
 
static void nvmf_doca_create_admin_qp (void *cb_arg)
 
static void nvmf_doca_pci_dev_admin_reset (struct nvmf_doca_pci_dev_admin *pci_dev_admin)
 
static void flr_event_handler_cb (struct doca_devemu_pci_dev *pci_dev, union doca_data user_data)
 
static void hotplug_state_change_handler_cb (struct doca_devemu_pci_dev *pci_dev, union doca_data user_data)
 
static void stateful_region_write_event_handler_cb (struct doca_devemu_pci_dev_event_bar_stateful_region_driver_write *event, union doca_data user_data)
 
static doca_error_t register_to_stateful_region_write_events (struct doca_devemu_pci_dev *pci_dev, struct nvmf_doca_pci_dev_admin *pci_dev_admin)
 
static doca_error_t register_handlers_set_datapath_and_start (struct nvmf_doca_emulation_manager *doca_emulation_manager, struct nvmf_doca_pci_dev_admin *pci_dev_admin)
 
static void nvmf_doca_pci_dev_admin_destroy (struct nvmf_doca_pci_dev_admin *pci_dev_admin)
 
static int nvmf_doca_pci_dev_admin_create (struct nvmf_doca_transport *doca_transport, const struct spdk_nvme_transport_id *trid, struct nvmf_doca_pci_dev_admin **pci_dev_admin_out)
 
static doca_error_t devemu_hotplug_transition_wait (struct nvmf_doca_pci_dev_admin *pci_dev_admin, enum doca_devemu_pci_hotplug_state new_state, size_t timeout_in_micros)
 
static int nvmf_doca_listen (struct spdk_nvmf_transport *transport, const struct spdk_nvme_transport_id *trid, struct spdk_nvmf_listen_opts *listen_opts)
 
static void nvmf_doca_stop_listen (struct spdk_nvmf_transport *transport, const struct spdk_nvme_transport_id *trid)
 
static int nvmf_doca_listen_associate (struct spdk_nvmf_transport *transport, const struct spdk_nvmf_subsystem *subsystem, const struct spdk_nvme_transport_id *trid)
 
static struct spdk_nvmf_transport_poll_group * nvmf_doca_poll_group_create (struct spdk_nvmf_transport *transport, struct spdk_nvmf_poll_group *group)
 
static void nvmf_doca_poll_group_destroy (struct spdk_nvmf_transport_poll_group *group)
 
static struct spdk_nvmf_transport_poll_group * nvmf_doca_get_optimal_poll_group (struct spdk_nvmf_qpair *qpair)
 
static void enable_nvmf_controller_cb (struct nvmf_doca_request *request, void *cb_arg)
 
static void nvmf_doca_set_property (struct nvmf_doca_sq *doca_sq)
 
static void nvmf_doca_poll_group_create_io_sq_done (void *args)
 
static void nvmf_doca_connect_spdk_qp_done (struct nvmf_doca_request *request, void *cb_arg)
 
static int nvmf_doca_connect_spdk_qp (struct nvmf_doca_sq *sq)
 
static int nvmf_doca_poll_group_add (struct spdk_nvmf_transport_poll_group *group, struct spdk_nvmf_qpair *qpair)
 
static int nvmf_doca_poll_group_remove (struct spdk_nvmf_transport_poll_group *group, struct spdk_nvmf_qpair *qpair)
 
static int nvmf_doca_poll_group_poll (struct spdk_nvmf_transport_poll_group *group)
 
static int nvmf_doca_req_free (struct spdk_nvmf_request *req)
 
static int nvmf_doca_req_complete (struct spdk_nvmf_request *req)
 
static void nvmf_doca_close_qpair (struct spdk_nvmf_qpair *qpair, spdk_nvmf_transport_qpair_fini_cb cb_fn, void *cb_arg)
 
static int nvmf_doca_qpair_get_listen_trid (struct spdk_nvmf_qpair *qpair, struct spdk_nvme_transport_id *trid)
 
static void copy_prp_list_data (struct nvmf_doca_request *request, void *arg)
 
static void nvme_cmd_map_prps (struct nvmf_doca_request *request)
 
static void init_dpu_host_buffers (struct nvmf_doca_request *request)
 
static void post_error_cqe_from_response (struct nvmf_doca_request *request)
 
static void copy_dpu_data_to_host (struct nvmf_doca_request *request, void *arg)
 
static void copy_nvme_dpu_data_to_host (struct nvmf_doca_request *request, void *arg)
 
static void begin_nvme_admin_cmd_data_dpu_to_host (struct nvmf_doca_request *request)
 
static void begin_nvme_cmd_data_dpu_to_host (struct nvmf_doca_request *request)
 
static void execute_spdk_request (struct nvmf_doca_request *request, void *arg)
 
static void begin_nvme_admin_cmd_data_host_to_dpu (struct nvmf_doca_request *request)
 
static void begin_nvme_cmd_data_host_to_dpu (struct nvmf_doca_request *request)
 
static void begin_nvme_cmd_data_none (struct nvmf_doca_request *request)
 
static void nvmf_doca_poll_group_create_io_cq_done (void *args)
 
static struct nvmf_doca_sqadmin_qp_find_io_sq_by_id (struct nvmf_doca_admin_qp *admin_qp, uint32_t io_sq_id)
 
static void nvmf_doca_on_io_sq_stop (struct nvmf_doca_sq *sq)
 
static struct nvmf_doca_ioadmin_qp_find_io_cq_by_id (struct nvmf_doca_admin_qp *admin_qp, uint32_t io_cq_id)
 
static void nvmf_doca_on_io_cq_stop (struct nvmf_doca_io *io)
 
static void nvmf_doca_poll_group_create_io_cq (void *args)
 
static void handle_create_io_cq (struct nvmf_doca_sq *sq, struct nvmf_doca_request *request)
 
static void handle_delete_io_cq (struct nvmf_doca_sq *sq, struct nvmf_doca_request *request)
 
static void nvmf_doca_poll_group_create_io_sq (void *args)
 
static void handle_create_io_sq (struct nvmf_doca_sq *sq, struct nvmf_doca_request *request)
 
static void handle_delete_io_sq (struct nvmf_doca_sq *sq, struct nvmf_doca_request *request)
 
 SPDK_NVMF_TRANSPORT_REGISTER (doca, &spdk_nvmf_transport_doca)
 

Variables

struct doca_dpa_app * nvmf_doca_transport_app
 
const struct spdk_nvmf_transport_ops spdk_nvmf_transport_doca
 

Macro Definition Documentation

◆ ADMIN_QP_POLL_RATE_LIMIT

#define ADMIN_QP_POLL_RATE_LIMIT   1000

Definition at line 58 of file doca_transport.c.

◆ FEAT_CMD_AUTONOMOUS_POWER_STATE_TRANSITION_SIZE

#define FEAT_CMD_AUTONOMOUS_POWER_STATE_TRANSITION_SIZE   256

Definition at line 2408 of file doca_transport.c.

◆ FEAT_CMD_HOST_BEHAVIOR_SUPPORT_SIZE

#define FEAT_CMD_HOST_BEHAVIOR_SUPPORT_SIZE   512

Definition at line 2410 of file doca_transport.c.

◆ FEAT_CMD_HOST_IDENTIFIER_EXT_SIZE

#define FEAT_CMD_HOST_IDENTIFIER_EXT_SIZE   16

Definition at line 2411 of file doca_transport.c.

◆ FEAT_CMD_HOST_IDENTIFIER_SIZE

#define FEAT_CMD_HOST_IDENTIFIER_SIZE   8

Definition at line 2412 of file doca_transport.c.

◆ FEAT_CMD_LBA_RANGE_SIZE

#define FEAT_CMD_LBA_RANGE_SIZE   4096

Definition at line 2407 of file doca_transport.c.

◆ FEAT_CMD_TIMESTAMP_SIZE

#define FEAT_CMD_TIMESTAMP_SIZE   8

Definition at line 2409 of file doca_transport.c.

◆ HOTPLUG_TIMEOUT_IN_MICROS

#define HOTPLUG_TIMEOUT_IN_MICROS   (5 * 1000 * 1000) /* Set timeout to 5 seconds */

Definition at line 44 of file doca_transport.c.

◆ IDENTIFY_CMD_DATA_BUFFER_SIZE

#define IDENTIFY_CMD_DATA_BUFFER_SIZE   4096

Definition at line 2406 of file doca_transport.c.

◆ LBA_SIZE

#define LBA_SIZE   512

Definition at line 3301 of file doca_transport.c.

◆ NVME_PAGE_SIZE

#define NVME_PAGE_SIZE   4096

Definition at line 177 of file doca_transport.c.

◆ NVMF_ADMIN_QUEUE_ID

#define NVMF_ADMIN_QUEUE_ID   0

Definition at line 57 of file doca_transport.c.

◆ NVMF_DOCA_DEFAULT_ABORT_TIMEOUT_SEC

#define NVMF_DOCA_DEFAULT_ABORT_TIMEOUT_SEC   1

Definition at line 55 of file doca_transport.c.

◆ NVMF_DOCA_DEFAULT_AQ_DEPTH

#define NVMF_DOCA_DEFAULT_AQ_DEPTH   256

Definition at line 51 of file doca_transport.c.

◆ NVMF_DOCA_DEFAULT_BUFFER_CACHE_SIZE

#define NVMF_DOCA_DEFAULT_BUFFER_CACHE_SIZE   0

Definition at line 53 of file doca_transport.c.

◆ NVMF_DOCA_DEFAULT_IN_CAPSULE_DATA_SIZE

#define NVMF_DOCA_DEFAULT_IN_CAPSULE_DATA_SIZE   4096

Definition at line 48 of file doca_transport.c.

◆ NVMF_DOCA_DEFAULT_IO_UINT_SIZE

#define NVMF_DOCA_DEFAULT_IO_UINT_SIZE   128

Definition at line 50 of file doca_transport.c.

◆ NVMF_DOCA_DEFAULT_MAX_IO_SIZE

#define NVMF_DOCA_DEFAULT_MAX_IO_SIZE   131072

Definition at line 49 of file doca_transport.c.

◆ NVMF_DOCA_DEFAULT_MAX_QPAIRS_PER_CTRLR

#define NVMF_DOCA_DEFAULT_MAX_QPAIRS_PER_CTRLR   128

Definition at line 47 of file doca_transport.c.

◆ NVMF_DOCA_DEFAULT_MAX_QUEUE_DEPTH

#define NVMF_DOCA_DEFAULT_MAX_QUEUE_DEPTH   512

Definition at line 46 of file doca_transport.c.

◆ NVMF_DOCA_DEFAULT_NUM_SHARED_BUFFER

#define NVMF_DOCA_DEFAULT_NUM_SHARED_BUFFER   1

Definition at line 52 of file doca_transport.c.

◆ NVMF_DOCA_DIF_INSERT_OR_STRIP

#define NVMF_DOCA_DIF_INSERT_OR_STRIP   false

Definition at line 54 of file doca_transport.c.

◆ TAILQ_FOREACH_SAFE

#define TAILQ_FOREACH_SAFE (   var,
  head,
  field,
  tvar 
)     for ((var) = ((head)->tqh_first); (var) && ((tvar) = ((var)->field.tqe_next), 1); (var) = (tvar))

Definition at line 64 of file doca_transport.c.

Enumeration Type Documentation

◆ nvmf_doca_listener_state

Enumerator
NVMF_DOCA_LISTENER_UNINITIALIZED 
NVMF_DOCA_LISTENER_INITIALIZING 
NVMF_DOCA_LISTENER_INITIALIZATION_ERROR 
NVMF_DOCA_LISTENER_INITIALIZED 
NVMF_DOCA_LISTENER_RESETTING 

Definition at line 97 of file doca_transport.c.

Function Documentation

◆ admin_qp_find_io_cq_by_id()

static struct nvmf_doca_io* admin_qp_find_io_cq_by_id ( struct nvmf_doca_admin_qp admin_qp,
uint32_t  io_cq_id 
)
static

Definition at line 2858 of file doca_transport.c.

◆ admin_qp_find_io_sq_by_id()

static struct nvmf_doca_sq* admin_qp_find_io_sq_by_id ( struct nvmf_doca_admin_qp admin_qp,
uint32_t  io_sq_id 
)
static

Definition at line 2825 of file doca_transport.c.

◆ begin_nvme_admin_cmd_data_dpu_to_host()

static void begin_nvme_admin_cmd_data_dpu_to_host ( struct nvmf_doca_request request)
static

Definition at line 2660 of file doca_transport.c.

◆ begin_nvme_admin_cmd_data_host_to_dpu()

static void begin_nvme_admin_cmd_data_host_to_dpu ( struct nvmf_doca_request request)
static

Definition at line 2718 of file doca_transport.c.

◆ begin_nvme_cmd_data_dpu_to_host()

static void begin_nvme_cmd_data_dpu_to_host ( struct nvmf_doca_request request)
static

Definition at line 2677 of file doca_transport.c.

◆ begin_nvme_cmd_data_host_to_dpu()

static void begin_nvme_cmd_data_host_to_dpu ( struct nvmf_doca_request request)
static

Definition at line 2741 of file doca_transport.c.

◆ begin_nvme_cmd_data_none()

static void begin_nvme_cmd_data_none ( struct nvmf_doca_request request)
static

Definition at line 2779 of file doca_transport.c.

◆ buffers_ready_copy_data_dpu_to_host()

static void buffers_ready_copy_data_dpu_to_host ( struct nvmf_doca_request request)
static

Definition at line 2690 of file doca_transport.c.

◆ buffers_ready_copy_data_host_to_dpu()

static void buffers_ready_copy_data_host_to_dpu ( struct nvmf_doca_request request)
static

Definition at line 2754 of file doca_transport.c.

◆ check_for_duplicate()

static doca_error_t check_for_duplicate ( struct nvmf_doca_transport doca_transport,
const char *  vuid 
)
static

Definition at line 749 of file doca_transport.c.

◆ choose_poll_group()

static struct nvmf_doca_poll_group* choose_poll_group ( struct nvmf_doca_transport transport)
static

Definition at line 227 of file doca_transport.c.

◆ copy_dpu_data_to_host()

static void copy_dpu_data_to_host ( struct nvmf_doca_request request,
void *  arg 
)
static

Definition at line 2606 of file doca_transport.c.

◆ copy_nvme_dpu_data_to_host()

static void copy_nvme_dpu_data_to_host ( struct nvmf_doca_request request,
void *  arg 
)
static

Definition at line 2635 of file doca_transport.c.

◆ copy_prp_list_data()

static void copy_prp_list_data ( struct nvmf_doca_request request,
void *  arg 
)
static

Definition at line 2420 of file doca_transport.c.

◆ devemu_hotplug_transition_wait()

static doca_error_t devemu_hotplug_transition_wait ( struct nvmf_doca_pci_dev_admin pci_dev_admin,
enum doca_devemu_pci_hotplug_state  new_state,
size_t  timeout_in_micros 
)
static

Definition at line 1801 of file doca_transport.c.

◆ devemu_state_changed_cb()

static void devemu_state_changed_cb ( const union doca_data  user_data,
struct doca_ctx *  ctx,
enum doca_ctx_states  prev_state,
enum doca_ctx_states  next_state 
)
static

Definition at line 844 of file doca_transport.c.

◆ DOCA_LOG_REGISTER()

DOCA_LOG_REGISTER ( NVME_EMULATION_DOCA_TRANSPORT  )

◆ enable_nvmf_controller_cb()

static void enable_nvmf_controller_cb ( struct nvmf_doca_request request,
void *  cb_arg 
)
static

Definition at line 2078 of file doca_transport.c.

◆ execute_spdk_request()

static void execute_spdk_request ( struct nvmf_doca_request request,
void *  arg 
)
static

Definition at line 2705 of file doca_transport.c.

◆ find_emulation_manager_and_function_by_vuid()

static doca_error_t find_emulation_manager_and_function_by_vuid ( struct nvmf_doca_transport doca_transport,
const char *  vuid,
struct nvmf_doca_emulation_manager **  ret_emulation_manager,
struct doca_dev_rep **  ret_device_rep 
)
static

Definition at line 766 of file doca_transport.c.

◆ flr_event_handler_cb()

static void flr_event_handler_cb ( struct doca_devemu_pci_dev *  pci_dev,
union doca_data  user_data 
)
static

Definition at line 1355 of file doca_transport.c.

◆ get_pci_dev_poll_group()

static struct nvmf_doca_pci_dev_poll_group* get_pci_dev_poll_group ( struct nvmf_doca_poll_group doca_poll_group,
struct doca_devemu_pci_dev *  pci_dev 
)
static

Definition at line 254 of file doca_transport.c.

◆ handle_controller_register_events()

static void handle_controller_register_events ( struct doca_devemu_pci_dev *  pci_dev,
const struct bar_region_config config 
)
static

Definition at line 1429 of file doca_transport.c.

◆ handle_create_io_cq()

static void handle_create_io_cq ( struct nvmf_doca_sq sq,
struct nvmf_doca_request request 
)
static

Definition at line 2967 of file doca_transport.c.

◆ handle_create_io_sq()

static void handle_create_io_sq ( struct nvmf_doca_sq sq,
struct nvmf_doca_request request 
)
static

Definition at line 3088 of file doca_transport.c.

◆ handle_delete_io_cq()

static void handle_delete_io_cq ( struct nvmf_doca_sq sq,
struct nvmf_doca_request request 
)
static

Definition at line 3002 of file doca_transport.c.

◆ handle_delete_io_sq()

static void handle_delete_io_sq ( struct nvmf_doca_sq sq,
struct nvmf_doca_request request 
)
static

Definition at line 3131 of file doca_transport.c.

◆ hotplug_state_change_handler_cb()

static void hotplug_state_change_handler_cb ( struct doca_devemu_pci_dev *  pci_dev,
union doca_data  user_data 
)
static

Definition at line 1374 of file doca_transport.c.

◆ init_dpu_host_buffers()

static void init_dpu_host_buffers ( struct nvmf_doca_request request)
static

Definition at line 2546 of file doca_transport.c.

◆ nvme_cmd_map_prps()

static void nvme_cmd_map_prps ( struct nvmf_doca_request request)
static

Definition at line 2467 of file doca_transport.c.

◆ nvmf_doca_admin_poll_group_create()

static doca_error_t nvmf_doca_admin_poll_group_create ( struct nvmf_doca_admin_poll_group admin_pg)
static

Definition at line 566 of file doca_transport.c.

◆ nvmf_doca_admin_poll_group_destroy()

static void nvmf_doca_admin_poll_group_destroy ( struct nvmf_doca_admin_poll_group admin_pg)
static

Definition at line 553 of file doca_transport.c.

◆ nvmf_doca_admin_poll_group_poll()

static int nvmf_doca_admin_poll_group_poll ( void *  arg)
static

Definition at line 546 of file doca_transport.c.

◆ nvmf_doca_admin_qp_stop_all_io_cqs()

static void nvmf_doca_admin_qp_stop_all_io_cqs ( struct nvmf_doca_admin_qp admin_qp)
static

Definition at line 1006 of file doca_transport.c.

◆ nvmf_doca_admin_qp_stop_all_io_sqs()

static void nvmf_doca_admin_qp_stop_all_io_sqs ( struct nvmf_doca_admin_qp admin_qp)
static

Definition at line 936 of file doca_transport.c.

◆ nvmf_doca_close_qpair()

static void nvmf_doca_close_qpair ( struct spdk_nvmf_qpair *  qpair,
spdk_nvmf_transport_qpair_fini_cb  cb_fn,
void *  cb_arg 
)
static

Definition at line 2371 of file doca_transport.c.

◆ nvmf_doca_connect_spdk_qp()

static int nvmf_doca_connect_spdk_qp ( struct nvmf_doca_sq sq)
static

Definition at line 2200 of file doca_transport.c.

◆ nvmf_doca_connect_spdk_qp_done()

static void nvmf_doca_connect_spdk_qp_done ( struct nvmf_doca_request request,
void *  cb_arg 
)
static

Definition at line 2167 of file doca_transport.c.

◆ nvmf_doca_create()

static struct spdk_nvmf_transport* nvmf_doca_create ( struct spdk_nvmf_transport_opts *  opts)
static

Definition at line 601 of file doca_transport.c.

◆ nvmf_doca_create_admin_qp()

static void nvmf_doca_create_admin_qp ( void *  cb_arg)
static

Definition at line 1194 of file doca_transport.c.

◆ nvmf_doca_create_admin_qp_done()

static void nvmf_doca_create_admin_qp_done ( void *  cb_arg)
static

Definition at line 1167 of file doca_transport.c.

◆ nvmf_doca_create_emulation_manager()

static doca_error_t nvmf_doca_create_emulation_manager ( struct doca_devinfo *  dev_info,
struct nvmf_doca_emulation_manager **  ret_emulation_manager 
)
static

Definition at line 492 of file doca_transport.c.

◆ nvmf_doca_create_host_mmap()

static doca_error_t nvmf_doca_create_host_mmap ( struct doca_devemu_pci_dev *  pci_dev,
struct doca_dev *  emulation_manager,
struct doca_mmap **  mmap_out 
)
static

Definition at line 1654 of file doca_transport.c.

◆ nvmf_doca_create_pci_dev_poll_group()

static doca_error_t nvmf_doca_create_pci_dev_poll_group ( struct nvmf_doca_pci_dev_admin pci_dev_admin,
struct nvmf_doca_admin_qp admin_qp,
struct nvmf_doca_poll_group doca_poll_group,
struct nvmf_doca_pci_dev_poll_group **  ret_pci_dev_pg 
)
static

Definition at line 1050 of file doca_transport.c.

◆ nvmf_doca_destroy()

static int nvmf_doca_destroy ( struct spdk_nvmf_transport *  transport,
spdk_nvmf_transport_destroy_done_cb  cb_fn,
void *  cb_arg 
)
static

Definition at line 700 of file doca_transport.c.

◆ nvmf_doca_destroy_admin_qp()

static void nvmf_doca_destroy_admin_qp ( void *  cb_arg)
static

Definition at line 1137 of file doca_transport.c.

◆ nvmf_doca_destroy_admin_qp_continue()

static void nvmf_doca_destroy_admin_qp_continue ( struct nvmf_doca_pci_dev_admin pci_dev_admin)
static

Definition at line 1101 of file doca_transport.c.

◆ nvmf_doca_destroy_admin_qp_done()

static void nvmf_doca_destroy_admin_qp_done ( void *  cb_arg)
static

Definition at line 1088 of file doca_transport.c.

◆ nvmf_doca_destroy_emulation_manager()

static doca_error_t nvmf_doca_destroy_emulation_manager ( struct nvmf_doca_emulation_manager doca_emulation_manager)
static

Definition at line 275 of file doca_transport.c.

◆ nvmf_doca_destroy_pci_dev_poll_group()

static void nvmf_doca_destroy_pci_dev_poll_group ( struct nvmf_doca_pci_dev_poll_group pci_dev_pg)
static

Definition at line 1024 of file doca_transport.c.

◆ nvmf_doca_dump_opts()

static void nvmf_doca_dump_opts ( struct spdk_nvmf_transport *  transport,
struct spdk_json_write_ctx *  w 
)
static

Definition at line 682 of file doca_transport.c.

◆ nvmf_doca_get_optimal_poll_group()

static struct spdk_nvmf_transport_poll_group* nvmf_doca_get_optimal_poll_group ( struct spdk_nvmf_qpair *  qpair)
static

Definition at line 2060 of file doca_transport.c.

◆ nvmf_doca_listen()

static int nvmf_doca_listen ( struct spdk_nvmf_transport *  transport,
const struct spdk_nvme_transport_id *  trid,
struct spdk_nvmf_listen_opts *  listen_opts 
)
static

Definition at line 1846 of file doca_transport.c.

◆ nvmf_doca_listen_associate()

static int nvmf_doca_listen_associate ( struct spdk_nvmf_transport *  transport,
const struct spdk_nvmf_subsystem *  subsystem,
const struct spdk_nvme_transport_id *  trid 
)
static

Definition at line 1960 of file doca_transport.c.

◆ nvmf_doca_on_admin_cq_stop()

static void nvmf_doca_on_admin_cq_stop ( struct nvmf_doca_io io)
static

Definition at line 818 of file doca_transport.c.

◆ nvmf_doca_on_admin_sq_stop()

static void nvmf_doca_on_admin_sq_stop ( struct nvmf_doca_sq sq)
static

Definition at line 1397 of file doca_transport.c.

◆ nvmf_doca_on_copy_data_complete()

static void nvmf_doca_on_copy_data_complete ( struct nvmf_doca_sq sq,
struct doca_buf *  dst,
struct doca_buf *  src,
union doca_data  user_data 
)
static

Definition at line 3409 of file doca_transport.c.

◆ nvmf_doca_on_copy_nvm_data_complete()

static void nvmf_doca_on_copy_nvm_data_complete ( struct nvmf_doca_sq sq,
struct doca_buf *  dst,
struct doca_buf *  src,
union doca_data  user_data 
)
static

Definition at line 3433 of file doca_transport.c.

◆ nvmf_doca_on_fetch_nvm_sqe_complete()

static void nvmf_doca_on_fetch_nvm_sqe_complete ( struct nvmf_doca_sq sq,
struct nvmf_doca_sqe sqe,
uint16_t  sqe_idx 
)
static

This will begin an async flow passing through the following methods begin_nvme_cmd_data_none —> post_cqe_from_response —> nvmf_doca_on_post_cqe_complete

This will begin an async flow passing through the following methods begin_nvme_cmd_data_host_to_dpu —> nvme_cmd_map_prps —> buffers_ready_copy_data_host_to_dpu --> execute_spdk_request —> post_cqe_from_response —> nvmf_doca_on_post_cqe_complete

This will begin an async flow passing through the following methods begin_nvme_cmd_data_dpu_to_host —> nvme_cmd_map_prps —> buffers_ready_copy_data_dpu_to_host —> copy_dpu_data_to_host —> post_cqe_from_response —> nvmf_doca_on_post_cqe_complete

Definition at line 3310 of file doca_transport.c.

◆ nvmf_doca_on_fetch_sqe_complete()

static void nvmf_doca_on_fetch_sqe_complete ( struct nvmf_doca_sq sq,
struct nvmf_doca_sqe sqe,
uint16_t  sqe_idx 
)
static

This will begin an async flow passing through the following methods begin_nvme_cmd_data_none —> post_cqe_from_response —> nvmf_doca_on_post_cqe_complete

This will begin an async flow passing through the following methods begin_nvme_admin_cmd_data_host_to_dpu —> execute_spdk_request —> post_cqe_from_response —> nvmf_doca_on_post_cqe_complete

This will begin an async flow passing through the following methods begin_nvme_admin_cmd_data_dpu_to_host —> copy_dpu_data_to_host —> post_cqe_from_response —> nvmf_doca_on_post_cqe_complete

Definition at line 3165 of file doca_transport.c.

◆ nvmf_doca_on_initialization_error()

static void nvmf_doca_on_initialization_error ( void *  cb_arg)
static

Definition at line 1415 of file doca_transport.c.

◆ nvmf_doca_on_io_cq_stop()

static void nvmf_doca_on_io_cq_stop ( struct nvmf_doca_io io)
static

The PCI device poll group should be destroyed only after all CQs have been destroyed Admin QP thread is expected to poll admin CQs along with IO CQs In that case need to destroy the poll group only after admin CQ is destroyed

Definition at line 2875 of file doca_transport.c.

◆ nvmf_doca_on_io_sq_stop()

static void nvmf_doca_on_io_sq_stop ( struct nvmf_doca_sq sq)
static

Definition at line 2842 of file doca_transport.c.

◆ nvmf_doca_on_post_cqe_complete()

static void nvmf_doca_on_post_cqe_complete ( struct nvmf_doca_cq cq,
union doca_data  user_data 
)
static

Definition at line 3375 of file doca_transport.c.

◆ nvmf_doca_on_post_nvm_cqe_complete()

static void nvmf_doca_on_post_nvm_cqe_complete ( struct nvmf_doca_cq cq,
union doca_data  user_data 
)
static

Definition at line 3390 of file doca_transport.c.

◆ nvmf_doca_opts_init()

static void nvmf_doca_opts_init ( struct spdk_nvmf_transport_opts *  opts)
static

Definition at line 204 of file doca_transport.c.

◆ nvmf_doca_pci_dev_admin_create()

static int nvmf_doca_pci_dev_admin_create ( struct nvmf_doca_transport doca_transport,
const struct spdk_nvme_transport_id *  trid,
struct nvmf_doca_pci_dev_admin **  pci_dev_admin_out 
)
static

Definition at line 1742 of file doca_transport.c.

◆ nvmf_doca_pci_dev_admin_destroy()

static void nvmf_doca_pci_dev_admin_destroy ( struct nvmf_doca_pci_dev_admin pci_dev_admin)
static

Definition at line 1708 of file doca_transport.c.

◆ nvmf_doca_pci_dev_admin_reset()

static void nvmf_doca_pci_dev_admin_reset ( struct nvmf_doca_pci_dev_admin pci_dev_admin)
static

Definition at line 1330 of file doca_transport.c.

◆ nvmf_doca_pci_dev_admin_reset_continue()

static void nvmf_doca_pci_dev_admin_reset_continue ( struct nvmf_doca_pci_dev_admin pci_dev_admin)
static

Definition at line 1290 of file doca_transport.c.

◆ nvmf_doca_pci_dev_poll_group_stop_io_cq()

static void nvmf_doca_pci_dev_poll_group_stop_io_cq ( void *  ctx)
static

Definition at line 958 of file doca_transport.c.

◆ nvmf_doca_pci_dev_poll_group_stop_io_cq_done()

static void nvmf_doca_pci_dev_poll_group_stop_io_cq_done ( void *  ctx)
static

Definition at line 977 of file doca_transport.c.

◆ nvmf_doca_pci_dev_poll_group_stop_io_sq()

static void nvmf_doca_pci_dev_poll_group_stop_io_sq ( void *  ctx)
static

Definition at line 888 of file doca_transport.c.

◆ nvmf_doca_pci_dev_poll_group_stop_io_sq_done()

static void nvmf_doca_pci_dev_poll_group_stop_io_sq_done ( void *  ctx)
static

Definition at line 907 of file doca_transport.c.

◆ nvmf_doca_pci_type_create_and_start()

static doca_error_t nvmf_doca_pci_type_create_and_start ( struct nvmf_doca_emulation_manager doca_emulation_manager)
static

Definition at line 306 of file doca_transport.c.

◆ nvmf_doca_poll_group_add()

static int nvmf_doca_poll_group_add ( struct spdk_nvmf_transport_poll_group *  group,
struct spdk_nvmf_qpair *  qpair 
)
static

Definition at line 2263 of file doca_transport.c.

◆ nvmf_doca_poll_group_create()

static struct spdk_nvmf_transport_poll_group* nvmf_doca_poll_group_create ( struct spdk_nvmf_transport *  transport,
struct spdk_nvmf_poll_group *  group 
)
static

Definition at line 1988 of file doca_transport.c.

◆ nvmf_doca_poll_group_create_io_cq()

static void nvmf_doca_poll_group_create_io_cq ( void *  args)
static

Definition at line 2903 of file doca_transport.c.

◆ nvmf_doca_poll_group_create_io_cq_done()

static void nvmf_doca_poll_group_create_io_cq_done ( void *  args)
static

Definition at line 2797 of file doca_transport.c.

◆ nvmf_doca_poll_group_create_io_sq()

static void nvmf_doca_poll_group_create_io_sq ( void *  args)
static

Definition at line 3059 of file doca_transport.c.

◆ nvmf_doca_poll_group_create_io_sq_done()

static void nvmf_doca_poll_group_create_io_sq_done ( void *  args)
static

Definition at line 3034 of file doca_transport.c.

◆ nvmf_doca_poll_group_destroy()

static void nvmf_doca_poll_group_destroy ( struct spdk_nvmf_transport_poll_group *  group)
static

Definition at line 2036 of file doca_transport.c.

◆ nvmf_doca_poll_group_poll()

static int nvmf_doca_poll_group_poll ( struct spdk_nvmf_transport_poll_group *  group)
static

Definition at line 2306 of file doca_transport.c.

◆ nvmf_doca_poll_group_remove()

static int nvmf_doca_poll_group_remove ( struct spdk_nvmf_transport_poll_group *  group,
struct spdk_nvmf_qpair *  qpair 
)
static

Definition at line 2288 of file doca_transport.c.

◆ nvmf_doca_qpair_get_listen_trid()

static int nvmf_doca_qpair_get_listen_trid ( struct spdk_nvmf_qpair *  qpair,
struct spdk_nvme_transport_id *  trid 
)
static

Definition at line 2389 of file doca_transport.c.

◆ nvmf_doca_req_complete()

static int nvmf_doca_req_complete ( struct spdk_nvmf_request *  req)
static

Definition at line 2353 of file doca_transport.c.

◆ nvmf_doca_req_free()

static int nvmf_doca_req_free ( struct spdk_nvmf_request *  req)
static

Definition at line 2336 of file doca_transport.c.

◆ nvmf_doca_set_property()

static void nvmf_doca_set_property ( struct nvmf_doca_sq doca_sq)
static

Definition at line 2100 of file doca_transport.c.

◆ nvmf_doca_stop_listen()

static void nvmf_doca_stop_listen ( struct spdk_nvmf_transport *  transport,
const struct spdk_nvme_transport_id *  trid 
)
static

Definition at line 1911 of file doca_transport.c.

◆ nvmf_doca_transport_find_pci_dev_admin()

static struct nvmf_doca_pci_dev_admin* nvmf_doca_transport_find_pci_dev_admin ( struct nvmf_doca_transport doca_transport,
const char *  vuid 
)
static

Definition at line 727 of file doca_transport.c.

◆ post_cqe_from_response()

static void post_cqe_from_response ( struct nvmf_doca_request request,
void *  arg 
)
static

Definition at line 2572 of file doca_transport.c.

◆ post_error_cqe_from_response()

static void post_error_cqe_from_response ( struct nvmf_doca_request request)
static

Definition at line 2592 of file doca_transport.c.

◆ register_handlers_set_datapath_and_start()

static doca_error_t register_handlers_set_datapath_and_start ( struct nvmf_doca_emulation_manager doca_emulation_manager,
struct nvmf_doca_pci_dev_admin pci_dev_admin 
)
static

Definition at line 1587 of file doca_transport.c.

◆ register_to_stateful_region_write_events()

static doca_error_t register_to_stateful_region_write_events ( struct doca_devemu_pci_dev *  pci_dev,
struct nvmf_doca_pci_dev_admin pci_dev_admin 
)
static

Definition at line 1533 of file doca_transport.c.

◆ SPDK_NVMF_TRANSPORT_REGISTER()

SPDK_NVMF_TRANSPORT_REGISTER ( doca  ,
spdk_nvmf_transport_doca 
)

◆ stateful_region_write_event_handler_cb()

static void stateful_region_write_event_handler_cb ( struct doca_devemu_pci_dev_event_bar_stateful_region_driver_write *  event,
union doca_data  user_data 
)
static

Definition at line 1513 of file doca_transport.c.

Variable Documentation

◆ nvmf_doca_transport_app

struct doca_dpa_app* nvmf_doca_transport_app
extern

◆ spdk_nvmf_transport_doca

const struct spdk_nvmf_transport_ops spdk_nvmf_transport_doca
Initial value:
= {
.name = "DOCA",
.type = SPDK_NVME_TRANSPORT_CUSTOM,
.opts_init = nvmf_doca_opts_init,
.create = nvmf_doca_create,
.dump_opts = nvmf_doca_dump_opts,
.destroy = nvmf_doca_destroy,
.listen = nvmf_doca_listen,
.stop_listen = nvmf_doca_stop_listen,
.listen_associate = nvmf_doca_listen_associate,
.poll_group_create = nvmf_doca_poll_group_create,
.get_optimal_poll_group = nvmf_doca_get_optimal_poll_group,
.poll_group_destroy = nvmf_doca_poll_group_destroy,
.poll_group_add = nvmf_doca_poll_group_add,
.poll_group_remove = nvmf_doca_poll_group_remove,
.poll_group_poll = nvmf_doca_poll_group_poll,
.req_free = nvmf_doca_req_free,
.req_complete = nvmf_doca_req_complete,
.qpair_fini = nvmf_doca_close_qpair,
.qpair_get_listen_trid = nvmf_doca_qpair_get_listen_trid,
}
static struct spdk_nvmf_transport_poll_group * nvmf_doca_poll_group_create(struct spdk_nvmf_transport *transport, struct spdk_nvmf_poll_group *group)
static int nvmf_doca_listen_associate(struct spdk_nvmf_transport *transport, const struct spdk_nvmf_subsystem *subsystem, const struct spdk_nvme_transport_id *trid)
static void nvmf_doca_poll_group_destroy(struct spdk_nvmf_transport_poll_group *group)
static struct spdk_nvmf_transport_poll_group * nvmf_doca_get_optimal_poll_group(struct spdk_nvmf_qpair *qpair)
static int nvmf_doca_req_free(struct spdk_nvmf_request *req)
static int nvmf_doca_poll_group_poll(struct spdk_nvmf_transport_poll_group *group)
static int nvmf_doca_req_complete(struct spdk_nvmf_request *req)
static struct spdk_nvmf_transport * nvmf_doca_create(struct spdk_nvmf_transport_opts *opts)
static void nvmf_doca_close_qpair(struct spdk_nvmf_qpair *qpair, spdk_nvmf_transport_qpair_fini_cb cb_fn, void *cb_arg)
static void nvmf_doca_dump_opts(struct spdk_nvmf_transport *transport, struct spdk_json_write_ctx *w)
static int nvmf_doca_poll_group_remove(struct spdk_nvmf_transport_poll_group *group, struct spdk_nvmf_qpair *qpair)
static void nvmf_doca_opts_init(struct spdk_nvmf_transport_opts *opts)
static int nvmf_doca_listen(struct spdk_nvmf_transport *transport, const struct spdk_nvme_transport_id *trid, struct spdk_nvmf_listen_opts *listen_opts)
static int nvmf_doca_destroy(struct spdk_nvmf_transport *transport, spdk_nvmf_transport_destroy_done_cb cb_fn, void *cb_arg)
static void nvmf_doca_stop_listen(struct spdk_nvmf_transport *transport, const struct spdk_nvme_transport_id *trid)
static int nvmf_doca_poll_group_add(struct spdk_nvmf_transport_poll_group *group, struct spdk_nvmf_qpair *qpair)
static int nvmf_doca_qpair_get_listen_trid(struct spdk_nvmf_qpair *qpair, struct spdk_nvme_transport_id *trid)

Implementation of the DOCA transport

Definition at line 3433 of file doca_transport.c.