From: Joachim Fenkes <fenkes@de.ibm.com>
To: "LinuxPPC-Dev" <linuxppc-dev@ozlabs.org>,
LKML <linux-kernel@vger.kernel.org>,
"OF-General" <general@lists.openfabrics.org>,
Roland Dreier <rolandd@cisco.com>
Cc: "Hoang-Nam Nguyen" <hnguyen@de.ibm.com>,
Christoph Raisch <raisch@de.ibm.com>,
Stefan Roscher <stefan.roscher@de.ibm.com>
Subject: [PATCH 11/13] IB/ehca: return QP pointer in poll_cq(), add two unlikely() statements
Date: Mon, 9 Jul 2007 15:31:53 +0200 [thread overview]
Message-ID: <200707091531.54219.fenkes@de.ibm.com> (raw)
In-Reply-To: <200707091502.22407.fenkes@de.ibm.com>
Signed-off-by: Joachim Fenkes <fenkes@de.ibm.com>
---
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 "
--
1.5.2
next prev parent reply other threads:[~2007-07-09 13:32 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-09 13:02 [PATCH 00/13] IB/ehca: eHCA2 enablement & some fixes Joachim Fenkes
2007-07-09 13:20 ` [PATCH 01/13] IB/ehca: change scaling_code parameter description to match default value Joachim Fenkes
2007-07-09 13:21 ` [PATCH 02/13] IB/ehca: HW level, HW caps and MTU autodetection Joachim Fenkes
2007-07-09 13:23 ` [PATCH 03/13] IB/ehca: QP code restructuring in preparation for SRQ Joachim Fenkes
2007-07-09 13:25 ` [PATCH 04/13] IB/ehca: add Shared Receive Queue support Joachim Fenkes
2007-07-09 13:26 ` [PATCH 05/13] IB/ehca: Support UD low latency QPs Joachim Fenkes
2007-07-09 13:27 ` [PATCH 06/13] IB/ehca: Set SEND_GRH flag for all non-LL UD QPs on eHCA2 Joachim Fenkes
2007-07-09 21:35 ` Roland Dreier
2007-07-10 11:26 ` Joachim Fenkes
2007-07-10 16:35 ` Christoph Raisch
2007-07-09 13:28 ` [PATCH 07/13] IB/ehca: Report RDMA atomic attributes in query_qp() Joachim Fenkes
2007-07-09 13:29 ` [PATCH 08/13] IB/ehca: Lock renaming, static initializers Joachim Fenkes
2007-07-09 21:38 ` Roland Dreier
2007-07-09 13:30 ` [PATCH 09/13] IB/ehca: Refactor synchronization between completions and destroy_cq using atomic_t Joachim Fenkes
2007-07-09 13:31 ` [PATCH 10/13] IB/ehca: Change idr spinlocks into rwlocks Joachim Fenkes
2007-07-09 13:31 ` Joachim Fenkes [this message]
2007-07-09 13:32 ` [PATCH 12/13] IB/ehca: notify consumers of LID/PKEY/SM changes after nondisruptive events Joachim Fenkes
2007-07-09 13:33 ` [PATCH 13/13] IB/ehca: Improve latency by unlocking the SQ/RQ after triggering the hardware Joachim Fenkes
2007-07-09 22:11 ` [PATCH 00/13] IB/ehca: eHCA2 enablement & some fixes Roland Dreier
2007-07-10 13:20 ` Joachim Fenkes
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200707091531.54219.fenkes@de.ibm.com \
--to=fenkes@de.ibm.com \
--cc=general@lists.openfabrics.org \
--cc=hnguyen@de.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@ozlabs.org \
--cc=raisch@de.ibm.com \
--cc=rolandd@cisco.com \
--cc=stefan.roscher@de.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox