[ofa-general] [PATCH] ipoib: Bug fix in ipoib_poll - resend

Eli Cohen eli at mellanox.co.il
Tue Nov 27 02:17:26 PST 2007


On Tue, 2007-11-27 at 15:23 +0530, Krishna Kumar2 wrote:
> Hi Eli,
> 
> >
> >        t = min(IPOIB_NUM_WC, max);
> >        n = ib_poll_cq(priv->cq, t, priv->ibwc);
> > +      if (unlikely(n < 1))
> > +         break;
> >
> >        for (i = 0; i < n; i++) {
> >           struct ib_wc *wc = priv->ibwc + i;
> 
> The 'for' loop (followed by the "if (n != t) break" check)
> should take care of this, isn't it?
> 

Oh you're saying that since this is signed arithmetic we should never
enter the for loop. I saw a problem when I worked on some patch and that
seemed to solve the problem...




More information about the general mailing list