Lines Matching defs:cq
11 int rxe_cq_chk_attr(struct rxe_dev *rxe, struct rxe_cq *cq,
27 if (cq) {
28 count = queue_count(cq->queue, QUEUE_TYPE_TO_CLIENT);
30 rxe_dbg_cq(cq, "cqe(%d) < current # elements in queue (%d)",
42 int rxe_cq_from_init(struct rxe_dev *rxe, struct rxe_cq *cq, int cqe,
50 cq->queue = rxe_queue_init(rxe, &cqe,
52 if (!cq->queue) {
53 rxe_dbg_dev(rxe, "unable to create cq\n");
58 cq->queue->buf, cq->queue->buf_size, &cq->queue->ip);
60 vfree(cq->queue->buf);
61 kfree(cq->queue);
65 cq->is_user = uresp;
67 spin_lock_init(&cq->cq_lock);
68 cq->ibcq.cqe = cqe;
72 int rxe_cq_resize_queue(struct rxe_cq *cq, int cqe,
78 err = rxe_queue_resize(cq->queue, (unsigned int *)&cqe,
80 uresp ? &uresp->mi : NULL, NULL, &cq->cq_lock);
82 cq->ibcq.cqe = cqe;
87 /* caller holds reference to cq */
88 int rxe_cq_post(struct rxe_cq *cq, struct rxe_cqe *cqe, int solicited)
95 spin_lock_irqsave(&cq->cq_lock, flags);
97 full = queue_full(cq->queue, QUEUE_TYPE_TO_CLIENT);
99 rxe_err_cq(cq, "queue full");
100 spin_unlock_irqrestore(&cq->cq_lock, flags);
101 if (cq->ibcq.event_handler) {
102 ev.device = cq->ibcq.device;
103 ev.element.cq = &cq->ibcq;
105 cq->ibcq.event_handler(&ev, cq->ibcq.cq_context);
111 addr = queue_producer_addr(cq->queue, QUEUE_TYPE_TO_CLIENT);
114 queue_advance_producer(cq->queue, QUEUE_TYPE_TO_CLIENT);
116 if ((cq->notify & IB_CQ_NEXT_COMP) ||
117 (cq->notify & IB_CQ_SOLICITED && solicited)) {
118 cq->notify = 0;
119 cq->ibcq.comp_handler(&cq->ibcq, cq->ibcq.cq_context);
122 spin_unlock_irqrestore(&cq->cq_lock, flags);
129 struct rxe_cq *cq = container_of(elem, typeof(*cq), elem);
131 if (cq->queue)
132 rxe_queue_cleanup(cq->queue);