[openib-general] [PATCH] mthca: memfree completion with error workaround

Roland Dreier rdreier at cisco.com
Mon Jun 12 14:49:15 PDT 2006


 > +		/* WQE index == -1 might be reported by
 > +		   Sinai FW 1.0.800, Arbel FW 5.1.400 and should be fixed
 > +		   in later revisions. */

In the future please use

 /*
  * comment
  */

style comments.

 > +		if (unlikely(wqe_index >= (*cur_qp)->rq.max)) {
 > +			if (unlikely(is_error) &&
 > +			    unlikely(wqe_index == 0xffffffff >> wq->wqe_shift) &&

seems like the inside unlikely()s are wrong here -- the reason we
expect to be here is exactly the reason being marked unlikely, which
is backwards.

 > +			    mthca_is_memfree(dev))
 > +				wqe_index = wq->max - 1;
 > +			else {
 > +				mthca_err(dev, "Corrupted RQ CQE. "
 > +					  "CQ 0x%x QP 0x%x idx 0x%x > 0x%x\n",
 > +					  cq->cqn, entry->qp_num, wqe_index,
 > +					  wq->max);
 > +				return -EINVAL;

This should probably be "err = -EINVAL; goto out;" right?

 > +			}
 > +		}
 >  		entry->wr_id = (*cur_qp)->wrid[wqe_index];
 >  	}
 > 




More information about the general mailing list