[ofa-general] Re: [PATCH] ib/limthca: Remove an always true condition

Roland Dreier rdreier at cisco.com
Fri Jan 25 09:13:07 PST 2008


 > > why is first_free always >= 0?  I don't see anything that guarantees
 > > that,
 > 
 > The following two subsequent ifs gurantees that.
 > 
 >                if (ind < 0) {
 >                         err = -1;
 >                         *bad_wr = wr;
 >                         break;
 >                 }
 > 
 >                 wqe       = get_wqe(srq, ind);
 >                 next_ind  = *wqe_to_link(wqe);
 > 
 >                 if (next_ind < 0) {
 >                         err = -1;
 >                         *bad_wr = wr;
 >                         break;
 >                 }

Duh... I missed that.  Thanks for the clue.

but now am I wrong to think that we could remove the first test of ind
(not next_ind) in the fast path?  the second test guarantees that ind
never becomes negative, as you pointed out.

 - R.



More information about the general mailing list