Commit b1145888 authored by Titouan Soulard's avatar Titouan Soulard

libtrx: fill RDMA Recv queue

parent 8761063e
......@@ -13,13 +13,13 @@ void *trx_rdma_recv_thread(void *context) {
in_data = (struct SDRMemoryRegion *) sdr_context->in_mr->addr;
while(1) {
// Post a Recv request and poll for completion
capulet_rdma_ib_post_recv(&sdr_context->ib_ctx, sdr_context->in_mr, sizeof(struct SDRMemoryRegion));
do {
result = ibv_poll_cq(sdr_context->ib_ctx.recv_cq, 1, &poll_wc);
} while(result == 0);
// Post a Recv request and poll for completion
capulet_rdma_ib_post_recv(&sdr_context->ib_ctx, sdr_context->in_mr, sizeof(struct SDRMemoryRegion));
// Copy data from RDMA buffer to local buffer
sample_count = in_data->meta.sample_count;
// XXX: should handle multiple channels
......@@ -121,6 +121,13 @@ int trx_rdma_start(TRXState *s, const TRXDriverParams2 *p) {
result = capulet_rdma_ib_set_peer_from_udp(&sdr_context->ib_ctx, sdr_context->udp_ctx);
if(!result) return -1;
// Fill the Recv queue
for(int i = 0; i < 16; i++) {
capulet_rdma_ib_post_recv(&sdr_context->ib_ctx, sdr_context->in_mr, sizeof(struct SDRMemoryRegion));
}
usleep(1000);
// Samples will be received (and sent) using a separate thread which manipulates a finite circular
// buffer. The size of the buffer depends on the latency of the network.
sdr_context->recv_buffer = common_circular_buffer_create(TRX_RDMA_BUFFER_SAMPLES * sizeof(TRXComplex), false);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment