nvmf: Standardize rdma init/fini functions

Change-Id: Ifa453e865e110cd534d34aae1bc036cc9f09b1bd
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
This commit is contained in:
Ben Walker 2016-07-01 13:18:24 -07:00 committed by Daniel Verkamp
parent 5ca81749de
commit 11b0c3cc51
4 changed files with 16 additions and 5 deletions

View File

@ -213,9 +213,9 @@ nvmf_tgt_subsystem_initialize(void)
}
/* initialize with the NVMf transport */
rc = nvmf_rdma_init();
rc = spdk_nvmf_rdma_init();
if (rc <= 0) {
SPDK_ERRLOG("nvmf_rdma_init() failed\n");
SPDK_ERRLOG("spdk_nvmf_rdma_init() failed\n");
return rc;
}
/* initialize NVMe/NVMf backend */
@ -253,6 +253,7 @@ nvmf_tgt_subsystem_fini(void)
nvmf_shutdown();
spdk_nvmf_host_destroy_all();
spdk_nvmf_port_destroy_all();
spdk_nvmf_rdma_fini();
free(g_nvmf_tgt.nodebase);
pthread_mutex_destroy(&g_nvmf_tgt.mutex);

View File

@ -810,7 +810,7 @@ Initialize with RDMA transport. Query OFED for device list.
*/
int
nvmf_rdma_init(void)
spdk_nvmf_rdma_init(void)
{
struct ibv_device **dev_list;
struct ibv_context *ibdev_ctx = NULL;
@ -880,6 +880,13 @@ nvmf_rdma_init(void)
return num_devices_found;
}
int
spdk_nvmf_rdma_fini(void)
{
/* Nothing to do */
return 0;
}
static int
nvmf_recv(struct spdk_nvmf_conn *conn, struct ibv_wc *wc)
{

View File

@ -71,13 +71,16 @@ struct spdk_nvmf_rdma_request {
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,
struct spdk_nvmf_request *req);
int spdk_nvmf_rdma_request_complete(struct spdk_nvmf_conn *conn,
struct spdk_nvmf_request *req);
int spdk_nvmf_rdma_request_release(struct spdk_nvmf_conn *conn,
struct spdk_nvmf_request *req);
int nvmf_rdma_init(void);
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_req(struct spdk_nvmf_request *req);

View File

@ -88,7 +88,7 @@ int spdk_nvmf_parse_conf(void)
return 0;
}
int nvmf_rdma_init(void)
int spdk_nvmf_rdma_init(void)
{
return 0;
}