Skip to content

Commit

Permalink
IB/mthca: reset QP's last pointers when transitioning to reset state
Browse files Browse the repository at this point in the history
last pointer is not updated when QP is modified to reset state.  This
causes data corruption if WQEs are already posted on the queue.

Signed-off-by: Michael S. Tsirkin <mst@mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
  • Loading branch information
Michael S. Tsirkin authored and Roland Dreier committed Nov 28, 2005
1 parent 458af54 commit 187a258
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/infiniband/hw/mthca/mthca_qp.c
Original file line number Diff line number Diff line change
Expand Up @@ -871,7 +871,10 @@ int mthca_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr, int attr_mask)
qp->ibqp.srq ? to_msrq(qp->ibqp.srq) : NULL);

mthca_wq_init(&qp->sq);
qp->sq.last = get_send_wqe(qp, qp->sq.max - 1);

mthca_wq_init(&qp->rq);
qp->rq.last = get_recv_wqe(qp, qp->rq.max - 1);

if (mthca_is_memfree(dev)) {
*qp->sq.db = 0;
Expand Down

0 comments on commit 187a258

Please sign in to comment.