aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael S. Tsirkin <mst@mellanox.co.il>2006-06-13 18:32:27 +0000
committerRoland Dreier <rolandd@cisco.com>2006-11-09 19:57:06 -0800
commit214f7c5737280e1b56c4c595c4f1469d70e1ef06 (patch)
treefd1ed1960bd9372a15327ffcdb2389168416e5bc
parenteeaff909c0edf0870009c91762044c6fd1731ce7 (diff)
downloadlibmthca-214f7c5737280e1b56c4c595c4f1469d70e1ef06.tar.gz
Fix up completion with error for memfree
Signed-off-by: Michael S. Tsirkin <mst@mellanox.co.il> Signed-off-by: Roland Dreier <rolandd@cisco.com>
-rw-r--r--ChangeLog5
-rw-r--r--src/cq.c12
2 files changed, 16 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 5b3237d..df58af0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2006-06-13 Michael S. Tsirkin <mst@mellanox.co.il>
+
+ * src/cq.c (mthca_poll_one): Add workaround for MemFree FW bug
+ that causes wrong WQE addr to be reported.
+
2006-05-24 Roland Dreier <rdreier@cisco.com>
* src/mthca.c: If <sysfs/libsysfs.h> is detected, include it
diff --git a/src/cq.c b/src/cq.c
index 935fa27..56acb76 100644
--- a/src/cq.c
+++ b/src/cq.c
@@ -347,8 +347,18 @@ static inline int mthca_poll_one(struct mthca_cq *cq,
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 by Sinai FW
+ * 1.0.800 and Arbel FW 5.1.400 in receive completion
+ * with error instead of (rq size - 1). This bug
+ * should be fixed in later FW revisions.
+ */
+ if (wqe_index < 0)
+ wqe_index = wq->max - 1;
wc->wr_id = (*cur_qp)->wrid[wqe_index];
}