aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/mlx4/cq.c
diff options
context:
space:
mode:
authorRoland Dreier <rolandd@cisco.com>2007-06-12 13:50:42 -0400
committerRoland Dreier <rolandd@cisco.com>2007-06-12 13:50:42 -0400
commit614c3c85b5b4c3776439d464939c123cce679dee (patch)
tree9e25ae6a6752eb32c31dfe9d0b55c79b90385fc6 /drivers/infiniband/hw/mlx4/cq.c
parent99f9f3d49cbc7d944476f6fde53a77ec789ab2aa (diff)
IB/mlx4: Fix handling of wq->tail for send completions
Cast the increment added to wq->tail when send completions are processed to u16 to avoid using wrong values caused by standard integer promotions. The same bug was fixed in libmlx4 by Eli Cohen <eli@mellanox.co.il>. Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband/hw/mlx4/cq.c')
-rw-r--r--drivers/infiniband/hw/mlx4/cq.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/infiniband/hw/mlx4/cq.c b/drivers/infiniband/hw/mlx4/cq.c
index b2a290c6703a..048c5274ab1c 100644
--- a/drivers/infiniband/hw/mlx4/cq.c
+++ b/drivers/infiniband/hw/mlx4/cq.c
@@ -354,7 +354,7 @@ static int mlx4_ib_poll_one(struct mlx4_ib_cq *cq,
354 if (is_send) { 354 if (is_send) {
355 wq = &(*cur_qp)->sq; 355 wq = &(*cur_qp)->sq;
356 wqe_ctr = be16_to_cpu(cqe->wqe_index); 356 wqe_ctr = be16_to_cpu(cqe->wqe_index);
357 wq->tail += wqe_ctr - (u16) wq->tail; 357 wq->tail += (u16) (wqe_ctr - (u16) wq->tail);
358 wc->wr_id = wq->wrid[wq->tail & (wq->max - 1)]; 358 wc->wr_id = wq->wrid[wq->tail & (wq->max - 1)];
359 ++wq->tail; 359 ++wq->tail;
360 } else if ((*cur_qp)->ibqp.srq) { 360 } else if ((*cur_qp)->ibqp.srq) {