aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/cxgb4/cq.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/infiniband/hw/cxgb4/cq.c')
-rw-r--r--drivers/infiniband/hw/cxgb4/cq.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/drivers/infiniband/hw/cxgb4/cq.c b/drivers/infiniband/hw/cxgb4/cq.c
index b7bfc536e00f..6f2b26126c64 100644
--- a/drivers/infiniband/hw/cxgb4/cq.c
+++ b/drivers/infiniband/hw/cxgb4/cq.c
@@ -395,7 +395,7 @@ next_cqe:
395 395
396static int cqe_completes_wr(struct t4_cqe *cqe, struct t4_wq *wq) 396static int cqe_completes_wr(struct t4_cqe *cqe, struct t4_wq *wq)
397{ 397{
398 if (CQE_OPCODE(cqe) == C4IW_DRAIN_OPCODE) { 398 if (DRAIN_CQE(cqe)) {
399 WARN_ONCE(1, "Unexpected DRAIN CQE qp id %u!\n", wq->sq.qid); 399 WARN_ONCE(1, "Unexpected DRAIN CQE qp id %u!\n", wq->sq.qid);
400 return 0; 400 return 0;
401 } 401 }
@@ -494,7 +494,7 @@ static int poll_cq(struct t4_wq *wq, struct t4_cq *cq, struct t4_cqe *cqe,
494 /* 494 /*
495 * Special cqe for drain WR completions... 495 * Special cqe for drain WR completions...
496 */ 496 */
497 if (CQE_OPCODE(hw_cqe) == C4IW_DRAIN_OPCODE) { 497 if (DRAIN_CQE(hw_cqe)) {
498 *cookie = CQE_DRAIN_COOKIE(hw_cqe); 498 *cookie = CQE_DRAIN_COOKIE(hw_cqe);
499 *cqe = *hw_cqe; 499 *cqe = *hw_cqe;
500 goto skip_cqe; 500 goto skip_cqe;
@@ -571,10 +571,10 @@ static int poll_cq(struct t4_wq *wq, struct t4_cq *cq, struct t4_cqe *cqe,
571 ret = -EAGAIN; 571 ret = -EAGAIN;
572 goto skip_cqe; 572 goto skip_cqe;
573 } 573 }
574 if (unlikely((CQE_WRID_MSN(hw_cqe) != (wq->rq.msn)))) { 574 if (unlikely(!CQE_STATUS(hw_cqe) &&
575 CQE_WRID_MSN(hw_cqe) != wq->rq.msn)) {
575 t4_set_wq_in_error(wq); 576 t4_set_wq_in_error(wq);
576 hw_cqe->header |= htonl(CQE_STATUS_V(T4_ERR_MSN)); 577 hw_cqe->header |= cpu_to_be32(CQE_STATUS_V(T4_ERR_MSN));
577 goto proc_cqe;
578 } 578 }
579 goto proc_cqe; 579 goto proc_cqe;
580 } 580 }
@@ -748,9 +748,6 @@ static int c4iw_poll_cq_one(struct c4iw_cq *chp, struct ib_wc *wc)
748 c4iw_invalidate_mr(qhp->rhp, 748 c4iw_invalidate_mr(qhp->rhp,
749 CQE_WRID_FR_STAG(&cqe)); 749 CQE_WRID_FR_STAG(&cqe));
750 break; 750 break;
751 case C4IW_DRAIN_OPCODE:
752 wc->opcode = IB_WC_SEND;
753 break;
754 default: 751 default:
755 pr_err("Unexpected opcode %d in the CQE received for QPID=0x%0x\n", 752 pr_err("Unexpected opcode %d in the CQE received for QPID=0x%0x\n",
756 CQE_OPCODE(&cqe), CQE_QPID(&cqe)); 753 CQE_OPCODE(&cqe), CQE_QPID(&cqe));