[ofa-general] Sending two integers via RDMA_WRITE

Dotan Barak dotanba at gmail.com
Mon May 25 10:46:47 PDT 2009


Hi.

Why do you use ntohl() on the rkey/remote_addr?
Which QP type is it? (RC or UC).
Did you poll for a completion and check that the status is good?

Dotan


Zafar Gilani wrote:
> Hi,
>
> I am trying to send two integers (essentially a buf array of type 
> uint32_t) to the server via RDMA_WRITE method. The following is piece 
> of code that I rewrote:
>
> ++++++++++++++++++++++++++++++++++
>
>   buf[0] = strtoul(argv[2], NULL, 0);
>   buf[1] = strtoul(argv[3], NULL, 0);
>
>   printf("%d + %d = ", buf[0], buf[1]);
>
>   buf[0] = htonl(buf[0]);
>   buf[1] = htonl(buf[1]);
>
>   /* -----------------------------------
>      ---- START - write operation 1 ----
>      ----------------------------------- */
>
> int c;
> for(c = 0; c < 2; c++)
> {
>   sge.addr = (uintptr_t) buf + ((uint32_t)c*sizeof(uint32_t));
>   sge.length = sizeof(uint32_t);
>   sge.lkey = mr->lkey;
>
>   send_wr.wr_id = (uint64_t)(c+1);//1;
>   send_wr.opcode = IBV_WR_RDMA_WRITE;
>   send_wr.sg_list = &sge;
>   send_wr.num_sge = 1;
>   send_wr.wr.rdma.rkey = ntohl(server_pdata.buf_rkey);
>   send_wr.wr.rdma.remote_addr = ntohll(server_pdata.buf_va);
>
>   if(ibv_post_send(cm_id->qp, &send_wr, &bad_send_wr))
>         return 1;
> }
>
> ++++++++++++++++++++++++++++++++++
>
> I receive no compilation errors but it does not write to remote 
> memory. Any suggestions of what might be wrong?
>
> Thanks,
> -- 
> Syed Zafar ul Hussan Gilani | BIT-7
> Research Student | CHPSC
> MSP 2008-09
> NUST SEECS | http://hpc.niit.edu.pk/~zafar 
> <http://hpc.niit.edu.pk/%7Ezafar>
> ------------------------------------------------------------------------
>
> _______________________________________________
> general mailing list
> general at lists.openfabrics.org
> http://lists.openfabrics.org/cgi-bin/mailman/listinfo/general
>
> To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general




More information about the general mailing list