[ofa-general] correct buffer init for multiple receives

Donour Sizemore donour at cs.unm.edu
Mon Jul 23 21:20:17 PDT 2007


Hi everybody.

I'm having a bit of trouble setting up multiple receive buffers for 
verbs. I'm using the ud pingpong example in ofed1.2 as an outline, but 
that example posts the same buffer for all receives.

I'm trying to do something like:

--
  for(i=0; i < IB_RXDEPTH; i++){
     posix_memalign((void**)&(conn->bufs[i]),1024, (IB_MTU + 40));
     memset(conn->bufs, 0, (IB_MTU+40));
   }

  conn->pd = ibv_alloc_pd(conn->context);
  for(i=0; i < nbufs; i++)
     conn->mr = ibv_reg_mr(conn->pd, (conn->bufs[i]), (IB_MTU+40), 
IBV_ACCESS_LOCAL_WRITE);
--

Then I'm trying to do a bunch of ibv_post_recv()'s with each buf[i] as 
the address in the ibv_sge.

Is this what I should be doing? It seems to be causing a big mess, 
corrupting memory, and giving unrepeatable results.

thanks,

Donour Sizemore
University of New Mexico






More information about the general mailing list