summaryrefslogtreecommitdiffstats
path: root/kiro-rdma.h
diff options
context:
space:
mode:
authorTimo Dritschler <timo.dritschler@kit.edu>2014-04-25 15:38:51 +0200
committerTimo Dritschler <timo.dritschler@kit.edu>2014-04-25 15:38:51 +0200
commitd17929dce11210dad47036c55f0fa60cb224392f (patch)
tree8ec132411c585af52a1c986f261e6260d2ebecd0 /kiro-rdma.h
parent87598eb305b64b009f6ed6d690edae9947759152 (diff)
downloadkiro-d17929dce11210dad47036c55f0fa60cb224392f.tar.gz
kiro-d17929dce11210dad47036c55f0fa60cb224392f.tar.bz2
kiro-d17929dce11210dad47036c55f0fa60cb224392f.tar.xz
kiro-d17929dce11210dad47036c55f0fa60cb224392f.zip
Fixed kiro_create_rdma_memory not setting pointers correctly
Fixed a bug in KIRO Server and Client that prevented preemtive "Post Recv"
Diffstat (limited to 'kiro-rdma.h')
-rw-r--r--kiro-rdma.h12
1 files changed, 8 insertions, 4 deletions
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;
}