--- /home/kernels/infiniband/hw/mthca/mthca_qp.c	2005-05-23 16:51:13.000000000 -0700
+++ drivers/infiniband/hw/mthca/mthca_qp.c	2005-05-25 11:52:48.000000000 -0700
@@ -1495,6 +1495,18 @@
 	return cur + nreq >= wq->max;
 }
 
+void mthca_dump_qp(struct ib_qp *ibqp)
+{
+	struct mthca_dev *dev = to_mdev(ibqp->device);
+	struct mthca_qp *qp = to_mqp(ibqp);
+
+	mthca_err(dev, "SQ %06x (%u head, %u tail," " %d max)\n",
+		qp->qpn, qp->sq.head, qp->sq.tail, qp->sq.max);
+	mthca_err(dev, "RQ %06x (%u head, %u tail," " %d max\n",
+		qp->qpn, qp->rq.head, qp->rq.tail, qp->rq.max);
+}
+EXPORT_SYMBOL(mthca_dump_qp);
+
 int mthca_tavor_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr,
 			  struct ib_send_wr **bad_wr)
 {
