nvmf: Don't allocate our own RDMA protection domain
If we just pass NULL to rdma_create_qp, it will do the right thing. Change-Id: I9621a5110ace6237a1e47c6e5defb4cac3afc4ae Signed-off-by: Ben Walker <benjamin.walker@intel.com>
This commit is contained in:
parent
309a97f782
commit
ba37804100
@ -94,7 +94,6 @@ struct spdk_nvmf_conn {
|
|||||||
struct rdma_cm_id *cm_id;
|
struct rdma_cm_id *cm_id;
|
||||||
struct ibv_context *ctx;
|
struct ibv_context *ctx;
|
||||||
struct ibv_comp_channel *comp_channel;
|
struct ibv_comp_channel *comp_channel;
|
||||||
struct ibv_pd *pd;
|
|
||||||
struct ibv_cq *cq;
|
struct ibv_cq *cq;
|
||||||
struct ibv_qp *qp;
|
struct ibv_qp *qp;
|
||||||
|
|
||||||
|
@ -81,16 +81,10 @@ nvmf_rdma_queue_init(struct spdk_nvmf_conn *conn,
|
|||||||
}
|
}
|
||||||
conn->ctx = verbs;
|
conn->ctx = verbs;
|
||||||
|
|
||||||
conn->pd = ibv_alloc_pd(verbs);
|
|
||||||
if (!conn->pd) {
|
|
||||||
SPDK_ERRLOG("alloc pd error!\n");
|
|
||||||
goto return_error;
|
|
||||||
}
|
|
||||||
|
|
||||||
conn->comp_channel = ibv_create_comp_channel(verbs);
|
conn->comp_channel = ibv_create_comp_channel(verbs);
|
||||||
if (!conn->comp_channel) {
|
if (!conn->comp_channel) {
|
||||||
SPDK_ERRLOG("create completion channel error!\n");
|
SPDK_ERRLOG("create completion channel error!\n");
|
||||||
goto comp_ch_error;
|
goto return_error;
|
||||||
}
|
}
|
||||||
rc = fcntl(conn->comp_channel->fd, F_SETFL, O_NONBLOCK);
|
rc = fcntl(conn->comp_channel->fd, F_SETFL, O_NONBLOCK);
|
||||||
if (rc < 0) {
|
if (rc < 0) {
|
||||||
@ -118,7 +112,7 @@ nvmf_rdma_queue_init(struct spdk_nvmf_conn *conn,
|
|||||||
attr.cap.max_send_sge = NVMF_DEFAULT_TX_SGE;
|
attr.cap.max_send_sge = NVMF_DEFAULT_TX_SGE;
|
||||||
attr.cap.max_recv_sge = NVMF_DEFAULT_RX_SGE;
|
attr.cap.max_recv_sge = NVMF_DEFAULT_RX_SGE;
|
||||||
|
|
||||||
rc = rdma_create_qp(conn->cm_id, conn->pd, &attr);
|
rc = rdma_create_qp(conn->cm_id, NULL, &attr);
|
||||||
if (rc) {
|
if (rc) {
|
||||||
SPDK_ERRLOG("rdma_create_qp failed\n");
|
SPDK_ERRLOG("rdma_create_qp failed\n");
|
||||||
goto cq_error;
|
goto cq_error;
|
||||||
@ -129,8 +123,6 @@ nvmf_rdma_queue_init(struct spdk_nvmf_conn *conn,
|
|||||||
|
|
||||||
cq_error:
|
cq_error:
|
||||||
ibv_destroy_comp_channel(conn->comp_channel);
|
ibv_destroy_comp_channel(conn->comp_channel);
|
||||||
comp_ch_error:
|
|
||||||
ibv_dealloc_pd(conn->pd);
|
|
||||||
return_error:
|
return_error:
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@ -223,7 +215,6 @@ nvmf_rdma_conn_cleanup(struct spdk_nvmf_conn *conn)
|
|||||||
}
|
}
|
||||||
|
|
||||||
ibv_destroy_comp_channel(conn->comp_channel);
|
ibv_destroy_comp_channel(conn->comp_channel);
|
||||||
ibv_dealloc_pd(conn->pd);
|
|
||||||
rdma_destroy_id(conn->cm_id);
|
rdma_destroy_id(conn->cm_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user