Commit:     30c00986f3a610cdcee2602b8254c3ffa6cddc04
Parent:     532c3b581725e2c6480a20c845fff920690286f1
Author:     Roland Dreier <[EMAIL PROTECTED]>
AuthorDate: Tue Apr 24 16:31:11 2007 -0700
Committer:  Roland Dreier <[EMAIL PROTECTED]>
CommitDate: Tue Apr 24 16:31:11 2007 -0700

    IB/mthca: Simplify CQ cleaning in mthca_free_qp()
    mthca_free_qp() already has local variables to hold the QP's send_cq
    and recv_cq, so we can slightly clean up the calls to mthca_cq_clean()
    by using those local variables instead of expressions like
    Also, by cleaning the recv_cq first, we can avoid worrying about
    whether the QP is attached to an SRQ for the second call, because we
    would only clean send_cq if send_cq is not equal to recv_cq, and that
    means send_cq cannot have any receive completions from the QP being
    All this work even improves the generated code a bit:
    add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-5 (-5)
    function                                     old     new   delta
    mthca_free_qp                                510     505      -5
    Signed-off-by: Roland Dreier <[EMAIL PROTECTED]>
 drivers/infiniband/hw/mthca/mthca_qp.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/infiniband/hw/mthca/mthca_qp.c 
index 1c6b63a..8fe6fee 100644
--- a/drivers/infiniband/hw/mthca/mthca_qp.c
+++ b/drivers/infiniband/hw/mthca/mthca_qp.c
@@ -1419,11 +1419,10 @@ void mthca_free_qp(struct mthca_dev *dev,
         * unref the mem-free tables and free the QPN in our table.
        if (!qp->ibqp.uobject) {
-               mthca_cq_clean(dev, to_mcq(qp->ibqp.send_cq), qp->qpn,
+               mthca_cq_clean(dev, recv_cq, qp->qpn,
                               qp->ibqp.srq ? to_msrq(qp->ibqp.srq) : NULL);
-               if (qp->ibqp.send_cq != qp->ibqp.recv_cq)
-                       mthca_cq_clean(dev, to_mcq(qp->ibqp.recv_cq), qp->qpn,
-                                      qp->ibqp.srq ? to_msrq(qp->ibqp.srq) : 
+               if (send_cq != recv_cq)
+                       mthca_cq_clean(dev, send_cq, qp->qpn, NULL);
                mthca_free_memfree(dev, qp);
                mthca_free_wqe_buf(dev, qp);
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at

Reply via email to