aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Cohen <eli@mellanox.co.il>2007-06-11 14:43:26 -0700
committerRoland Dreier <rolandd@cisco.com>2007-06-11 14:43:26 -0700
commit919c3773f87dcd310a6dc02dd6112f844ab17353 (patch)
tree4ee433d6b807b3557857bce46a531c2723bc5658
parente7d065192e10851ce6a6506dbc5227f4dbaf8fcd (diff)
downloadlibmlx4-919c3773f87dcd310a6dc02dd6112f844ab17353.tar.gz
Fix handling of wq->tail for send completions
Cast the increment added to wq->tail when send completions are processed to uint16_t to avoid using wrong values caused by standard integer promotions. Signed-off-by: Eli Cohen <eli@mellanox.co.il> Signed-off-by: Roland Dreier <rolandd@cisco.com>
-rw-r--r--src/cq.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cq.c b/src/cq.c
index c4a3ca4..a1831ff 100644
--- a/src/cq.c
+++ b/src/cq.c
@@ -238,7 +238,7 @@ static int mlx4_poll_one(struct mlx4_cq *cq,
if (is_send) {
wq = &(*cur_qp)->sq;
wqe_index = ntohs(cqe->wqe_index);
- wq->tail += wqe_index - (uint16_t) wq->tail;
+ wq->tail += (uint16_t) (wqe_index - (uint16_t) wq->tail);
wc->wr_id = wq->wrid[wq->tail & (wq->max - 1)];
++wq->tail;
} else if ((*cur_qp)->ibv_qp.srq) {