summaryrefslogtreecommitdiff
path: root/drivers/infiniband
diff options
context:
space:
mode:
authorMichael S. Tsirkin <mst@mellanox.co.il>2005-11-28 11:19:43 -0800
committerRoland Dreier <rolandd@cisco.com>2005-11-28 11:19:43 -0800
commit187a25863fe014486ee834164776b2a587d6934d (patch)
tree918111360e352d128126bb338227ec4fb6e8afbc /drivers/infiniband
parent458af5439fe7ae7d95ca14106844e61f0795166c (diff)
downloadlinux-3.10-187a25863fe014486ee834164776b2a587d6934d.tar.gz
linux-3.10-187a25863fe014486ee834164776b2a587d6934d.tar.bz2
linux-3.10-187a25863fe014486ee834164776b2a587d6934d.zip
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: Michael S. Tsirkin <mst@mellanox.co.il> Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband')
-rw-r--r--drivers/infiniband/hw/mthca/mthca_qp.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/infiniband/hw/mthca/mthca_qp.c b/drivers/infiniband/hw/mthca/mthca_qp.c
index dd4e13303e9..f9c8eb9845c 100644
--- a/drivers/infiniband/hw/mthca/mthca_qp.c
+++ b/drivers/infiniband/hw/mthca/mthca_qp.c
@@ -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;