From d17929dce11210dad47036c55f0fa60cb224392f Mon Sep 17 00:00:00 2001 From: Timo Dritschler Date: Fri, 25 Apr 2014 15:38:51 +0200 Subject: Fixed kiro_create_rdma_memory not setting pointers correctly Fixed a bug in KIRO Server and Client that prevented preemtive "Post Recv" --- kiro-rdma.h | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'kiro-rdma.h') diff --git a/kiro-rdma.h b/kiro-rdma.h index ff39136..25040c8 100644 --- a/kiro-rdma.h +++ b/kiro-rdma.h @@ -77,7 +77,7 @@ struct kiro_rdma_mem { }; -static int kiro_register_rdma_memory (struct ibv_pd *pd, struct ibv_mr *mr, void *mem, size_t mem_size, int access) +static int kiro_register_rdma_memory (struct ibv_pd *pd, struct ibv_mr **mr, void *mem, size_t mem_size, int access) { if(mem_size == 0) @@ -97,8 +97,8 @@ static int kiro_register_rdma_memory (struct ibv_pd *pd, struct ibv_mr *mr, void return -1; } - mr = ibv_reg_mr(pd, mem_handle, mem_size, access); - if(!mr) + *mr = ibv_reg_mr(pd, mem_handle, mem_size, access); + if(!(*mr)) { // Memory Registration failed printf("Failed to register memory region!\n"); @@ -125,12 +125,16 @@ static struct kiro_rdma_mem* kiro_create_rdma_memory (struct ibv_pd *pd, size_t return NULL; } - if(kiro_register_rdma_memory(pd, krm->mr, krm->mem, mem_size, access)) + if(kiro_register_rdma_memory(pd, &(krm->mr), krm->mem, mem_size, access)) { free(krm); return NULL; } + if(!krm->mem) + krm->mem = krm->mr->addr; + + return krm; } -- cgit v1.2.3