Lines Matching refs:npages
16 static u32 find_phys_blocks(struct tid_user_buf *tidbuf, unsigned int npages);
20 u16 pageidx, unsigned int npages);
137 unsigned int npages, in unpin_rcv_pages() argument
146 node->npages * PAGE_SIZE, DMA_FROM_DEVICE); in unpin_rcv_pages()
153 hfi1_release_user_pages(mm, pages, npages, mapped); in unpin_rcv_pages()
154 fd->tid_n_pinned -= npages; in unpin_rcv_pages()
163 unsigned int npages; in pin_rcv_pages() local
169 npages = num_user_pages(vaddr, tidbuf->length); in pin_rcv_pages()
170 if (!npages) in pin_rcv_pages()
173 if (npages > fd->uctxt->expected_count) { in pin_rcv_pages()
179 pages = kcalloc(npages, sizeof(*pages), GFP_KERNEL); in pin_rcv_pages()
188 if (!hfi1_can_pin_pages(dd, current->mm, fd->tid_n_pinned, npages)) { in pin_rcv_pages()
193 pinned = hfi1_acquire_user_pages(current->mm, vaddr, npages, true, pages); in pin_rcv_pages()
199 tidbuf->npages = npages; in pin_rcv_pages()
287 tidbuf->vaddr, tidbuf->npages * PAGE_SIZE, in hfi1_user_exp_rcv_setup()
573 static u32 find_phys_blocks(struct tid_user_buf *tidbuf, unsigned int npages) in find_phys_blocks() argument
580 if (!npages) in find_phys_blocks()
589 for (pageidx = 0, pagecount = 1, i = 1; i <= npages; i++) { in find_phys_blocks()
590 this_pfn = i < npages ? page_to_pfn(pages[i]) : 0; in find_phys_blocks()
692 u16 npages, pageidx, setidx = start + idx; in program_rcvarray() local
708 npages = tbuf->psets[setidx].count; in program_rcvarray()
713 npages); in program_rcvarray()
716 mapped += npages; in program_rcvarray()
719 EXP_TID_SET(LEN, npages); in program_rcvarray()
736 u16 pageidx, unsigned int npages) in set_rcvarray_entry() argument
749 node = kzalloc(struct_size(node, pages, npages), GFP_KERNEL); in set_rcvarray_entry()
754 npages * PAGE_SIZE, DMA_FROM_DEVICE); in set_rcvarray_entry()
765 node->npages = npages; in set_rcvarray_entry()
770 memcpy(node->pages, pages, flex_array_size(node, pages, npages)); in set_rcvarray_entry()
775 tbuf->vaddr + (pageidx * PAGE_SIZE), npages * PAGE_SIZE, in set_rcvarray_entry()
782 hfi1_put_tid(dd, rcventry, PT_EXPECTED, phys, ilog2(npages) + 1); in set_rcvarray_entry()
783 trace_hfi1_exp_tid_reg(uctxt->ctxt, fd->subctxt, rcventry, npages, in set_rcvarray_entry()
792 dma_unmap_single(&dd->pcidev->dev, phys, npages * PAGE_SIZE, in set_rcvarray_entry()
839 node->npages, in __clear_tid_node()
846 unpin_rcv_pages(fd, NULL, node, 0, node->npages, true); in __clear_tid_node()
920 node->rcventry, node->npages, node->dma_addr); in tid_rb_invalidate()
930 EXP_TID_SET(LEN, node->npages); in tid_rb_invalidate()