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

Michael S. Tsirkin mst at mellanox.co.il
Mon Jun 12 21:26:47 PDT 2006


Quoting r. Roland Dreier <rdreier at cisco.com>:
>  > +		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.

Hmm, right.

>  > +			    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?

But note this branch is there "just in case".

-- 
MST




More information about the general mailing list