aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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) ==