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.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/drivers/infiniband/hw/cxgb4/cq.c b/drivers/infiniband/hw/cxgb4/cq.c
index 19c6477af19f..bec82a600d77 100644
--- a/drivers/infiniband/hw/cxgb4/cq.c
+++ b/drivers/infiniband/hw/cxgb4/cq.c
@@ -505,6 +505,15 @@ static int poll_cq(struct t4_wq *wq, struct t4_cq *cq, struct t4_cqe *cqe,
505 } 505 }
506 506
507 /* 507 /*
508 * Special cqe for drain WR completions...
509 */
510 if (CQE_OPCODE(hw_cqe) == C4IW_DRAIN_OPCODE) {
511 *cookie = CQE_DRAIN_COOKIE(hw_cqe);
512 *cqe = *hw_cqe;
513 goto skip_cqe;
514 }
515
516 /*
508 * Gotta tweak READ completions: 517 * Gotta tweak READ completions:
509 * 1) the cqe doesn't contain the sq_wptr from the wr. 518 * 1) the cqe doesn't contain the sq_wptr from the wr.
510 * 2) opcode not reflected from the wr. 519 * 2) opcode not reflected from the wr.
@@ -753,6 +762,9 @@ static int c4iw_poll_cq_one(struct c4iw_cq *chp, struct ib_wc *wc)
753 c4iw_invalidate_mr(qhp->rhp, 762 c4iw_invalidate_mr(qhp->rhp,
754 CQE_WRID_FR_STAG(&cqe)); 763 CQE_WRID_FR_STAG(&cqe));
755 break; 764 break;
765 case C4IW_DRAIN_OPCODE:
766 wc->opcode = IB_WC_SEND;
767 break;
756 default: 768 default:
757 printk(KERN_ERR MOD "Unexpected opcode %d " 769 printk(KERN_ERR MOD "Unexpected opcode %d "
758 "in the CQE received for QPID=0x%0x\n", 770 "in the CQE received for QPID=0x%0x\n",
@@ -817,15 +829,8 @@ static int c4iw_poll_cq_one(struct c4iw_cq *chp, struct ib_wc *wc)
817 } 829 }
818 } 830 }
819out: 831out:
820 if (wq) { 832 if (wq)
821 if (unlikely(qhp->attr.state != C4IW_QP_STATE_RTS)) {
822 if (t4_sq_empty(wq))
823 complete(&qhp->sq_drained);
824 if (t4_rq_empty(wq))
825 complete(&qhp->rq_drained);
826 }
827 spin_unlock(&qhp->lock); 833 spin_unlock(&qhp->lock);
828 }
829 return ret; 834 return ret;
830} 835}
831 836