[openib-general] [PATCH updated] libmthca: memfree completion with error
Michael S. Tsirkin
mst at mellanox.co.il
Tue Jun 13 07:19:55 PDT 2006
Same thing for userspace.
---
Fix up completion with error for memfree.
Signed-off-by: Michael S. Tsirkin <mst at mellanox.co.il>
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
More information about the general
mailing list