Loading lib/nvmf/conn.c +1 −19 Original line number Diff line number Diff line Loading @@ -62,20 +62,6 @@ static int nvmf_allocate_reactor(uint64_t cpumask); static void spdk_nvmf_conn_do_work(void *arg); struct spdk_nvmf_conn * spdk_nvmf_allocate_conn(void) { struct spdk_nvmf_conn *conn; conn = calloc(1, sizeof(struct spdk_nvmf_conn)); if (conn == NULL) { SPDK_ERRLOG("Could not allocate new connection.\n"); return NULL; } return conn; } /** \brief Create an NVMf fabric connection from the given parameters and schedule it Loading @@ -99,7 +85,7 @@ spdk_nvmf_startup_conn(struct spdk_nvmf_conn *conn) lcore = nvmf_allocate_reactor(nvmf_session_core); if (lcore < 0) { SPDK_ERRLOG("Unable to find core to launch connection.\n"); goto err0; return -1; } conn->state = CONN_STATE_RUNNING; Loading @@ -111,9 +97,6 @@ spdk_nvmf_startup_conn(struct spdk_nvmf_conn *conn) spdk_poller_register(&conn->poller, lcore, NULL); return 0; err0: free(conn); return -1; } void Loading @@ -123,7 +106,6 @@ spdk_nvmf_conn_destruct(struct spdk_nvmf_conn *conn) nvmf_disconnect(conn->sess, conn); nvmf_rdma_conn_cleanup(conn); free(conn); } static void Loading lib/nvmf/conn.h +0 −3 Original line number Diff line number Diff line Loading @@ -70,9 +70,6 @@ struct spdk_nvmf_conn { struct spdk_poller poller; }; struct spdk_nvmf_conn * spdk_nvmf_allocate_conn(void); int spdk_nvmf_startup_conn(struct spdk_nvmf_conn *conn); void spdk_nvmf_conn_destruct(struct spdk_nvmf_conn *conn); Loading lib/nvmf/rdma.c +28 −2 Original line number Diff line number Diff line Loading @@ -71,6 +71,29 @@ struct spdk_nvmf_rdma { static struct spdk_nvmf_rdma g_rdma = { }; static struct spdk_nvmf_conn * allocate_conn(void) { struct spdk_nvmf_conn *conn; conn = calloc(1, sizeof(struct spdk_nvmf_conn)); if (conn == NULL) { SPDK_ERRLOG("Could not allocate new connection.\n"); return NULL; } /* all new connections initially default as AQ until nvmf connect */ conn->type = CONN_TYPE_AQ; /* no session association until nvmf connect */ conn->sess = NULL; conn->state = CONN_STATE_INVALID; conn->sq_head = 0; return conn; } static inline struct spdk_nvmf_rdma_request * get_rdma_req(struct spdk_nvmf_request *req) { Loading Loading @@ -269,6 +292,8 @@ nvmf_rdma_conn_cleanup(struct spdk_nvmf_conn *conn) ibv_destroy_comp_channel(conn->rdma.comp_channel); rdma_destroy_id(conn->rdma.cm_id); free(conn); } static void Loading Loading @@ -490,7 +515,7 @@ nvmf_rdma_connect(struct rdma_cm_event *event) struct spdk_nvmf_host *host; struct spdk_nvmf_fabric_intf *fabric_intf; struct rdma_cm_id *conn_id; struct spdk_nvmf_conn *conn; struct spdk_nvmf_conn *conn = NULL; struct spdk_nvmf_rdma_request *rdma_req; struct ibv_device_attr ibdev_attr; struct sockaddr_in *addr; Loading Loading @@ -541,7 +566,7 @@ nvmf_rdma_connect(struct rdma_cm_event *event) SPDK_TRACELOG(SPDK_TRACE_RDMA, "Found approved remote host %p\n", host); /* Init the NVMf rdma transport connection */ conn = spdk_nvmf_allocate_conn(); conn = allocate_conn(); if (conn == NULL) { SPDK_ERRLOG("Error on nvmf connection creation\n"); goto err1; Loading Loading @@ -632,6 +657,7 @@ err1: { rej_data.status.sc = sts; rdma_reject(conn_id, &ctrlr_event_data, sizeof(rej_data)); free(conn); } err0: return -1; Loading Loading
lib/nvmf/conn.c +1 −19 Original line number Diff line number Diff line Loading @@ -62,20 +62,6 @@ static int nvmf_allocate_reactor(uint64_t cpumask); static void spdk_nvmf_conn_do_work(void *arg); struct spdk_nvmf_conn * spdk_nvmf_allocate_conn(void) { struct spdk_nvmf_conn *conn; conn = calloc(1, sizeof(struct spdk_nvmf_conn)); if (conn == NULL) { SPDK_ERRLOG("Could not allocate new connection.\n"); return NULL; } return conn; } /** \brief Create an NVMf fabric connection from the given parameters and schedule it Loading @@ -99,7 +85,7 @@ spdk_nvmf_startup_conn(struct spdk_nvmf_conn *conn) lcore = nvmf_allocate_reactor(nvmf_session_core); if (lcore < 0) { SPDK_ERRLOG("Unable to find core to launch connection.\n"); goto err0; return -1; } conn->state = CONN_STATE_RUNNING; Loading @@ -111,9 +97,6 @@ spdk_nvmf_startup_conn(struct spdk_nvmf_conn *conn) spdk_poller_register(&conn->poller, lcore, NULL); return 0; err0: free(conn); return -1; } void Loading @@ -123,7 +106,6 @@ spdk_nvmf_conn_destruct(struct spdk_nvmf_conn *conn) nvmf_disconnect(conn->sess, conn); nvmf_rdma_conn_cleanup(conn); free(conn); } static void Loading
lib/nvmf/conn.h +0 −3 Original line number Diff line number Diff line Loading @@ -70,9 +70,6 @@ struct spdk_nvmf_conn { struct spdk_poller poller; }; struct spdk_nvmf_conn * spdk_nvmf_allocate_conn(void); int spdk_nvmf_startup_conn(struct spdk_nvmf_conn *conn); void spdk_nvmf_conn_destruct(struct spdk_nvmf_conn *conn); Loading
lib/nvmf/rdma.c +28 −2 Original line number Diff line number Diff line Loading @@ -71,6 +71,29 @@ struct spdk_nvmf_rdma { static struct spdk_nvmf_rdma g_rdma = { }; static struct spdk_nvmf_conn * allocate_conn(void) { struct spdk_nvmf_conn *conn; conn = calloc(1, sizeof(struct spdk_nvmf_conn)); if (conn == NULL) { SPDK_ERRLOG("Could not allocate new connection.\n"); return NULL; } /* all new connections initially default as AQ until nvmf connect */ conn->type = CONN_TYPE_AQ; /* no session association until nvmf connect */ conn->sess = NULL; conn->state = CONN_STATE_INVALID; conn->sq_head = 0; return conn; } static inline struct spdk_nvmf_rdma_request * get_rdma_req(struct spdk_nvmf_request *req) { Loading Loading @@ -269,6 +292,8 @@ nvmf_rdma_conn_cleanup(struct spdk_nvmf_conn *conn) ibv_destroy_comp_channel(conn->rdma.comp_channel); rdma_destroy_id(conn->rdma.cm_id); free(conn); } static void Loading Loading @@ -490,7 +515,7 @@ nvmf_rdma_connect(struct rdma_cm_event *event) struct spdk_nvmf_host *host; struct spdk_nvmf_fabric_intf *fabric_intf; struct rdma_cm_id *conn_id; struct spdk_nvmf_conn *conn; struct spdk_nvmf_conn *conn = NULL; struct spdk_nvmf_rdma_request *rdma_req; struct ibv_device_attr ibdev_attr; struct sockaddr_in *addr; Loading Loading @@ -541,7 +566,7 @@ nvmf_rdma_connect(struct rdma_cm_event *event) SPDK_TRACELOG(SPDK_TRACE_RDMA, "Found approved remote host %p\n", host); /* Init the NVMf rdma transport connection */ conn = spdk_nvmf_allocate_conn(); conn = allocate_conn(); if (conn == NULL) { SPDK_ERRLOG("Error on nvmf connection creation\n"); goto err1; Loading Loading @@ -632,6 +657,7 @@ err1: { rej_data.status.sc = sts; rdma_reject(conn_id, &ctrlr_event_data, sizeof(rej_data)); free(conn); } err0: return -1; Loading