[openib-general] is wc valid if ib_poll_cq() returns zero

somenath somenath at veritas.com
Fri Jul 14 10:51:25 PDT 2006


somenath wrote:

>Rimmer, Todd wrote:
>
>  
>
>>>From: Sean Hefty
>>>somenath wrote:
>>>   
>>>
>>>      
>>>
>>>>2. why is the io completion routine called when ib_poll_cq() returns
>>>>zero? does this kind of notification contain any information?
>>>>is there some error happening here? what are some possible problem
>>>>     
>>>>
>>>>        
>>>>
>>>areas?
>>>   
>>>
>>>      
>>>
>>>>any wild guess...?
>>>>     
>>>>
>>>>        
>>>>
>>>Can you clarify what's happening?  Are you calling ib_poll_cq() from
>>>   
>>>
>>>      
>>>
>>your
>> 
>>
>>    
>>
>>>ib_comp_handler() and not finding a completion?
>>>   
>>>
>>>      
>>>
>>Be aware that an IB completion handler should be coded as:
>>
>>while poll_cq returns a completion
>>	process completion
>>rearm CQ
>> 
>>
>>    
>>
>
>that's what I am doing, to be more specific:
>
>rearm CQ;
>while (ib_poll_cq(cq, 1, &wc) > 0) {
>     process completion();
>}
>
>is that what you meant?
>  
>

just to make sure I conveyed the exact thing I meant, if I change
the above code as follows:

while (ib_poll_cq(cq, 1, &wc) > 0) {
     process completion();
}
rearm CQ;

then I just get notification once, and don't get any futher
notifications...so I assume rearm CQ should be done even if
ib_poll_cq() returns zero.

thanks, som.


>  
>
>>while poll_cq returns a completion
>>	process completion
>>
>>Per the IBTA spec, rearm CQ is not required to generate an event for
>>completions already on the CQ, just for newly arriving ones (Mellanox
>>HCAs will generate a completion event if any CQEs remain on the CQ).
>>
>>Due to various race situations between the HCA and the software/ULP,
>>there are some valid cases where a completion event could occur after
>>poll_cq has already processed the completion.
>> 
>>
>>    
>>
>
>in my case, poll_cq() always returns 0, so I never get a valid wc entry...
>
>  
>
>>Todd Rimmer
>> 
>>
>>    
>>
>
>
>_______________________________________________
>openib-general mailing list
>openib-general at openib.org
>http://openib.org/mailman/listinfo/openib-general
>
>To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general
>
>  
>





More information about the general mailing list