Lines Matching refs:cq
42 static void insert_recv_cqe(struct t4_wq *wq, struct t4_cq *cq) in insert_recv_cqe() argument
47 wq, cq, cq->sw_cidx, cq->sw_pidx); in insert_recv_cqe()
54 cqe.bits_type_ts = htobe64(V_CQE_GENBIT((u64)cq->gen)); in insert_recv_cqe()
55 cq->sw_queue[cq->sw_pidx] = cqe; in insert_recv_cqe()
56 t4_swcq_produce(cq); in insert_recv_cqe()
59 int c4iw_flush_rq(struct t4_wq *wq, struct t4_cq *cq, int count) in c4iw_flush_rq() argument
66 wq, cq, wq->rq.in_use, count); in c4iw_flush_rq()
68 insert_recv_cqe(wq, cq); in c4iw_flush_rq()
74 static void insert_sq_cqe(struct t4_wq *wq, struct t4_cq *cq, in insert_sq_cqe() argument
80 wq, cq, cq->sw_cidx, cq->sw_pidx); in insert_sq_cqe()
88 cqe.bits_type_ts = htobe64(V_CQE_GENBIT((u64)cq->gen)); in insert_sq_cqe()
89 cq->sw_queue[cq->sw_pidx] = cqe; in insert_sq_cqe()
90 t4_swcq_produce(cq); in insert_sq_cqe()
100 struct t4_cq *cq = &chp->cq; in c4iw_flush_sq() local
112 insert_sq_cqe(wq, cq, swsqe); in c4iw_flush_sq()
126 static void flush_completed_wrs(struct t4_wq *wq, struct t4_cq *cq) in flush_completed_wrs() argument
149 __func__, cidx, cq->sw_pidx); in flush_completed_wrs()
152 cq->sw_queue[cq->sw_pidx] = swsqe->cqe; in flush_completed_wrs()
153 t4_swcq_produce(cq); in flush_completed_wrs()
205 PDBG("%s cqid 0x%x\n", __func__, chp->cq.cqid); in c4iw_flush_hw_cq()
206 ret = t4_next_hw_cqe(&chp->cq, &hw_cqe); in c4iw_flush_hw_cq()
271 flush_completed_wrs(&qhp->wq, &chp->cq); in c4iw_flush_hw_cq()
273 swcqe = &chp->cq.sw_queue[chp->cq.sw_pidx]; in c4iw_flush_hw_cq()
276 t4_swcq_produce(&chp->cq); in c4iw_flush_hw_cq()
279 t4_hwcq_consume(&chp->cq); in c4iw_flush_hw_cq()
280 ret = t4_next_hw_cqe(&chp->cq, &hw_cqe); in c4iw_flush_hw_cq()
300 void c4iw_count_rcqes(struct t4_cq *cq, struct t4_wq *wq, int *count) in c4iw_count_rcqes() argument
306 ptr = cq->sw_cidx; in c4iw_count_rcqes()
307 BUG_ON(ptr >= cq->size); in c4iw_count_rcqes()
308 while (ptr != cq->sw_pidx) { in c4iw_count_rcqes()
309 cqe = &cq->sw_queue[ptr]; in c4iw_count_rcqes()
313 if (++ptr == cq->size) in c4iw_count_rcqes()
316 PDBG("%s cq %p count %d\n", __func__, cq, *count); in c4iw_count_rcqes()
345 static int poll_cq(struct t4_wq *wq, struct t4_cq *cq, struct t4_cqe *cqe, in poll_cq() argument
354 ret = t4_next_cqe(cq, &hw_cqe); in poll_cq()
536 flush_completed_wrs(wq, cq); in poll_cq()
541 __func__, cq, cq->cqid, cq->sw_cidx); in poll_cq()
542 t4_swcq_consume(cq); in poll_cq()
545 __func__, cq, cq->cqid, cq->cidx); in poll_cq()
546 t4_hwcq_consume(cq); in poll_cq()
570 ret = t4_next_cqe(&chp->cq, &rd_cqe); in c4iw_poll_cq_one()
598 ret = poll_cq(wq, &(chp->cq), &cqe, &cqe_flushed, &cookie, &credit); in c4iw_poll_cq_one()
703 chp->cq.cqid, CQE_QPID(&cqe), CQE_TYPE(&cqe), in c4iw_poll_cq_one()
719 if (t4_cq_in_error(&chp->cq)) { in c4iw_poll_cq()
720 t4_reset_cq_in_error(&chp->cq); in c4iw_poll_cq()
725 return t4_cq_notempty(&chp->cq); in c4iw_poll_cq()
747 ret = t4_arm_cq(&chp->cq, solicited); in c4iw_arm_cq()