Skip to contentSkip to conversation

ibv_poll_cq() and wc->byte_len

DISCUSSION Yann Droneaud 2 participants 3 messages Jun 13, 2012 – Jun 14, 2012 2 messages not in the archive InfiniBand

lore
Share & tools
lore
#0 lore raw

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.

Signature · 8 lines
Yann Droneaud
OPTEYA


--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): ede34732991cf26d52569692a20d7ae0.squirrel-2RFepEojUI2lDZmfZ6uX/xeHL2rgt/[email protected]

#2 lore raw
Quoted 4 lines

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.

The best documentation available regarding expected verbs behavior is the IB spec (chapter 11). For this specific field, see section 11.4.2:

The number of bytes transferred.
The number of bytes transferred is returned in Work Completions for Receive Work Requests for incoming Sends and
RDMA Writes with Immediate Data. This does not include the length of any immediate data.
The number of bytes transferred is returned in Work Completions for Send Work Requests for RDMA Read and Atomic Operations. For the RQ of a UD QP that is not associated with an SRQ or for an SRQ that is associated with a UD QP, the number of bytes transferred is the payload of the message plus the 40 bytes reserved for the GRH. For the RQ of a UD QP that is not associated with an SRQ or for an SRQ that is associated with a UD QP, the 40 bytes is always included, whether or not the GRH is present.

- Sean
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): 1828884A29C6694DAF28B7E6B8A8237346A31355-P5GAC/[email protected]

#4 lore raw

Hi,

Quoted 9 lines
Quoted 5 lines

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.

The best documentation available regarding expected verbs behavior is the IB spec (chapter 11). For this specific field, see section 11.4.2:

Thanks a lot for the link.
Once again, I forgot to go through the IB spec.

Regards

Signature · 8 lines
Yann Droneaud
OPTEYA


--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html