public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
* IB atomic operations
@ 2011-02-25  7:30 Bharath Ramesh
  2011-02-25 15:57 ` frank zago
  0 siblings, 1 reply; 8+ messages in thread
From: Bharath Ramesh @ 2011-02-25  7:30 UTC (permalink / raw)
  To: linux-rdma-u79uwXL29TY76Z2rM5mHXA

[-- Attachment #1: Type: text/plain, Size: 850 bytes --]

Hi,
	I am trying to use IB atomic operations, specifically fetch and add.
I tried a small example but I am unable to get it to work. The WC status is
IBV_WC_REM_INV_REQ_ERR. My sample code is as follows:

sge.addr = (uintptr_t) &data;
sge.length = sizeof (uint64_t);
sge.lkey = ib_mr->lkey;
wr.opcode = IBV_WR_ATOMIC_FETCH_AND_ADD;
wr.send_flags = IBV_SEND_SIGNALED;
wr.next = NULL;
wr.num_sge = 1;
wr.sg_list = &sge;
wr.wr.atomic.remote_addr = vaddr;
wr.wr.atomic.compare_add = 1;
//wr.wr.atomic.swap = 0;
wr.wr.atomic.rkey = rkey;
wr.wr_id = 1;
ret = ibv_post_send (ib_qp, &wr, &wr_bad);
do {
	c = ibv_poll_cq (ib_cq, 1, &wc);
} while (c == 0);

if (c < 0) {
	printf ("ERROR: ibv_poll_cq failed.\n");
      return -1;
}

if (wc.status != IBV_WC_SUCCESS) {
	// print wc info.
	// print qp status.
}

Any help on this appreciated.

Regards,

Bharath

[-- Attachment #2: smime.p7s --]
[-- Type: application/x-pkcs7-signature, Size: 4985 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2011-02-25 18:30 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-25  7:30 IB atomic operations Bharath Ramesh
2011-02-25 15:57 ` frank zago
     [not found]   ` <4D67D17C.7000405-klaOcWyJdxkshyMvu7JE4pqQE7yCjDx5@public.gmane.org>
2011-02-25 16:04     ` Bharath Ramesh
2011-02-25 16:12       ` frank zago
     [not found]         ` <4D67D4F2.4040404-klaOcWyJdxkshyMvu7JE4pqQE7yCjDx5@public.gmane.org>
2011-02-25 16:32           ` Bharath Ramesh
2011-02-25 16:59             ` frank zago
     [not found]               ` <4D67E006.8000705-klaOcWyJdxkshyMvu7JE4pqQE7yCjDx5@public.gmane.org>
2011-02-25 17:29                 ` Bharath Ramesh
2011-02-25 18:30                 ` Bharath Ramesh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox