From: Roland Dreier <roland@topspin.com>
To: akpm@osdl.org
Cc: linux-kernel@vger.kernel.org, openib-general@openib.org
Subject: [PATCH 03/14] IB/mthca: Clean up CQ debug
Date: Thu, 23 Jun 2005 21:04:20 -0700 [thread overview]
Message-ID: <2005623214.Zy3c64TeILEv3G5E@topspin.com> (raw)
In-Reply-To: <2005623214.mXu9RTJT2MIk7KOo@topspin.com>
Clean up CQ debugging code: make dump_cqe print on one line, and only
dump error CQ entries for local operation errors.
Signed-off-by: Roland Dreier <roland@topspin.com>
---
linux.git/drivers/infiniband/hw/mthca/mthca_cq.c | 39 +++++++++++++++------------------
1 files changed, 18 insertions(+), 21 deletions(-)
--- linux.git.orig/drivers/infiniband/hw/mthca/mthca_cq.c 2005-06-23 13:03:02.629547920 -0700
+++ linux.git/drivers/infiniband/hw/mthca/mthca_cq.c 2005-06-23 13:03:04.326180727 -0700
@@ -172,6 +172,17 @@ static inline void set_cqe_hw(struct mth
cqe->owner = MTHCA_CQ_ENTRY_OWNER_HW;
}
+static void dump_cqe(struct mthca_dev *dev, void *cqe_ptr)
+{
+ __be32 *cqe = cqe_ptr;
+
+ (void) cqe; /* avoid warning if mthca_dbg compiled away... */
+ mthca_dbg(dev, "CQE contents %08x %08x %08x %08x %08x %08x %08x %08x\n",
+ be32_to_cpu(cqe[0]), be32_to_cpu(cqe[1]), be32_to_cpu(cqe[2]),
+ be32_to_cpu(cqe[3]), be32_to_cpu(cqe[4]), be32_to_cpu(cqe[5]),
+ be32_to_cpu(cqe[6]), be32_to_cpu(cqe[7]));
+}
+
/*
* incr is ignored in native Arbel (mem-free) mode, so cq->cons_index
* should be correct before calling update_cons_index().
@@ -281,16 +292,12 @@ static int handle_error_cqe(struct mthca
int dbd;
u32 new_wqe;
- if (1 && cqe->syndrome != SYNDROME_WR_FLUSH_ERR) {
- int j;
-
- mthca_dbg(dev, "%x/%d: error CQE -> QPN %06x, WQE @ %08x\n",
- cq->cqn, cq->cons_index, be32_to_cpu(cqe->my_qpn),
- be32_to_cpu(cqe->wqe));
-
- for (j = 0; j < 8; ++j)
- printk(KERN_DEBUG " [%2x] %08x\n",
- j * 4, be32_to_cpu(((u32 *) cqe)[j]));
+ if (cqe->syndrome == SYNDROME_LOCAL_QP_OP_ERR) {
+ mthca_dbg(dev, "local QP operation err "
+ "(QPN %06x, WQE @ %08x, CQN %06x, index %d)\n",
+ be32_to_cpu(cqe->my_qpn), be32_to_cpu(cqe->wqe),
+ cq->cqn, cq->cons_index);
+ dump_cqe(dev, cqe);
}
/*
@@ -378,15 +385,6 @@ static int handle_error_cqe(struct mthca
return 0;
}
-static void dump_cqe(struct mthca_cqe *cqe)
-{
- int j;
-
- for (j = 0; j < 8; ++j)
- printk(KERN_DEBUG " [%2x] %08x\n",
- j * 4, be32_to_cpu(((u32 *) cqe)[j]));
-}
-
static inline int mthca_poll_one(struct mthca_dev *dev,
struct mthca_cq *cq,
struct mthca_qp **cur_qp,
@@ -415,8 +413,7 @@ static inline int mthca_poll_one(struct
mthca_dbg(dev, "%x/%d: CQE -> QPN %06x, WQE @ %08x\n",
cq->cqn, cq->cons_index, be32_to_cpu(cqe->my_qpn),
be32_to_cpu(cqe->wqe));
-
- dump_cqe(cqe);
+ dump_cqe(dev, cqe);
}
is_error = (cqe->opcode & MTHCA_ERROR_CQE_OPCODE_MASK) ==
next prev parent reply other threads:[~2005-06-24 4:08 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-06-24 4:04 [PATCH 00/14] IB/mthca: merge Roland Dreier
2005-06-24 4:04 ` [PATCH 01/14] IB/mthca: Add Sun copyright notice Roland Dreier
2005-06-24 4:04 ` [PATCH 02/14] IB/mthca: Clean up error messages Roland Dreier
2005-06-24 4:04 ` Roland Dreier [this message]
2005-06-24 4:04 ` [PATCH 04/14] IB/mthca: Use dma_alloc_coherent instead of pci_alloc_consistent Roland Dreier
2005-06-24 4:04 ` [PATCH 05/14] IB/mthca: Set QP static rate correctly Roland Dreier
2005-06-24 4:04 ` [PATCH 06/14] IB/mthca: Set RDMA/atomic capabilities correctly Roland Dreier
2005-06-24 4:04 ` [PATCH 07/14] IB/mthca: Enable unreliable connected transport Roland Dreier
2005-06-24 4:04 ` [PATCH 08/14] IB/mthca: Fix memset size Roland Dreier
2005-06-24 4:04 ` [PATCH 09/14] IB/mthca: Move mthca_is_memfree checks Roland Dreier
2005-06-24 4:04 ` [PATCH 10/14] IB/mthca: Split off MTT allocation Roland Dreier
2005-06-24 4:04 ` [PATCH 11/14] IB/mthca: Fix memory leak on error path Roland Dreier
2005-06-24 4:04 ` [PATCH 12/14] IB/mthca: Encapsulate command interface init Roland Dreier
2005-06-24 4:04 ` [PATCH 13/14] IB/mthca: Align FW command mailboxes to 4K Roland Dreier
2005-06-24 4:04 ` [PATCH 14/14] IB/mthca: Bump version Roland Dreier
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=2005623214.Zy3c64TeILEv3G5E@topspin.com \
--to=roland@topspin.com \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=openib-general@openib.org \
/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
all inboxes | Powered by JetHome®