Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 187a2586 authored by Michael S. Tsirkin's avatar Michael S. Tsirkin Committed by Roland Dreier
Browse files

IB/mthca: reset QP's last pointers when transitioning to reset state



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: default avatarMichael S. Tsirkin <mst@mellanox.co.il>
Signed-off-by: default avatarRoland Dreier <rolandd@cisco.com>
parent 458af543
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -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;