Commit bb2af78b authored by Roland Dreier's avatar Roland Dreier Committed by Linus Torvalds

[PATCH] IB/mthca: Clean up CQ debug

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: default avatarRoland Dreier <roland@topspin.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 177214af
...@@ -172,6 +172,17 @@ static inline void set_cqe_hw(struct mthca_cqe *cqe) ...@@ -172,6 +172,17 @@ static inline void set_cqe_hw(struct mthca_cqe *cqe)
cqe->owner = MTHCA_CQ_ENTRY_OWNER_HW; 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 * incr is ignored in native Arbel (mem-free) mode, so cq->cons_index
* should be correct before calling update_cons_index(). * should be correct before calling update_cons_index().
...@@ -281,16 +292,12 @@ static int handle_error_cqe(struct mthca_dev *dev, struct mthca_cq *cq, ...@@ -281,16 +292,12 @@ static int handle_error_cqe(struct mthca_dev *dev, struct mthca_cq *cq,
int dbd; int dbd;
u32 new_wqe; u32 new_wqe;
if (1 && cqe->syndrome != SYNDROME_WR_FLUSH_ERR) { if (cqe->syndrome == SYNDROME_LOCAL_QP_OP_ERR) {
int j; mthca_dbg(dev, "local QP operation err "
"(QPN %06x, WQE @ %08x, CQN %06x, index %d)\n",
mthca_dbg(dev, "%x/%d: error CQE -> QPN %06x, WQE @ %08x\n", be32_to_cpu(cqe->my_qpn), be32_to_cpu(cqe->wqe),
cq->cqn, cq->cons_index, be32_to_cpu(cqe->my_qpn), cq->cqn, cq->cons_index);
be32_to_cpu(cqe->wqe)); dump_cqe(dev, cqe);
for (j = 0; j < 8; ++j)
printk(KERN_DEBUG " [%2x] %08x\n",
j * 4, be32_to_cpu(((u32 *) cqe)[j]));
} }
/* /*
...@@ -378,15 +385,6 @@ static int handle_error_cqe(struct mthca_dev *dev, struct mthca_cq *cq, ...@@ -378,15 +385,6 @@ static int handle_error_cqe(struct mthca_dev *dev, struct mthca_cq *cq,
return 0; 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, static inline int mthca_poll_one(struct mthca_dev *dev,
struct mthca_cq *cq, struct mthca_cq *cq,
struct mthca_qp **cur_qp, struct mthca_qp **cur_qp,
...@@ -415,8 +413,7 @@ static inline int mthca_poll_one(struct mthca_dev *dev, ...@@ -415,8 +413,7 @@ static inline int mthca_poll_one(struct mthca_dev *dev,
mthca_dbg(dev, "%x/%d: CQE -> QPN %06x, WQE @ %08x\n", mthca_dbg(dev, "%x/%d: CQE -> QPN %06x, WQE @ %08x\n",
cq->cqn, cq->cons_index, be32_to_cpu(cqe->my_qpn), cq->cqn, cq->cons_index, be32_to_cpu(cqe->my_qpn),
be32_to_cpu(cqe->wqe)); be32_to_cpu(cqe->wqe));
dump_cqe(dev, cqe);
dump_cqe(cqe);
} }
is_error = (cqe->opcode & MTHCA_ERROR_CQE_OPCODE_MASK) == is_error = (cqe->opcode & MTHCA_ERROR_CQE_OPCODE_MASK) ==
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment