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

somenath somenath at veritas.com
Fri Jul 14 15:24:30 PDT 2006


Sean Hefty wrote:

> somenath wrote:
>
>>> I think this evaluates ib_poll_cq(..) < 0 before doing the 
>>> assignment.  Since the expression evaluates to false, count is 
>>> assigned 0.  Can you try modifying this to:
>>>
>>> if ((count = ib_poll_cq(..)) < 0)
>>>
>>> - Sean
>>
>>
>>
>> I added that stuff, but it didn't make a difference...it still 
>> returned 0....
>
>
> If ib_poll_cq() is truly returning 0, but with a valid wc, then this 
> is a bug. (I'm pretty sure that the additional parens are needed in 
> any case, and you'll also want to swap your ib_poll_cq and 
> ib_req_notify calls back around.)  I have never seen this issue, and 
> I'm sure that we would have heard about it if others had.  Nothing 
> obvious jumped out at me when looking at the mthca completion code.
>
> Maybe you've tried this, but can you break the count = ib_poll_cq() 
> out from the if statement, print count and the wc structure 
> immediately before and after the call, and post the results?


I tried this code too...(an retrying just now) and seeing it still 
returns 0...

 count = ib_poll_cq(cq, 1, &wc);
    if (count  < 0) {
          stat = xxx_st_error;
          goto error;                   //it has never gone to error 
from this location.
    }

I am ready to try any other suggestions and will change this portion of 
the code too,
but currently I am just trying to get a valid wc handle with 
ib_poll_cq() returning 1!!!
that never happens in anyway I try.

>
>> looks like, I may be getting a valid entry even if ib_poll_cq() is 
>> returning zero...
>> is that possible?
>
>
> You should not be getting a valid wc if the call returns 0.  For most 
> applications this would result in a lost completion.
>
>> dump of wc entry from recv side, looks like many are valid entries 
>> (like wr_id, length, op etc..)
>
>
> This could just be left over data from the stack, but...
>
>> wr_id=0x10118163c00 status=0x0 op=0x80
>
>
> Does the wr_id match the value that you set on the work request?  (I'm 
> assuming that it does based on your previous comment.)  The opcode 
> does match IB_WC_RECV.
>
'
yes, wr_id, lenght, opcode, status match...

next, i will check the data ....

> - Sean






More information about the general mailing list