Lines Matching refs:mq
90 q = &cq->mq; in c2_cq_clean()
136 ce = (struct c2wr_ce *) c2_mq_consume(&cq->mq); in c2_poll_one()
148 c2_mq_free(&cq->mq); in c2_poll_one()
149 ce = (struct c2wr_ce *) c2_mq_consume(&cq->mq); in c2_poll_one()
194 c2_mq_free(&cq->mq); in c2_poll_one()
228 shared = cq->mq.peer; in c2_arm_cq()
248 ret = !c2_mq_empty(&cq->mq); in c2_arm_cq()
255 static void c2_free_cq_buf(struct c2_dev *c2dev, struct c2_mq *mq) in c2_free_cq_buf() argument
257 dma_free_coherent(&c2dev->pcidev->dev, mq->q_size * mq->msg_size, in c2_free_cq_buf()
258 mq->msg_pool.host, pci_unmap_addr(mq, mapping)); in c2_free_cq_buf()
261 static int c2_alloc_cq_buf(struct c2_dev *c2dev, struct c2_mq *mq, int q_size, in c2_alloc_cq_buf() argument
267 &mq->host_dma, GFP_KERNEL); in c2_alloc_cq_buf()
271 c2_mq_rep_init(mq, in c2_alloc_cq_buf()
279 pci_unmap_addr_set(mq, mapping, mq->host_dma); in c2_alloc_cq_buf()
299 cq->mq.shared = c2_alloc_mqsp(c2dev, c2dev->kern_mqsp_pool, in c2_init_cq()
300 &cq->mq.shared_dma, GFP_KERNEL); in c2_init_cq()
301 if (!cq->mq.shared) in c2_init_cq()
305 err = c2_alloc_cq_buf(c2dev, &cq->mq, entries + 1, C2_CQ_MSG_SIZE); in c2_init_cq()
319 wr.msg_size = cpu_to_be32(cq->mq.msg_size); in c2_init_cq()
320 wr.depth = cpu_to_be32(cq->mq.q_size); in c2_init_cq()
321 wr.shared_ht = cpu_to_be64(cq->mq.shared_dma); in c2_init_cq()
322 wr.msg_pool = cpu_to_be64(cq->mq.host_dma); in c2_init_cq()
347 cq->mq.index = be32_to_cpu(reply->mq_index); in c2_init_cq()
350 cq->mq.peer = ioremap_nocache(peer_pa, PAGE_SIZE); in c2_init_cq()
351 if (!cq->mq.peer) { in c2_init_cq()
367 cq->cqn = cq->mq.index; in c2_init_cq()
377 c2_free_cq_buf(c2dev, &cq->mq); in c2_init_cq()
379 c2_free_mqsp(cq->mq.shared); in c2_init_cq()
395 c2dev->qptr_array[cq->mq.index] = NULL; in c2_free_cq()
431 c2_free_cq_buf(c2dev, &cq->mq); in c2_free_cq()