Lines Matching refs:npages
57 static u32 find_phys_blocks(struct tid_user_buf *tidbuf, unsigned int npages);
61 u16 pageidx, unsigned int npages);
196 unsigned int npages, in unpin_rcv_pages() argument
209 hfi1_release_user_pages(fd->mm, pages, npages, mapped); in unpin_rcv_pages()
210 fd->tid_n_pinned -= npages; in unpin_rcv_pages()
219 unsigned int npages; in pin_rcv_pages() local
225 npages = num_user_pages(vaddr, tidbuf->length); in pin_rcv_pages()
226 if (!npages) in pin_rcv_pages()
229 if (npages > fd->uctxt->expected_count) { in pin_rcv_pages()
236 npages * PAGE_SIZE)) { in pin_rcv_pages()
238 (void *)vaddr, npages); in pin_rcv_pages()
242 pages = kcalloc(npages, sizeof(*pages), GFP_KERNEL); in pin_rcv_pages()
251 if (!hfi1_can_pin_pages(dd, fd->mm, fd->tid_n_pinned, npages)) { in pin_rcv_pages()
256 pinned = hfi1_acquire_user_pages(fd->mm, vaddr, npages, true, pages); in pin_rcv_pages()
262 tidbuf->npages = npages; in pin_rcv_pages()
589 static u32 find_phys_blocks(struct tid_user_buf *tidbuf, unsigned int npages) in find_phys_blocks() argument
596 if (!npages) in find_phys_blocks()
605 for (pageidx = 0, pagecount = 1, i = 1; i <= npages; i++) { in find_phys_blocks()
606 this_pfn = i < npages ? page_to_pfn(pages[i]) : 0; in find_phys_blocks()
708 u16 npages, pageidx, setidx = start + idx; in program_rcvarray() local
724 npages = tbuf->psets[setidx].count; in program_rcvarray()
729 npages); in program_rcvarray()
732 mapped += npages; in program_rcvarray()
735 EXP_TID_SET(LEN, npages); in program_rcvarray()
752 u16 pageidx, unsigned int npages) in set_rcvarray_entry() argument
765 node = kzalloc(sizeof(*node) + (sizeof(struct page *) * npages), in set_rcvarray_entry()
772 npages * PAGE_SIZE, PCI_DMA_FROMDEVICE); in set_rcvarray_entry()
781 node->mmu.len = npages * PAGE_SIZE; in set_rcvarray_entry()
783 node->npages = npages; in set_rcvarray_entry()
788 memcpy(node->pages, pages, sizeof(struct page *) * npages); in set_rcvarray_entry()
798 pci_unmap_single(dd->pcidev, phys, npages * PAGE_SIZE, in set_rcvarray_entry()
803 hfi1_put_tid(dd, rcventry, PT_EXPECTED, phys, ilog2(npages) + 1); in set_rcvarray_entry()
804 trace_hfi1_exp_tid_reg(uctxt->ctxt, fd->subctxt, rcventry, npages, in set_rcvarray_entry()
850 node->npages, node->mmu.addr, node->phys, in clear_tid_node()
859 unpin_rcv_pages(fd, NULL, node, 0, node->npages, true); in clear_tid_node()
921 node->rcventry, node->npages, node->dma_addr); in tid_rb_invalidate()
929 EXP_TID_SET(LEN, node->npages); in tid_rb_invalidate()