Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=b1cfe43d4b24144596d277133e0e5b715eea1347
Commit:     b1cfe43d4b24144596d277133e0e5b715eea1347
Parent:     26ed687fdd541c2542b79dcd75fb2c82eb36f189
Author:     Joachim Fenkes <[EMAIL PROTECTED]>
AuthorDate: Mon Jul 9 15:31:53 2007 +0200
Committer:  Roland Dreier <[EMAIL PROTECTED]>
CommitDate: Mon Jul 9 20:12:27 2007 -0700

    IB/ehca: Return QP pointer in poll_cq()
    
    Also add two unlikely() statements.
    
    Signed-off-by: Joachim Fenkes <[EMAIL PROTECTED]>
    Signed-off-by: Roland Dreier <[EMAIL PROTECTED]>
---
 drivers/infiniband/hw/ehca/ehca_reqs.c |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/drivers/infiniband/hw/ehca/ehca_reqs.c 
b/drivers/infiniband/hw/ehca/ehca_reqs.c
index 73f0c06..fd3ba22 100644
--- a/drivers/infiniband/hw/ehca/ehca_reqs.c
+++ b/drivers/infiniband/hw/ehca/ehca_reqs.c
@@ -517,6 +517,7 @@ static inline int ehca_poll_cq_one(struct ib_cq *cq, struct 
ib_wc *wc)
        int ret = 0;
        struct ehca_cq *my_cq = container_of(cq, struct ehca_cq, ib_cq);
        struct ehca_cqe *cqe;
+       struct ehca_qp *my_qp;
        int cqe_count = 0;
 
 poll_cq_one_read_cqe:
@@ -568,7 +569,7 @@ poll_cq_one_read_cqe:
        }
 
        /* tracing cqe */
-       if (ehca_debug_level) {
+       if (unlikely(ehca_debug_level)) {
                ehca_dbg(cq->device,
                         "Received COMPLETION ehca_cq=%p cq_num=%x -----",
                         my_cq, my_cq->cq_number);
@@ -602,7 +603,11 @@ poll_cq_one_read_cqe:
        } else
                wc->status = IB_WC_SUCCESS;
 
-       wc->qp = NULL;
+       read_lock(&ehca_qp_idr_lock);
+       my_qp = idr_find(&ehca_qp_idr, cqe->qp_token);
+       wc->qp = &my_qp->ib_qp;
+       read_unlock(&ehca_qp_idr_lock);
+
        wc->byte_len = cqe->nr_bytes_transferred;
        wc->pkey_index = cqe->pkey_index;
        wc->slid = cqe->rlid;
@@ -612,7 +617,7 @@ poll_cq_one_read_cqe:
        wc->imm_data = cpu_to_be32(cqe->immediate_data);
        wc->sl = cqe->service_level;
 
-       if (wc->status != IB_WC_SUCCESS)
+       if (unlikely(wc->status != IB_WC_SUCCESS))
                ehca_dbg(cq->device,
                         "ehca_cq=%p cq_num=%x WARNING unsuccessful cqe "
                         "OPType=%x status=%x qp_num=%x src_qp=%x wr_id=%lx "
-
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  http://vger.kernel.org/majordomo-info.html

Reply via email to