Lines Matching refs:cq
51 struct ib_cq *cq = container_of(work, struct ib_cq, work);
57 n = ib_poll_cq(cq, IB_CQ_POLL_MAX, ib_wc);
62 wc->wr_cqe->done(cq, wc);
66 if (ib_req_notify_cq(cq, IB_CQ_POLL_FLAGS) > 0)
77 queue_work(ib_comp_wq, &cq->work);
81 ib_cq_completion_workqueue(struct ib_cq *cq, void *private)
83 queue_work(ib_comp_wq, &cq->work);
96 struct ib_cq *cq;
112 cq = rdma_zalloc_drv_obj(dev, ib_cq);
113 if (!cq)
116 cq->device = dev;
117 cq->cq_context = private;
118 cq->poll_ctx = poll_ctx;
119 atomic_set(&cq->usecnt, 0);
121 ret = dev->create_cq(cq, &cq_attr, NULL);
127 cq->comp_handler = NULL; /* no hardware completions */
131 cq->comp_handler = ib_cq_completion_workqueue;
132 INIT_WORK(&cq->work, ib_cq_poll_work);
133 ib_req_notify_cq(cq, IB_CQ_NEXT_COMP);
138 return (cq);
141 kfree(cq);
147 ib_free_cq_user(struct ib_cq *cq, struct ib_udata *udata)
150 if (WARN_ON_ONCE(atomic_read(&cq->usecnt) != 0))
153 switch (cq->poll_ctx) {
158 flush_work(&cq->work);
164 cq->device->destroy_cq(cq, udata);
165 kfree(cq);