[openib-general] [PATCH] mthca: missing cleanup in reset state

Michael S. Tsirkin mst at mellanox.co.il
Mon Nov 21 07:39:13 PST 2005


Hello, Roland!
The following patch fixes system hangs I am sometimes seeing when
ipoib is brought down and back up.

Should something similiar be done in libmthca?

Thanks,
MST

---

mthca: last pointer was not updated when qp was modified to reset state.
This causes data corruption if wqes were already posted on the queue.

Signed-off-by: Michael S. Tsirkin <mst at mellanox.co.il>

Index: latest/drivers/infiniband/hw/mthca/mthca_qp.c
===================================================================
--- latest.orig/drivers/infiniband/hw/mthca/mthca_qp.c
+++ latest/drivers/infiniband/hw/mthca/mthca_qp.c
@@ -869,7 +869,10 @@ int mthca_modify_qp(struct ib_qp *ibqp, 
 				       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;

-- 
MST



More information about the general mailing list