[openib-general] mthca: post_receive

Roland Dreier roland at topspin.com
Wed Feb 9 08:54:22 PST 2005


    Michael> Shouldnt that be:

    Michael>                 if (qp->rq.cur + nreq > qp->rq.max)

    Michael> If I want to allow rq.max WQEs - should not I be allowed
    Michael> to post that much?

The code is correct but perhaps the name "nreq" could be improved.  If
you look at the code in context:

	for (nreq = 0; wr; ++nreq, wr = wr->next) {
		if (unlikely(qp->rq.cur + nreq >= qp->rq.max)) {

you can see that nreq is a 0-based index of the work request we're
working on.  So for example, if max is 3 and cur is 1 (so we have 2
slots open in our WQ), then the test will fail when trying to post the
third work request, which is correct.

 - R.



More information about the general mailing list