nvmf: Standardize rdma init/fini functions
Change-Id: Ifa453e865e110cd534d34aae1bc036cc9f09b1bd Signed-off-by: Ben Walker <benjamin.walker@intel.com>
This commit is contained in:
parent
5ca81749de
commit
11b0c3cc51
@ -213,9 +213,9 @@ nvmf_tgt_subsystem_initialize(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* initialize with the NVMf transport */
|
/* initialize with the NVMf transport */
|
||||||
rc = nvmf_rdma_init();
|
rc = spdk_nvmf_rdma_init();
|
||||||
if (rc <= 0) {
|
if (rc <= 0) {
|
||||||
SPDK_ERRLOG("nvmf_rdma_init() failed\n");
|
SPDK_ERRLOG("spdk_nvmf_rdma_init() failed\n");
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
/* initialize NVMe/NVMf backend */
|
/* initialize NVMe/NVMf backend */
|
||||||
@ -253,6 +253,7 @@ nvmf_tgt_subsystem_fini(void)
|
|||||||
nvmf_shutdown();
|
nvmf_shutdown();
|
||||||
spdk_nvmf_host_destroy_all();
|
spdk_nvmf_host_destroy_all();
|
||||||
spdk_nvmf_port_destroy_all();
|
spdk_nvmf_port_destroy_all();
|
||||||
|
spdk_nvmf_rdma_fini();
|
||||||
free(g_nvmf_tgt.nodebase);
|
free(g_nvmf_tgt.nodebase);
|
||||||
|
|
||||||
pthread_mutex_destroy(&g_nvmf_tgt.mutex);
|
pthread_mutex_destroy(&g_nvmf_tgt.mutex);
|
||||||
|
@ -810,7 +810,7 @@ Initialize with RDMA transport. Query OFED for device list.
|
|||||||
|
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
nvmf_rdma_init(void)
|
spdk_nvmf_rdma_init(void)
|
||||||
{
|
{
|
||||||
struct ibv_device **dev_list;
|
struct ibv_device **dev_list;
|
||||||
struct ibv_context *ibdev_ctx = NULL;
|
struct ibv_context *ibdev_ctx = NULL;
|
||||||
@ -880,6 +880,13 @@ nvmf_rdma_init(void)
|
|||||||
return num_devices_found;
|
return num_devices_found;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
spdk_nvmf_rdma_fini(void)
|
||||||
|
{
|
||||||
|
/* Nothing to do */
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
nvmf_recv(struct spdk_nvmf_conn *conn, struct ibv_wc *wc)
|
nvmf_recv(struct spdk_nvmf_conn *conn, struct ibv_wc *wc)
|
||||||
{
|
{
|
||||||
|
@ -71,13 +71,16 @@ struct spdk_nvmf_rdma_request {
|
|||||||
uint32_t bb_len;
|
uint32_t bb_len;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
int spdk_nvmf_rdma_init(void);
|
||||||
|
int spdk_nvmf_rdma_fini(void);
|
||||||
|
|
||||||
int nvmf_post_rdma_read(struct spdk_nvmf_conn *conn,
|
int nvmf_post_rdma_read(struct spdk_nvmf_conn *conn,
|
||||||
struct spdk_nvmf_request *req);
|
struct spdk_nvmf_request *req);
|
||||||
int spdk_nvmf_rdma_request_complete(struct spdk_nvmf_conn *conn,
|
int spdk_nvmf_rdma_request_complete(struct spdk_nvmf_conn *conn,
|
||||||
struct spdk_nvmf_request *req);
|
struct spdk_nvmf_request *req);
|
||||||
int spdk_nvmf_rdma_request_release(struct spdk_nvmf_conn *conn,
|
int spdk_nvmf_rdma_request_release(struct spdk_nvmf_conn *conn,
|
||||||
struct spdk_nvmf_request *req);
|
struct spdk_nvmf_request *req);
|
||||||
int nvmf_rdma_init(void);
|
|
||||||
int spdk_nvmf_rdma_alloc_reqs(struct spdk_nvmf_conn *conn);
|
int spdk_nvmf_rdma_alloc_reqs(struct spdk_nvmf_conn *conn);
|
||||||
void spdk_nvmf_rdma_free_reqs(struct spdk_nvmf_conn *conn);
|
void spdk_nvmf_rdma_free_reqs(struct spdk_nvmf_conn *conn);
|
||||||
void spdk_nvmf_rdma_free_req(struct spdk_nvmf_request *req);
|
void spdk_nvmf_rdma_free_req(struct spdk_nvmf_request *req);
|
||||||
|
@ -88,7 +88,7 @@ int spdk_nvmf_parse_conf(void)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int nvmf_rdma_init(void)
|
int spdk_nvmf_rdma_init(void)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user