aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband
diff options
context:
space:
mode:
authorRoland Dreier <roland@eddore.topspincom.com>2005-08-19 12:19:05 -0400
committerRoland Dreier <rolandd@cisco.com>2005-08-26 23:37:37 -0400
commit288bdeb4bc5b89befd7ee2f0f0183604034ff6c5 (patch)
treef7b41185acd11fb7e0daf66f7b771621bd604159 /drivers/infiniband
parent87b816706bb2b79fbaff8e0b8e279e783273383e (diff)
[PATCH] IB/mthca: Simplify handling of completions with error
Mem-free HCAs never generate error CQEs that complete multiple WQEs, so just skip the call to mthca_free_err_wqe() for them rather than having logic to handle the mem-free case in mthca_free_err_wqe(). Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband')
-rw-r--r--drivers/infiniband/hw/mthca/mthca_cq.c13
-rw-r--r--drivers/infiniband/hw/mthca/mthca_qp.c5
2 files changed, 9 insertions, 9 deletions
diff --git a/drivers/infiniband/hw/mthca/mthca_cq.c b/drivers/infiniband/hw/mthca/mthca_cq.c
index 8afb9ee2fbc6..5dee908c2f34 100644
--- a/drivers/infiniband/hw/mthca/mthca_cq.c
+++ b/drivers/infiniband/hw/mthca/mthca_cq.c
@@ -367,6 +367,13 @@ static int handle_error_cqe(struct mthca_dev *dev, struct mthca_cq *cq,
367 break; 367 break;
368 } 368 }
369 369
370 /*
371 * Mem-free HCAs always generate one CQE per WQE, even in the
372 * error case, so we don't have to check the doorbell count, etc.
373 */
374 if (mthca_is_memfree(dev))
375 return 0;
376
370 err = mthca_free_err_wqe(dev, qp, is_send, wqe_index, &dbd, &new_wqe); 377 err = mthca_free_err_wqe(dev, qp, is_send, wqe_index, &dbd, &new_wqe);
371 if (err) 378 if (err)
372 return err; 379 return err;
@@ -375,12 +382,8 @@ static int handle_error_cqe(struct mthca_dev *dev, struct mthca_cq *cq,
375 * If we're at the end of the WQE chain, or we've used up our 382 * If we're at the end of the WQE chain, or we've used up our
376 * doorbell count, free the CQE. Otherwise just update it for 383 * doorbell count, free the CQE. Otherwise just update it for
377 * the next poll operation. 384 * the next poll operation.
378 *
379 * This does not apply to mem-free HCAs: they don't use the
380 * doorbell count field, and so we should always free the CQE.
381 */ 385 */
382 if (mthca_is_memfree(dev) || 386 if (!(new_wqe & cpu_to_be32(0x3f)) || (!cqe->db_cnt && dbd))
383 !(new_wqe & cpu_to_be32(0x3f)) || (!cqe->db_cnt && dbd))
384 return 0; 387 return 0;
385 388
386 cqe->db_cnt = cpu_to_be16(be16_to_cpu(cqe->db_cnt) - dbd); 389 cqe->db_cnt = cpu_to_be16(be16_to_cpu(cqe->db_cnt) - dbd);
diff --git a/drivers/infiniband/hw/mthca/mthca_qp.c b/drivers/infiniband/hw/mthca/mthca_qp.c
index b5a0bef15b7e..43af076acd5f 100644
--- a/drivers/infiniband/hw/mthca/mthca_qp.c
+++ b/drivers/infiniband/hw/mthca/mthca_qp.c
@@ -2086,10 +2086,7 @@ int mthca_free_err_wqe(struct mthca_dev *dev, struct mthca_qp *qp, int is_send,
2086 else 2086 else
2087 next = get_recv_wqe(qp, index); 2087 next = get_recv_wqe(qp, index);
2088 2088
2089 if (mthca_is_memfree(dev)) 2089 *dbd = !!(next->ee_nds & cpu_to_be32(MTHCA_NEXT_DBD));
2090 *dbd = 1;
2091 else
2092 *dbd = !!(next->ee_nds & cpu_to_be32(MTHCA_NEXT_DBD));
2093 if (next->ee_nds & cpu_to_be32(0x3f)) 2090 if (next->ee_nds & cpu_to_be32(0x3f))
2094 *new_wqe = (next->nda_op & cpu_to_be32(~0x3f)) | 2091 *new_wqe = (next->nda_op & cpu_to_be32(~0x3f)) |
2095 (next->ee_nds & cpu_to_be32(0x3f)); 2092 (next->ee_nds & cpu_to_be32(0x3f));