diff options
author | Roland Dreier <rolandd@cisco.com> | 2005-10-18 16:31:54 +0000 |
---|---|---|
committer | Roland Dreier <rolandd@cisco.com> | 2006-11-09 19:57:03 -0800 |
commit | 0acfd5d0550d3b3615b7bc34fc312a8c92b53fa3 (patch) | |
tree | 60ae9360f3cf60b0df686071b86fdb5b594db6f0 | |
parent | 39bdf2edc09da8938a13759cb16b7ce69e54da8d (diff) | |
download | libmthca-0acfd5d0550d3b3615b7bc34fc312a8c92b53fa3.tar.gz |
Dump CQE only for local op errors
Only dump CQE contents on local QP operation error, rather than all
error statuses.
Signed-off-by: Roland Dreier <rolandd@cisco.com>
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | src/cq.c | 28 |
2 files changed, 22 insertions, 11 deletions
@@ -1,3 +1,8 @@ +2005-10-18 Roland Dreier <roland@cisco.com> + + * src/cq.c (handle_error_cqe, mthca_poll_one): Dump CQEs for local + QP operation errors instead of all error statuses. + 2005-10-06 Roland Dreier <roland@cisco.com> * src/srq.c (mthca_free_srq_wqe): Pass index instead of WQE @@ -161,6 +161,15 @@ static inline void update_cons_index(struct mthca_cq *cq, int incr) } } +static void dump_cqe(void *cqe_ptr) +{ + uint32_t *cqe = cqe_ptr; + int i; + + for (i = 0; i < 8; ++i) + printf(" [%2x] %08x\n", i * 4, ntohl(((uint32_t *) cqe)[i])); +} + static int handle_error_cqe(struct mthca_cq *cq, struct mthca_qp *qp, int wqe_index, int is_send, struct mthca_err_cqe *cqe, @@ -170,6 +179,14 @@ static int handle_error_cqe(struct mthca_cq *cq, int dbd; uint32_t new_wqe; + if (cqe->syndrome == SYNDROME_LOCAL_QP_OP_ERR) { + printf("local QP operation err " + "(QPN %06x, WQE @ %08x, CQN %06x, index %d)\n", + ntohl(cqe->my_qpn), ntohl(cqe->wqe), + cq->cqn, cq->cons_index); + dump_cqe(cqe); + } + /* * For completions in error, only work request ID, status (and * freed resource count for RD) have to be set. @@ -266,14 +283,6 @@ static int handle_error_cqe(struct mthca_cq *cq, return 0; } -static void dump_cqe(struct mthca_cqe *cqe) -{ - int j; - - for (j = 0; j < 8; ++j) - printf(" [%2x] %08x\n", j * 4, ntohl(((uint32_t *) cqe)[j])); -} - static inline int mthca_poll_one(struct mthca_cq *cq, struct mthca_qp **cur_qp, int *freed, @@ -306,9 +315,6 @@ static inline int mthca_poll_one(struct mthca_cq *cq, MTHCA_ERROR_CQE_OPCODE_MASK; is_send = is_error ? cqe->opcode & 0x01 : cqe->is_send & 0x80; - if (is_error) - dump_cqe(cqe); - if (!*cur_qp || ntohl(cqe->my_qpn) != (*cur_qp)->ibv_qp.qp_num) { /* * We do not have to take the QP table lock here, |