Same thing for userspace.

---

Fix up completion with error for memfree.

Signed-off-by: Michael S. Tsirkin <[EMAIL PROTECTED]>

Index: openib/src/userspace/libmthca/src/cq.c
===================================================================
--- openib/src/userspace/libmthca/src/cq.c      (revision 7890)
+++ openib/src/userspace/libmthca/src/cq.c      (working copy)
@@ -347,8 +347,17 @@
                wc->wr_id = srq->wrid[wqe_index];
                mthca_free_srq_wqe(srq, wqe_index);
        } else {
+               int32_t wqe;
                wq = &(*cur_qp)->rq;
-               wqe_index = ntohl(cqe->wqe) >> wq->wqe_shift;
+               wqe = ntohl(cqe->wqe);
+               wqe_index = wqe >> wq->wqe_shift;
+               /*
+                * WQE addr == base - 1 might be reported in receive completion
+                * with error instead of (rq size - 1) by Sinai FW 1.0.800,
+                * Arbel FW 5.1.400 and should be fixed in later revisions.
+                */
+               if (wqe_index < 0)
+                       wqe_index = wq->max - 1;
                wc->wr_id = (*cur_qp)->wrid[wqe_index];
        }
 

-- 
MST

_______________________________________________
openib-general mailing list
[email protected]
http://openib.org/mailman/listinfo/openib-general

To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general

Reply via email to