diff options
author | Michael S. Tsirkin <mst@mellanox.co.il> | 2006-06-13 18:32:27 +0000 |
---|---|---|
committer | Roland Dreier <rolandd@cisco.com> | 2006-11-09 19:57:06 -0800 |
commit | 214f7c5737280e1b56c4c595c4f1469d70e1ef06 (patch) | |
tree | fd1ed1960bd9372a15327ffcdb2389168416e5bc | |
parent | eeaff909c0edf0870009c91762044c6fd1731ce7 (diff) | |
download | libmthca-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-- | ChangeLog | 5 | ||||
-rw-r--r-- | src/cq.c | 12 |
2 files changed, 16 insertions, 1 deletions
@@ -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 @@ -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]; } |