summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--rpc/rpc-transport/rdma/src/rdma.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/rpc/rpc-transport/rdma/src/rdma.c b/rpc/rpc-transport/rdma/src/rdma.c
index 34972deef09..b2c1516c56c 100644
--- a/rpc/rpc-transport/rdma/src/rdma.c
+++ b/rpc/rpc-transport/rdma/src/rdma.c
@@ -721,6 +721,10 @@ gf_rdma_get_device (rpc_transport_t *this, struct ibv_context *ibctx,
}
priv->device = trav;
trav->context = ibctx;
+
+ trav->next = rdma_ctx->device;
+ rdma_ctx->device = trav;
+
iobuf_pool->device[iobuf_pool->rdma_device_count] = trav;
iobuf_pool->mr_list[iobuf_pool->rdma_device_count++] = &trav->all_mr;
trav->request_ctx_pool
@@ -744,9 +748,6 @@ gf_rdma_get_device (rpc_transport_t *this, struct ibv_context *ibctx,
trav->device_name = gf_strdup (device_name);
- trav->next = rdma_ctx->device;
- rdma_ctx->device = trav;
-
trav->send_chan = ibv_create_comp_channel (trav->context);
if (!trav->send_chan) {
gf_msg (this->name, GF_LOG_ERROR, 0,
@@ -863,6 +864,7 @@ gf_rdma_get_device (rpc_transport_t *this, struct ibv_context *ibctx,
out:
if (trav != NULL) {
+ rdma_ctx->device = trav->next;
gf_rdma_destroy_posts (this);
mem_pool_destroy (trav->ioq_pool);
mem_pool_destroy (trav->request_ctx_pool);