[ofa-general] missed cq event

Philip Frey1 PHF at zurich.ibm.com
Fri Jun 6 09:59:27 PDT 2008


Hello,

what is the correct way to get completions from the CQ without missing 
any?
I am currently using two separate CQs for the SQ and for the RQ.
In pseudocode I do about the following to wait for a completion:

ibv_get_cq_event(channel, &dst_cq, &ctx);       //blocking wait for CQ 
event
<-- EVENT -->
ibv_req_notify_cq(dst_cq, 0);                   // request event for next 
completion
ibv_poll_cq(dest_cq, 1, wc);                    // get the WC from the CQ
ibv_ack_cq_events(dst_cq, 1);                   // ack the event

It might now happen on the RQ, that two consecutive inbound sends consume
receive WRs and therefore generate two WCs on the RQ. If the second is 
generated
before I get the first one, I will miss it and wait infinitely long for it 
since I already got the event
but that event does not tell me how many WCs are pending on the respective 
CQ.

One way to handle this issue would be to do an ibv_poll_cq() before 
waiting for the event
in case there is something on the CQ for which I missed the event.

Is there a more elegant way to get all events pending on the CQ or find 
out how many
completions are pending? I could also do a ibv_poll_cq() and request say 
10 completions
and see how many I got but that is kind of a hack...


Many thanks for your advice,
 Philip
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openfabrics.org/pipermail/general/attachments/20080606/24fbfe10/attachment.html>


More information about the general mailing list