Linux RDMA and InfiniBand development
 help / color / mirror / Atom feed
From: "Yann Droneaud" <ydroneaud-RlY5vtjFyJ3QT0dZR+AlfA@public.gmane.org>
To: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Cc: ydroneaud-RlY5vtjFyJ3QT0dZR+AlfA@public.gmane.org
Subject: ibv_poll_cq() and wc->byte_len
Date: Wed, 13 Jun 2012 15:33:14 +0200	[thread overview]
Message-ID: <ede34732991cf26d52569692a20d7ae0.squirrel@webmail.ocsa-data.net> (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.

-- 
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

             reply	other threads:[~2012-06-13 13:33 UTC|newest]

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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ede34732991cf26d52569692a20d7ae0.squirrel@webmail.ocsa-data.net \
    --to=ydroneaud-rly5vtjfyj3qt0dzr+alfa@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox