static int blockdev_aio_create_cb(void *io_device, uint32_t priority, void *ctx_buf, void *unique_ctx) { struct blockdev_aio_io_channel *ch = ctx_buf; if (blockdev_aio_initialize_io_channel(ch) != 0) { return -1; } spdk_poller_register(&ch->poller, blockdev_aio_poll, ch, spdk_app_get_current_core(), 0); return 0; }
/** \brief Create an NVMf fabric connection from the given parameters and schedule it on a reactor thread. \code # identify reactor where the new connections work item will be scheduled reactor = nvmf_allocate_reactor() schedule fabric connection work item on reactor \endcode */ int spdk_nvmf_startup_conn(struct spdk_nvmf_conn *conn) { int lcore; struct spdk_nvmf_conn *admin_conn; uint64_t nvmf_session_core = spdk_app_get_core_mask(); /* * if starting IO connection then determine core * allocated to admin queue to request core mask. * Can not assume nvmf session yet created at time * of fabric connection setup. Rely on fabric * function to locate matching controller session. */ if (conn->type == CONN_TYPE_IOQ && conn->cntlid != 0) { admin_conn = spdk_find_nvmf_conn_by_cntlid(conn->cntlid); if (admin_conn != NULL) { SPDK_TRACELOG(SPDK_TRACE_DEBUG, "Located admin conn session core %d\n", admin_conn->poller.lcore); nvmf_session_core = 1ULL << admin_conn->poller.lcore; } } lcore = nvmf_allocate_reactor(nvmf_session_core); if (lcore < 0) { SPDK_ERRLOG("Unable to find core to launch connection.\n"); goto err0; } conn->state = CONN_STATE_RUNNING; SPDK_NOTICELOG("Launching nvmf connection[qid=%d] on core: %d\n", conn->qid, lcore); conn->poller.fn = spdk_nvmf_conn_do_work; conn->poller.arg = conn; rte_atomic32_inc(&g_num_connections[lcore]); spdk_poller_register(&conn->poller, lcore, NULL); return 0; err0: free_conn(conn); return -1; }