diff options
author | Joachim Fenkes <fenkes@de.ibm.com> | 2007-07-09 09:31:53 -0400 |
---|---|---|
committer | Roland Dreier <rolandd@cisco.com> | 2007-07-09 23:12:27 -0400 |
commit | b1cfe43d4b24144596d277133e0e5b715eea1347 (patch) | |
tree | 1e18ebc7aac92ed6430b94a5bb980c01b263f1fd /drivers | |
parent | 26ed687fdd541c2542b79dcd75fb2c82eb36f189 (diff) |
IB/ehca: Return QP pointer in poll_cq()
Also add two unlikely() statements.
Signed-off-by: Joachim Fenkes <fenkes@de.ibm.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | 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 73f0c0652a00..fd3ba22467e8 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) | |||
517 | int ret = 0; | 517 | int ret = 0; |
518 | struct ehca_cq *my_cq = container_of(cq, struct ehca_cq, ib_cq); | 518 | struct ehca_cq *my_cq = container_of(cq, struct ehca_cq, ib_cq); |
519 | struct ehca_cqe *cqe; | 519 | struct ehca_cqe *cqe; |
520 | struct ehca_qp *my_qp; | ||
520 | int cqe_count = 0; | 521 | int cqe_count = 0; |
521 | 522 | ||
522 | poll_cq_one_read_cqe: | 523 | poll_cq_one_read_cqe: |
@@ -568,7 +569,7 @@ poll_cq_one_read_cqe: | |||
568 | } | 569 | } |
569 | 570 | ||
570 | /* tracing cqe */ | 571 | /* tracing cqe */ |
571 | if (ehca_debug_level) { | 572 | if (unlikely(ehca_debug_level)) { |
572 | ehca_dbg(cq->device, | 573 | ehca_dbg(cq->device, |
573 | "Received COMPLETION ehca_cq=%p cq_num=%x -----", | 574 | "Received COMPLETION ehca_cq=%p cq_num=%x -----", |
574 | my_cq, my_cq->cq_number); | 575 | my_cq, my_cq->cq_number); |
@@ -602,7 +603,11 @@ poll_cq_one_read_cqe: | |||
602 | } else | 603 | } else |
603 | wc->status = IB_WC_SUCCESS; | 604 | wc->status = IB_WC_SUCCESS; |
604 | 605 | ||
605 | wc->qp = NULL; | 606 | read_lock(&ehca_qp_idr_lock); |
607 | my_qp = idr_find(&ehca_qp_idr, cqe->qp_token); | ||
608 | wc->qp = &my_qp->ib_qp; | ||
609 | read_unlock(&ehca_qp_idr_lock); | ||
610 | |||
606 | wc->byte_len = cqe->nr_bytes_transferred; | 611 | wc->byte_len = cqe->nr_bytes_transferred; |
607 | wc->pkey_index = cqe->pkey_index; | 612 | wc->pkey_index = cqe->pkey_index; |
608 | wc->slid = cqe->rlid; | 613 | wc->slid = cqe->rlid; |
@@ -612,7 +617,7 @@ poll_cq_one_read_cqe: | |||
612 | wc->imm_data = cpu_to_be32(cqe->immediate_data); | 617 | wc->imm_data = cpu_to_be32(cqe->immediate_data); |
613 | wc->sl = cqe->service_level; | 618 | wc->sl = cqe->service_level; |
614 | 619 | ||
615 | if (wc->status != IB_WC_SUCCESS) | 620 | if (unlikely(wc->status != IB_WC_SUCCESS)) |
616 | ehca_dbg(cq->device, | 621 | ehca_dbg(cq->device, |
617 | "ehca_cq=%p cq_num=%x WARNING unsuccessful cqe " | 622 | "ehca_cq=%p cq_num=%x WARNING unsuccessful cqe " |
618 | "OPType=%x status=%x qp_num=%x src_qp=%x wr_id=%lx " | 623 | "OPType=%x status=%x qp_num=%x src_qp=%x wr_id=%lx " |