• Home
  • Raw
  • Download

Lines Matching refs:pq

102 	struct ipath_user_sdma_queue *pq =  in ipath_user_sdma_queue_create()  local
105 if (!pq) in ipath_user_sdma_queue_create()
108 pq->counter = 0; in ipath_user_sdma_queue_create()
109 pq->sent_counter = 0; in ipath_user_sdma_queue_create()
110 INIT_LIST_HEAD(&pq->sent); in ipath_user_sdma_queue_create()
112 mutex_init(&pq->lock); in ipath_user_sdma_queue_create()
114 snprintf(pq->pkt_slab_name, sizeof(pq->pkt_slab_name), in ipath_user_sdma_queue_create()
116 pq->pkt_slab = kmem_cache_create(pq->pkt_slab_name, in ipath_user_sdma_queue_create()
120 if (!pq->pkt_slab) in ipath_user_sdma_queue_create()
123 snprintf(pq->header_cache_name, sizeof(pq->header_cache_name), in ipath_user_sdma_queue_create()
125 pq->header_cache = dma_pool_create(pq->header_cache_name, in ipath_user_sdma_queue_create()
129 if (!pq->header_cache) in ipath_user_sdma_queue_create()
132 pq->dma_pages_root = RB_ROOT; in ipath_user_sdma_queue_create()
137 kmem_cache_destroy(pq->pkt_slab); in ipath_user_sdma_queue_create()
139 kfree(pq); in ipath_user_sdma_queue_create()
140 pq = NULL; in ipath_user_sdma_queue_create()
143 return pq; in ipath_user_sdma_queue_create()
247 struct ipath_user_sdma_queue *pq, in ipath_user_sdma_free_pkt_frag() argument
269 dma_pool_free(pq->header_cache, in ipath_user_sdma_free_pkt_frag()
323 struct ipath_user_sdma_queue *pq, in ipath_user_sdma_pin_pkt() argument
346 ipath_user_sdma_free_pkt_frag(&dd->pcidev->dev, pq, pkt, idx); in ipath_user_sdma_pin_pkt()
353 struct ipath_user_sdma_queue *pq, in ipath_user_sdma_init_payload() argument
363 ret = ipath_user_sdma_pin_pkt(dd, pq, pkt, iov, niov); in ipath_user_sdma_init_payload()
370 struct ipath_user_sdma_queue *pq, in ipath_user_sdma_free_pkt_list() argument
379 ipath_user_sdma_free_pkt_frag(dev, pq, pkt, i); in ipath_user_sdma_free_pkt_list()
381 kmem_cache_free(pq->pkt_slab, pkt); in ipath_user_sdma_free_pkt_list()
393 struct ipath_user_sdma_queue *pq, in ipath_user_sdma_queue_pkts() argument
408 u32 counter = pq->counter; in ipath_user_sdma_queue_pkts()
425 pkt = kmem_cache_alloc(pq->pkt_slab, GFP_KERNEL); in ipath_user_sdma_queue_pkts()
438 pbc = dma_pool_alloc(pq->header_cache, GFP_KERNEL, in ipath_user_sdma_queue_pkts()
523 ret = ipath_user_sdma_init_payload(dd, pq, pkt, in ipath_user_sdma_queue_pkts()
547 dma_pool_free(pq->header_cache, pbc, dma_addr); in ipath_user_sdma_queue_pkts()
549 kmem_cache_free(pq->pkt_slab, pkt); in ipath_user_sdma_queue_pkts()
551 ipath_user_sdma_free_pkt_list(&dd->pcidev->dev, pq, list); in ipath_user_sdma_queue_pkts()
556 static void ipath_user_sdma_set_complete_counter(struct ipath_user_sdma_queue *pq, in ipath_user_sdma_set_complete_counter() argument
559 pq->sent_counter = c; in ipath_user_sdma_set_complete_counter()
564 struct ipath_user_sdma_queue *pq) in ipath_user_sdma_queue_clean() argument
573 list_for_each_entry_safe(pkt, pkt_prev, &pq->sent, list) { in ipath_user_sdma_queue_clean()
592 ipath_user_sdma_free_pkt_list(&dd->pcidev->dev, pq, &free_list); in ipath_user_sdma_queue_clean()
593 ipath_user_sdma_set_complete_counter(pq, counter); in ipath_user_sdma_queue_clean()
599 void ipath_user_sdma_queue_destroy(struct ipath_user_sdma_queue *pq) in ipath_user_sdma_queue_destroy() argument
601 if (!pq) in ipath_user_sdma_queue_destroy()
604 kmem_cache_destroy(pq->pkt_slab); in ipath_user_sdma_queue_destroy()
605 dma_pool_destroy(pq->header_cache); in ipath_user_sdma_queue_destroy()
606 kfree(pq); in ipath_user_sdma_queue_destroy()
624 struct ipath_user_sdma_queue *pq) in ipath_user_sdma_queue_drain() argument
628 if (!pq) in ipath_user_sdma_queue_drain()
632 mutex_lock(&pq->lock); in ipath_user_sdma_queue_drain()
633 if (list_empty(&pq->sent)) { in ipath_user_sdma_queue_drain()
634 mutex_unlock(&pq->lock); in ipath_user_sdma_queue_drain()
638 ipath_user_sdma_queue_clean(dd, pq); in ipath_user_sdma_queue_drain()
639 mutex_unlock(&pq->lock); in ipath_user_sdma_queue_drain()
643 if (!list_empty(&pq->sent)) { in ipath_user_sdma_queue_drain()
648 mutex_lock(&pq->lock); in ipath_user_sdma_queue_drain()
649 list_splice_init(&pq->sent, &free_list); in ipath_user_sdma_queue_drain()
650 ipath_user_sdma_free_pkt_list(&dd->pcidev->dev, pq, &free_list); in ipath_user_sdma_queue_drain()
651 mutex_unlock(&pq->lock); in ipath_user_sdma_queue_drain()
709 struct ipath_user_sdma_queue *pq, in ipath_user_sdma_push_pkts() argument
774 list_move_tail(&pkt->list, &pq->sent); in ipath_user_sdma_push_pkts()
793 struct ipath_user_sdma_queue *pq, in ipath_user_sdma_writev() argument
803 mutex_lock(&pq->lock); in ipath_user_sdma_writev()
807 ipath_user_sdma_queue_clean(dd, pq); in ipath_user_sdma_writev()
814 ret = ipath_user_sdma_queue_pkts(dd, pq, &list, iov, dim, mxp); in ipath_user_sdma_writev()
833 ipath_user_sdma_queue_clean(dd, pq); in ipath_user_sdma_writev()
836 ret = ipath_user_sdma_push_pkts(dd, pq, &list); in ipath_user_sdma_writev()
841 pq->counter += ret; in ipath_user_sdma_writev()
851 ipath_user_sdma_free_pkt_list(&dd->pcidev->dev, pq, &list); in ipath_user_sdma_writev()
852 mutex_unlock(&pq->lock); in ipath_user_sdma_writev()
858 struct ipath_user_sdma_queue *pq) in ipath_user_sdma_make_progress() argument
862 mutex_lock(&pq->lock); in ipath_user_sdma_make_progress()
864 ret = ipath_user_sdma_queue_clean(dd, pq); in ipath_user_sdma_make_progress()
865 mutex_unlock(&pq->lock); in ipath_user_sdma_make_progress()
870 u32 ipath_user_sdma_complete_counter(const struct ipath_user_sdma_queue *pq) in ipath_user_sdma_complete_counter() argument
872 return pq->sent_counter; in ipath_user_sdma_complete_counter()
875 u32 ipath_user_sdma_inflight_counter(struct ipath_user_sdma_queue *pq) in ipath_user_sdma_inflight_counter() argument
877 return pq->counter; in ipath_user_sdma_inflight_counter()