Lines Matching refs:npages

58 static u32 find_phys_blocks(struct tid_user_buf *tidbuf, unsigned int npages);
62 u16 pageidx, unsigned int npages);
172 unsigned int npages, in unpin_rcv_pages() argument
181 node->npages * PAGE_SIZE, PCI_DMA_FROMDEVICE); in unpin_rcv_pages()
188 hfi1_release_user_pages(mm, pages, npages, mapped); in unpin_rcv_pages()
189 fd->tid_n_pinned -= npages; in unpin_rcv_pages()
198 unsigned int npages; in pin_rcv_pages() local
204 npages = num_user_pages(vaddr, tidbuf->length); in pin_rcv_pages()
205 if (!npages) in pin_rcv_pages()
208 if (npages > fd->uctxt->expected_count) { in pin_rcv_pages()
214 pages = kcalloc(npages, sizeof(*pages), GFP_KERNEL); in pin_rcv_pages()
223 if (!hfi1_can_pin_pages(dd, current->mm, fd->tid_n_pinned, npages)) { in pin_rcv_pages()
228 pinned = hfi1_acquire_user_pages(current->mm, vaddr, npages, true, pages); in pin_rcv_pages()
234 tidbuf->npages = npages; in pin_rcv_pages()
561 static u32 find_phys_blocks(struct tid_user_buf *tidbuf, unsigned int npages) in find_phys_blocks() argument
568 if (!npages) in find_phys_blocks()
577 for (pageidx = 0, pagecount = 1, i = 1; i <= npages; i++) { in find_phys_blocks()
578 this_pfn = i < npages ? page_to_pfn(pages[i]) : 0; in find_phys_blocks()
680 u16 npages, pageidx, setidx = start + idx; in program_rcvarray() local
696 npages = tbuf->psets[setidx].count; in program_rcvarray()
701 npages); in program_rcvarray()
704 mapped += npages; in program_rcvarray()
707 EXP_TID_SET(LEN, npages); in program_rcvarray()
724 u16 pageidx, unsigned int npages) in set_rcvarray_entry() argument
737 node = kzalloc(sizeof(*node) + (sizeof(struct page *) * npages), in set_rcvarray_entry()
744 npages * PAGE_SIZE, PCI_DMA_FROMDEVICE); in set_rcvarray_entry()
754 node->npages = npages; in set_rcvarray_entry()
759 memcpy(node->pages, pages, sizeof(struct page *) * npages); in set_rcvarray_entry()
764 tbuf->vaddr + (pageidx * PAGE_SIZE), npages * PAGE_SIZE, in set_rcvarray_entry()
776 hfi1_put_tid(dd, rcventry, PT_EXPECTED, phys, ilog2(npages) + 1); in set_rcvarray_entry()
777 trace_hfi1_exp_tid_reg(uctxt->ctxt, fd->subctxt, rcventry, npages, in set_rcvarray_entry()
786 pci_unmap_single(dd->pcidev, phys, npages * PAGE_SIZE, in set_rcvarray_entry()
832 node->npages, in clear_tid_node()
842 unpin_rcv_pages(fd, NULL, node, 0, node->npages, true); in clear_tid_node()
903 node->rcventry, node->npages, node->dma_addr); in tid_rb_invalidate()
911 EXP_TID_SET(LEN, node->npages); in tid_rb_invalidate()