Linux RDMA and InfiniBand development
 help / color / mirror / Atom feed
* ibv_poll_cq() and wc->byte_len
@ 2012-06-13 13:33 Yann Droneaud
       [not found] ` <ede34732991cf26d52569692a20d7ae0.squirrel-2RFepEojUI2lDZmfZ6uX/xeHL2rgt/dS@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Yann Droneaud @ 2012-06-13 13:33 UTC (permalink / raw)
  To: linux-rdma-u79uwXL29TY76Z2rM5mHXA; +Cc: ydroneaud-RlY5vtjFyJ3QT0dZR+AlfA

Hi,

I was trying to use byte_len field from struct ibv_wc to report
the total number of bytes actually sent after a ibv_post_send() with
opcode IBV_WR_SEND.

After polling the completion queue (CQ) and ensuring status field of
struct ibv_wc has value IBV_WC_SUCCESS, the field byte_len of the
structure seems to be invalid.

Indeed, according to libmlx4 sources and mlx_poll_one() function, byte_len
is not always set for a send operation. It's set only for
IBV_WC_RDMA_READ, IBV_WC_COMP_SWAP and IBV_WC_FETCH_ADD, and not set for
IBV_WC_RDMA_WRITE and IBV_WC_SEND (and also not for IBV_WC_BIND_MW). This
is the same thing for libmthca.

I haven't checked for QLogic/Intel libipathverbs since it does a direct
memcpy() to the destination struct ibv_wc, looking at the library code
doesn't help me a lot.

Note: Hopefully, for receive operation, byte_len is always valid.

ibv_poll_cq(3) man page is not really helpful to know which field will be
valid depending on the opcode field of struct ibv_wc, exception when
status is not IBV_WC_SUCCESS.

Is libmlx4, libmthca behavior correct ?

In a parallel universe, struct ibv_wc would have a bitmap field indicating
which others fields are valid. In this part of the multiverse, a more
complete documentation would be welcome. If libmlx4/libmthca behavior is
the compliant one, I can provide an updated man page.

Regards.

-- 
Yann Droneaud
OPTEYA


--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

end of thread, other threads:[~2012-06-14 12:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-13 13:33 ibv_poll_cq() and wc->byte_len Yann Droneaud
     [not found] ` <ede34732991cf26d52569692a20d7ae0.squirrel-2RFepEojUI2lDZmfZ6uX/xeHL2rgt/dS@public.gmane.org>
2012-06-13 14:19   ` Hefty, Sean
     [not found]     ` <1828884A29C6694DAF28B7E6B8A8237346A31355-P5GAC/sN6hmkrb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
2012-06-14 12:39       ` Yann Droneaud

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