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);
44 struct rxe_cq *cq = from_tasklet(cq, t, comp_task);
47 spin_lock_irqsave(&cq->cq_lock, flags);
48 if (cq->is_dying) {
49 spin_unlock_irqrestore(&cq->cq_lock, flags);
52 spin_unlock_irqrestore(&cq->cq_lock, flags);
54 cq->ibcq.comp_handler(&cq->ibcq, cq->ibcq.cq_context);
57 int rxe_cq_from_init(struct rxe_dev *rxe, struct rxe_cq *cq, int cqe,
63 cq->queue = rxe_queue_init(rxe, &cqe,
65 if (!cq->queue) {
66 pr_warn("unable to create cq\n");
71 cq->queue->buf, cq->queue->buf_size, &cq->queue->ip);
73 vfree(cq->queue->buf);
74 kfree(cq->queue);
79 cq->is_user = 1;
81 cq->is_dying = false;
83 tasklet_setup(&cq->comp_task, rxe_send_complete);
85 spin_lock_init(&cq->cq_lock);
86 cq->ibcq.cqe = cqe;
90 int rxe_cq_resize_queue(struct rxe_cq *cq, int cqe,
96 err = rxe_queue_resize(cq->queue, (unsigned int *)&cqe,
98 uresp ? &uresp->mi : NULL, NULL, &cq->cq_lock);
100 cq->ibcq.cqe = cqe;
105 int rxe_cq_post(struct rxe_cq *cq, struct rxe_cqe *cqe, int solicited)
110 spin_lock_irqsave(&cq->cq_lock, flags);
112 if (unlikely(queue_full(cq->queue))) {
113 spin_unlock_irqrestore(&cq->cq_lock, flags);
114 if (cq->ibcq.event_handler) {
115 ev.device = cq->ibcq.device;
116 ev.element.cq = &cq->ibcq;
118 cq->ibcq.event_handler(&ev, cq->ibcq.cq_context);
124 memcpy(producer_addr(cq->queue), cqe, sizeof(*cqe));
131 advance_producer(cq->queue);
132 spin_unlock_irqrestore(&cq->cq_lock, flags);
134 if ((cq->notify == IB_CQ_NEXT_COMP) ||
135 (cq->notify == IB_CQ_SOLICITED && solicited)) {
136 cq->notify = 0;
137 tasklet_schedule(&cq->comp_task);
143 void rxe_cq_disable(struct rxe_cq *cq)
147 spin_lock_irqsave(&cq->cq_lock, flags);
148 cq->is_dying = true;
149 spin_unlock_irqrestore(&cq->cq_lock, flags);
154 struct rxe_cq *cq = container_of(arg, typeof(*cq), pelem);
156 if (cq->queue)
157 rxe_queue_cleanup(cq->queue);