aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband
diff options
context:
space:
mode:
authorRoland Dreier <roland@topspin.com>2005-06-27 17:36:39 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-06-27 18:11:44 -0400
commitbb2af78bcdbb8801791de33f1775c98b9178daab (patch)
treef745494c98c15af14958e7c6b32f86700847187d /drivers/infiniband
parent177214af2946e86ce89324f379720ec0dc8d4a9e (diff)
[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: Roland Dreier <roland@topspin.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/infiniband')
-rw-r--r--drivers/infiniband/hw/mthca/mthca_cq.c39
1 files changed, 18 insertions, 21 deletions
diff --git a/drivers/infiniband/hw/mthca/mthca_cq.c b/drivers/infiniband/hw/mthca/mthca_cq.c
index 608d09f55215..3724d9db50a3 100644
--- a/drivers/infiniband/hw/mthca/mthca_cq.c
+++ b/drivers/infiniband/hw/mthca/mthca_cq.c
@@ -172,6 +172,17 @@ static inline void set_cqe_hw(struct mthca_cqe *cqe)
172 cqe->owner = MTHCA_CQ_ENTRY_OWNER_HW; 172 cqe->owner = MTHCA_CQ_ENTRY_OWNER_HW;
173} 173}
174 174
175static void dump_cqe(struct mthca_dev *dev, void *cqe_ptr)
176{
177 __be32 *cqe = cqe_ptr;
178
179 (void) cqe; /* avoid warning if mthca_dbg compiled away... */
180 mthca_dbg(dev, "CQE contents %08x %08x %08x %08x %08x %08x %08x %08x\n",
181 be32_to_cpu(cqe[0]), be32_to_cpu(cqe[1]), be32_to_cpu(cqe[2]),
182 be32_to_cpu(cqe[3]), be32_to_cpu(cqe[4]), be32_to_cpu(cqe[5]),
183 be32_to_cpu(cqe[6]), be32_to_cpu(cqe[7]));
184}
185
175/* 186/*
176 * incr is ignored in native Arbel (mem-free) mode, so cq->cons_index 187 * incr is ignored in native Arbel (mem-free) mode, so cq->cons_index
177 * should be correct before calling update_cons_index(). 188 * 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 int dbd; 292 int dbd;
282 u32 new_wqe; 293 u32 new_wqe;
283 294
284 if (1 && cqe->syndrome != SYNDROME_WR_FLUSH_ERR) { 295 if (cqe->syndrome == SYNDROME_LOCAL_QP_OP_ERR) {
285 int j; 296 mthca_dbg(dev, "local QP operation err "
286 297 "(QPN %06x, WQE @ %08x, CQN %06x, index %d)\n",
287 mthca_dbg(dev, "%x/%d: error CQE -> QPN %06x, WQE @ %08x\n", 298 be32_to_cpu(cqe->my_qpn), be32_to_cpu(cqe->wqe),
288 cq->cqn, cq->cons_index, be32_to_cpu(cqe->my_qpn), 299 cq->cqn, cq->cons_index);
289 be32_to_cpu(cqe->wqe)); 300 dump_cqe(dev, cqe);
290
291 for (j = 0; j < 8; ++j)
292 printk(KERN_DEBUG " [%2x] %08x\n",
293 j * 4, be32_to_cpu(((u32 *) cqe)[j]));
294 } 301 }
295 302
296 /* 303 /*
@@ -378,15 +385,6 @@ static int handle_error_cqe(struct mthca_dev *dev, struct mthca_cq *cq,
378 return 0; 385 return 0;
379} 386}
380 387
381static void dump_cqe(struct mthca_cqe *cqe)
382{
383 int j;
384
385 for (j = 0; j < 8; ++j)
386 printk(KERN_DEBUG " [%2x] %08x\n",
387 j * 4, be32_to_cpu(((u32 *) cqe)[j]));
388}
389
390static inline int mthca_poll_one(struct mthca_dev *dev, 388static inline int mthca_poll_one(struct mthca_dev *dev,
391 struct mthca_cq *cq, 389 struct mthca_cq *cq,
392 struct mthca_qp **cur_qp, 390 struct mthca_qp **cur_qp,
@@ -415,8 +413,7 @@ static inline int mthca_poll_one(struct mthca_dev *dev,
415 mthca_dbg(dev, "%x/%d: CQE -> QPN %06x, WQE @ %08x\n", 413 mthca_dbg(dev, "%x/%d: CQE -> QPN %06x, WQE @ %08x\n",
416 cq->cqn, cq->cons_index, be32_to_cpu(cqe->my_qpn), 414 cq->cqn, cq->cons_index, be32_to_cpu(cqe->my_qpn),
417 be32_to_cpu(cqe->wqe)); 415 be32_to_cpu(cqe->wqe));
418 416 dump_cqe(dev, cqe);
419 dump_cqe(cqe);
420 } 417 }
421 418
422 is_error = (cqe->opcode & MTHCA_ERROR_CQE_OPCODE_MASK) == 419 is_error = (cqe->opcode & MTHCA_ERROR_CQE_OPCODE_MASK) ==