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 majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html