• Home
  • Raw
  • Download

Lines Matching refs:cq

70 int cxio_hal_cq_op(struct cxio_rdev *rdev_p, struct t3_cq *cq,  in cxio_hal_cq_op()  argument
78 setup.id = cq->cqid; in cxio_hal_cq_op()
91 if (Q_PTR2IDX((cq->rptr), cq->size_log2) != ret) { in cxio_hal_cq_op()
94 rptr = cq->rptr; in cxio_hal_cq_op()
100 while (Q_PTR2IDX((rptr+1), cq->size_log2) != ret) in cxio_hal_cq_op()
108 cqe = cq->queue + Q_PTR2IDX(rptr, cq->size_log2); in cxio_hal_cq_op()
109 while (!CQ_VLD_ENTRY(rptr, cq->size_log2, cqe)) { in cxio_hal_cq_op()
158 int cxio_create_cq(struct cxio_rdev *rdev_p, struct t3_cq *cq) in cxio_create_cq() argument
161 int size = (1UL << (cq->size_log2)) * sizeof(struct t3_cqe); in cxio_create_cq()
163 cq->cqid = cxio_hal_get_cqid(rdev_p->rscp); in cxio_create_cq()
164 if (!cq->cqid) in cxio_create_cq()
166 cq->sw_queue = kzalloc(size, GFP_KERNEL); in cxio_create_cq()
167 if (!cq->sw_queue) in cxio_create_cq()
169 cq->queue = dma_alloc_coherent(&(rdev_p->rnic_info.pdev->dev), in cxio_create_cq()
170 (1UL << (cq->size_log2)) * in cxio_create_cq()
172 &(cq->dma_addr), GFP_KERNEL); in cxio_create_cq()
173 if (!cq->queue) { in cxio_create_cq()
174 kfree(cq->sw_queue); in cxio_create_cq()
177 pci_unmap_addr_set(cq, mapping, cq->dma_addr); in cxio_create_cq()
178 memset(cq->queue, 0, size); in cxio_create_cq()
179 setup.id = cq->cqid; in cxio_create_cq()
180 setup.base_addr = (u64) (cq->dma_addr); in cxio_create_cq()
181 setup.size = 1UL << cq->size_log2; in cxio_create_cq()
191 int cxio_resize_cq(struct cxio_rdev *rdev_p, struct t3_cq *cq) in cxio_resize_cq() argument
194 setup.id = cq->cqid; in cxio_resize_cq()
195 setup.base_addr = (u64) (cq->dma_addr); in cxio_resize_cq()
196 setup.size = 1UL << cq->size_log2; in cxio_resize_cq()
320 int cxio_destroy_cq(struct cxio_rdev *rdev_p, struct t3_cq *cq) in cxio_destroy_cq() argument
323 err = cxio_hal_clear_cq_ctx(rdev_p, cq->cqid); in cxio_destroy_cq()
324 kfree(cq->sw_queue); in cxio_destroy_cq()
326 (1UL << (cq->size_log2)) in cxio_destroy_cq()
327 * sizeof(struct t3_cqe), cq->queue, in cxio_destroy_cq()
328 pci_unmap_addr(cq, mapping)); in cxio_destroy_cq()
329 cxio_hal_put_cqid(rdev_p->rscp, cq->cqid); in cxio_destroy_cq()
347 static void insert_recv_cqe(struct t3_wq *wq, struct t3_cq *cq) in insert_recv_cqe() argument
352 wq, cq, cq->sw_rptr, cq->sw_wptr); in insert_recv_cqe()
359 V_CQE_GENBIT(Q_GENBIT(cq->sw_wptr, in insert_recv_cqe()
360 cq->size_log2))); in insert_recv_cqe()
361 *(cq->sw_queue + Q_PTR2IDX(cq->sw_wptr, cq->size_log2)) = cqe; in insert_recv_cqe()
362 cq->sw_wptr++; in insert_recv_cqe()
365 int cxio_flush_rq(struct t3_wq *wq, struct t3_cq *cq, int count) in cxio_flush_rq() argument
370 PDBG("%s wq %p cq %p\n", __func__, wq, cq); in cxio_flush_rq()
377 insert_recv_cqe(wq, cq); in cxio_flush_rq()
383 static void insert_sq_cqe(struct t3_wq *wq, struct t3_cq *cq, in insert_sq_cqe() argument
389 wq, cq, cq->sw_rptr, cq->sw_wptr); in insert_sq_cqe()
396 V_CQE_GENBIT(Q_GENBIT(cq->sw_wptr, in insert_sq_cqe()
397 cq->size_log2))); in insert_sq_cqe()
400 *(cq->sw_queue + Q_PTR2IDX(cq->sw_wptr, cq->size_log2)) = cqe; in insert_sq_cqe()
401 cq->sw_wptr++; in insert_sq_cqe()
404 int cxio_flush_sq(struct t3_wq *wq, struct t3_cq *cq, int count) in cxio_flush_sq() argument
413 insert_sq_cqe(wq, cq, sqp); in cxio_flush_sq()
424 void cxio_flush_hw_cq(struct t3_cq *cq) in cxio_flush_hw_cq() argument
428 PDBG("%s cq %p cqid 0x%x\n", __func__, cq, cq->cqid); in cxio_flush_hw_cq()
429 cqe = cxio_next_hw_cqe(cq); in cxio_flush_hw_cq()
432 __func__, cq->rptr, cq->sw_wptr); in cxio_flush_hw_cq()
433 swcqe = cq->sw_queue + Q_PTR2IDX(cq->sw_wptr, cq->size_log2); in cxio_flush_hw_cq()
436 cq->sw_wptr++; in cxio_flush_hw_cq()
437 cq->rptr++; in cxio_flush_hw_cq()
438 cqe = cxio_next_hw_cqe(cq); in cxio_flush_hw_cq()
460 void cxio_count_scqes(struct t3_cq *cq, struct t3_wq *wq, int *count) in cxio_count_scqes() argument
466 ptr = cq->sw_rptr; in cxio_count_scqes()
467 while (!Q_EMPTY(ptr, cq->sw_wptr)) { in cxio_count_scqes()
468 cqe = cq->sw_queue + (Q_PTR2IDX(ptr, cq->size_log2)); in cxio_count_scqes()
475 PDBG("%s cq %p count %d\n", __func__, cq, *count); in cxio_count_scqes()
478 void cxio_count_rcqes(struct t3_cq *cq, struct t3_wq *wq, int *count) in cxio_count_rcqes() argument
485 ptr = cq->sw_rptr; in cxio_count_rcqes()
486 while (!Q_EMPTY(ptr, cq->sw_wptr)) { in cxio_count_rcqes()
487 cqe = cq->sw_queue + (Q_PTR2IDX(ptr, cq->size_log2)); in cxio_count_rcqes()
493 PDBG("%s cq %p count %d\n", __func__, cq, *count); in cxio_count_rcqes()
1048 static void flush_completed_wrs(struct t3_wq *wq, struct t3_cq *cq) in flush_completed_wrs() argument
1066 Q_PTR2IDX(cq->sw_wptr, cq->size_log2)); in flush_completed_wrs()
1068 *(cq->sw_queue + Q_PTR2IDX(cq->sw_wptr, cq->size_log2)) in flush_completed_wrs()
1070 cq->sw_wptr++; in flush_completed_wrs()
1122 int cxio_poll_cq(struct t3_wq *wq, struct t3_cq *cq, struct t3_cqe *cqe, in cxio_poll_cq() argument
1130 hw_cqe = cxio_next_cqe(cq); in cxio_poll_cq()
1287 flush_completed_wrs(wq, cq); in cxio_poll_cq()
1292 __func__, cq, cq->cqid, cq->sw_rptr); in cxio_poll_cq()
1293 ++cq->sw_rptr; in cxio_poll_cq()
1296 __func__, cq, cq->cqid, cq->rptr); in cxio_poll_cq()
1297 ++cq->rptr; in cxio_poll_cq()
1302 if (((cq->rptr - cq->wptr) > (1 << (cq->size_log2 - 1))) in cxio_poll_cq()
1303 || ((cq->rptr - cq->wptr) >= 128)) { in cxio_poll_cq()
1304 *credit = cq->rptr - cq->wptr; in cxio_poll_cq()
1305 cq->wptr = cq->rptr; in cxio_poll_cq()