[ofa-general] Sending two integers via RDMA_WRITE

Zafar Gilani zafargilani at gmail.com
Mon May 25 11:08:26 PDT 2009


Thanks for the reply. I read your name under the Author for may be all the
IBV structs/operations at linux.die.net. So I am highly impressed by the
work (can only dream of it myself). :)

1. I don't know why the original author (Roland Dreir) has used ntohl() for
rkey and remote_addr. Though to use it on buffer (buf) is essential in order
to transfer the byte order from network to host.

2. I am using QP type RC for reliable connection.

3. Yes I am checking for that but the code gets stuck before that, around
when I call ibv_get_cq_event to wait for next completion event in the event
channel. I think the second write (second iteration of for loop) is not
working properly since when I try to send buf[0] via RDMA_WRITE and buf[1]
via SEND then it works fine.

The code I am walking about:

 while(1) {
    if(ibv_get_cq_event(comp_chan, &evt_cq, &cq_context)) // here it gets
stuck
        return 1;

// does not print this
printf("after get_cq_event\n"); fflush(stdout);

    if(ibv_req_notify_cq(cq, 0))
        return 1;

printf("after req_notify_cq\n"); fflush(stdout);

    if(ibv_poll_cq(cq, 1, &wc) != 1)
        return 1;

printf("after poll_cq\n"); fflush(stdout);

    if(wc.status != IBV_WC_SUCCESS)
        return 1;

printf("after wc.status\n"); fflush(stdout);

    if(wc.wr_id == 0) {
        printf("%d\n", ntohl(buf[0])); fflush(stdout);
        return 0;
    }
  }

Your thoughts on this?

Thanks,
zafar
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openfabrics.org/pipermail/general/attachments/20090525/91edde52/attachment.html>


More information about the general mailing list