Lines Matching refs:chp
242 struct c4iw_cq *chp = to_c4iw_cq(qhp->ibqp.send_cq); in c4iw_flush_sq() local
243 struct t4_cq *cq = &chp->cq; in c4iw_flush_sq()
335 void c4iw_flush_hw_cq(struct c4iw_cq *chp, struct c4iw_qp *flush_qhp) in c4iw_flush_hw_cq() argument
342 pr_debug("cqid 0x%x\n", chp->cq.cqid); in c4iw_flush_hw_cq()
343 ret = t4_next_hw_cqe(&chp->cq, &hw_cqe); in c4iw_flush_hw_cq()
351 qhp = get_qhp(chp->rhp, CQE_QPID(hw_cqe)); in c4iw_flush_hw_cq()
407 flush_completed_wrs(&qhp->wq, &chp->cq); in c4iw_flush_hw_cq()
409 swcqe = &chp->cq.sw_queue[chp->cq.sw_pidx]; in c4iw_flush_hw_cq()
412 t4_swcq_produce(&chp->cq); in c4iw_flush_hw_cq()
415 t4_hwcq_consume(&chp->cq); in c4iw_flush_hw_cq()
416 ret = t4_next_hw_cqe(&chp->cq, &hw_cqe); in c4iw_flush_hw_cq()
754 static int __c4iw_poll_cq_one(struct c4iw_cq *chp, struct c4iw_qp *qhp, in __c4iw_poll_cq_one() argument
764 ret = poll_cq(wq, &(chp->cq), &cqe, &cqe_flushed, &cookie, &credit, in __c4iw_poll_cq_one()
921 static int c4iw_poll_cq_one(struct c4iw_cq *chp, struct ib_wc *wc) in c4iw_poll_cq_one() argument
928 ret = t4_next_cqe(&chp->cq, &rd_cqe); in c4iw_poll_cq_one()
933 qhp = get_qhp(chp->rhp, CQE_QPID(rd_cqe)); in c4iw_poll_cq_one()
939 ret = __c4iw_poll_cq_one(chp, qhp, wc, srq); in c4iw_poll_cq_one()
944 ret = __c4iw_poll_cq_one(chp, NULL, wc, NULL); in c4iw_poll_cq_one()
951 struct c4iw_cq *chp; in c4iw_poll_cq() local
956 chp = to_c4iw_cq(ibcq); in c4iw_poll_cq()
958 spin_lock_irqsave(&chp->lock, flags); in c4iw_poll_cq()
961 err = c4iw_poll_cq_one(chp, wc + npolled); in c4iw_poll_cq()
966 spin_unlock_irqrestore(&chp->lock, flags); in c4iw_poll_cq()
970 void c4iw_cq_rem_ref(struct c4iw_cq *chp) in c4iw_cq_rem_ref() argument
972 if (refcount_dec_and_test(&chp->refcnt)) in c4iw_cq_rem_ref()
973 complete(&chp->cq_rel_comp); in c4iw_cq_rem_ref()
978 struct c4iw_cq *chp; in c4iw_destroy_cq() local
982 chp = to_c4iw_cq(ib_cq); in c4iw_destroy_cq()
984 xa_erase_irq(&chp->rhp->cqs, chp->cq.cqid); in c4iw_destroy_cq()
985 c4iw_cq_rem_ref(chp); in c4iw_destroy_cq()
986 wait_for_completion(&chp->cq_rel_comp); in c4iw_destroy_cq()
990 destroy_cq(&chp->rhp->rdev, &chp->cq, in c4iw_destroy_cq()
991 ucontext ? &ucontext->uctx : &chp->cq.rdev->uctx, in c4iw_destroy_cq()
992 chp->destroy_skb, chp->wr_waitp); in c4iw_destroy_cq()
993 c4iw_put_wr_wait(chp->wr_waitp); in c4iw_destroy_cq()
1004 struct c4iw_cq *chp = to_c4iw_cq(ibcq); in c4iw_create_cq() local
1028 chp->wr_waitp = c4iw_alloc_wr_wait(GFP_KERNEL); in c4iw_create_cq()
1029 if (!chp->wr_waitp) { in c4iw_create_cq()
1033 c4iw_init_wr_wait(chp->wr_waitp); in c4iw_create_cq()
1036 chp->destroy_skb = alloc_skb(wr_len, GFP_KERNEL); in c4iw_create_cq()
1037 if (!chp->destroy_skb) { in c4iw_create_cq()
1066 (sizeof(*chp->cq.queue) / 2) : sizeof(*chp->cq.queue)); in c4iw_create_cq()
1074 chp->cq.size = hwentries; in c4iw_create_cq()
1075 chp->cq.memsize = memsize; in c4iw_create_cq()
1076 chp->cq.vector = vector; in c4iw_create_cq()
1078 ret = create_cq(&rhp->rdev, &chp->cq, in c4iw_create_cq()
1080 chp->wr_waitp); in c4iw_create_cq()
1084 chp->rhp = rhp; in c4iw_create_cq()
1085 chp->cq.size--; /* status page */ in c4iw_create_cq()
1086 chp->ibcq.cqe = entries - 2; in c4iw_create_cq()
1087 spin_lock_init(&chp->lock); in c4iw_create_cq()
1088 spin_lock_init(&chp->comp_handler_lock); in c4iw_create_cq()
1089 refcount_set(&chp->refcnt, 1); in c4iw_create_cq()
1090 init_completion(&chp->cq_rel_comp); in c4iw_create_cq()
1091 ret = xa_insert_irq(&rhp->cqs, chp->cq.cqid, chp, GFP_KERNEL); in c4iw_create_cq()
1106 uresp.cqid = chp->cq.cqid; in c4iw_create_cq()
1107 uresp.size = chp->cq.size; in c4iw_create_cq()
1108 uresp.memsize = chp->cq.memsize; in c4iw_create_cq()
1128 mm->addr = virt_to_phys(chp->cq.queue); in c4iw_create_cq()
1129 mm->len = chp->cq.memsize; in c4iw_create_cq()
1133 mm2->addr = chp->cq.bar2_pa; in c4iw_create_cq()
1139 chp->cq.cqid, chp, chp->cq.size, chp->cq.memsize, in c4iw_create_cq()
1140 &chp->cq.dma_addr); in c4iw_create_cq()
1147 xa_erase_irq(&rhp->cqs, chp->cq.cqid); in c4iw_create_cq()
1149 destroy_cq(&chp->rhp->rdev, &chp->cq, in c4iw_create_cq()
1151 chp->destroy_skb, chp->wr_waitp); in c4iw_create_cq()
1153 kfree_skb(chp->destroy_skb); in c4iw_create_cq()
1155 c4iw_put_wr_wait(chp->wr_waitp); in c4iw_create_cq()
1162 struct c4iw_cq *chp; in c4iw_arm_cq() local
1166 chp = to_c4iw_cq(ibcq); in c4iw_arm_cq()
1167 spin_lock_irqsave(&chp->lock, flag); in c4iw_arm_cq()
1168 t4_arm_cq(&chp->cq, in c4iw_arm_cq()
1171 ret = t4_cq_notempty(&chp->cq); in c4iw_arm_cq()
1172 spin_unlock_irqrestore(&chp->lock, flag); in c4iw_arm_cq()