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

Sean Hefty mshefty at ichips.intel.com
Fri Jul 14 14:01:44 PDT 2006


somenath wrote:
> int
> io_complete(
>        struct  ib_cq *cq,
>        void *passed_arg)
> {
>    xxx_connection_t    *arg = passed_arg;
>    xxx_status_t    stat = xxx_st_ok;
>    struct ib_wc wc;
>    int count = 0;
> 
>    if (count = ib_poll_cq(cq, 1, &wc) < 0) {

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




More information about the general mailing list