Lines Matching refs:cq
11 int rxe_cq_chk_attr(struct rxe_dev *rxe, struct rxe_cq *cq, in rxe_cq_chk_attr() argument
27 if (cq) { in rxe_cq_chk_attr()
28 count = queue_count(cq->queue, QUEUE_TYPE_TO_CLIENT); in rxe_cq_chk_attr()
44 struct rxe_cq *cq = from_tasklet(cq, t, comp_task); in rxe_send_complete() local
47 spin_lock_irqsave(&cq->cq_lock, flags); in rxe_send_complete()
48 if (cq->is_dying) { in rxe_send_complete()
49 spin_unlock_irqrestore(&cq->cq_lock, flags); in rxe_send_complete()
52 spin_unlock_irqrestore(&cq->cq_lock, flags); in rxe_send_complete()
54 cq->ibcq.comp_handler(&cq->ibcq, cq->ibcq.cq_context); in rxe_send_complete()
57 int rxe_cq_from_init(struct rxe_dev *rxe, struct rxe_cq *cq, int cqe, in rxe_cq_from_init() argument
65 cq->queue = rxe_queue_init(rxe, &cqe, in rxe_cq_from_init()
67 if (!cq->queue) { in rxe_cq_from_init()
73 cq->queue->buf, cq->queue->buf_size, &cq->queue->ip); in rxe_cq_from_init()
75 vfree(cq->queue->buf); in rxe_cq_from_init()
76 kfree(cq->queue); in rxe_cq_from_init()
80 cq->is_user = uresp; in rxe_cq_from_init()
82 cq->is_dying = false; in rxe_cq_from_init()
84 tasklet_setup(&cq->comp_task, rxe_send_complete); in rxe_cq_from_init()
86 spin_lock_init(&cq->cq_lock); in rxe_cq_from_init()
87 cq->ibcq.cqe = cqe; in rxe_cq_from_init()
91 int rxe_cq_resize_queue(struct rxe_cq *cq, int cqe, in rxe_cq_resize_queue() argument
97 err = rxe_queue_resize(cq->queue, (unsigned int *)&cqe, in rxe_cq_resize_queue()
99 uresp ? &uresp->mi : NULL, NULL, &cq->cq_lock); in rxe_cq_resize_queue()
101 cq->ibcq.cqe = cqe; in rxe_cq_resize_queue()
106 int rxe_cq_post(struct rxe_cq *cq, struct rxe_cqe *cqe, int solicited) in rxe_cq_post() argument
113 spin_lock_irqsave(&cq->cq_lock, flags); in rxe_cq_post()
115 full = queue_full(cq->queue, QUEUE_TYPE_TO_CLIENT); in rxe_cq_post()
117 spin_unlock_irqrestore(&cq->cq_lock, flags); in rxe_cq_post()
118 if (cq->ibcq.event_handler) { in rxe_cq_post()
119 ev.device = cq->ibcq.device; in rxe_cq_post()
120 ev.element.cq = &cq->ibcq; in rxe_cq_post()
122 cq->ibcq.event_handler(&ev, cq->ibcq.cq_context); in rxe_cq_post()
128 addr = queue_producer_addr(cq->queue, QUEUE_TYPE_TO_CLIENT); in rxe_cq_post()
131 queue_advance_producer(cq->queue, QUEUE_TYPE_TO_CLIENT); in rxe_cq_post()
133 spin_unlock_irqrestore(&cq->cq_lock, flags); in rxe_cq_post()
135 if ((cq->notify == IB_CQ_NEXT_COMP) || in rxe_cq_post()
136 (cq->notify == IB_CQ_SOLICITED && solicited)) { in rxe_cq_post()
137 cq->notify = 0; in rxe_cq_post()
138 tasklet_schedule(&cq->comp_task); in rxe_cq_post()
144 void rxe_cq_disable(struct rxe_cq *cq) in rxe_cq_disable() argument
148 spin_lock_irqsave(&cq->cq_lock, flags); in rxe_cq_disable()
149 cq->is_dying = true; in rxe_cq_disable()
150 spin_unlock_irqrestore(&cq->cq_lock, flags); in rxe_cq_disable()
155 struct rxe_cq *cq = container_of(arg, typeof(*cq), pelem); in rxe_cq_cleanup() local
157 if (cq->queue) in rxe_cq_cleanup()
158 rxe_queue_cleanup(cq->queue); in rxe_cq_cleanup()