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 = tidbuf->npages; in pin_rcv_pages() local
168 if (npages > fd->uctxt->expected_count) { in pin_rcv_pages()
174 pages = kcalloc(npages, sizeof(*pages), GFP_KERNEL); in pin_rcv_pages()
183 if (!hfi1_can_pin_pages(dd, current->mm, fd->tid_n_pinned, npages)) { in pin_rcv_pages()
188 pinned = hfi1_acquire_user_pages(current->mm, vaddr, npages, true, pages); in pin_rcv_pages()
271 tidbuf->npages = num_user_pages(tidbuf->vaddr, tidbuf->length); in hfi1_user_exp_rcv_setup()
282 tidbuf->vaddr, tidbuf->npages * PAGE_SIZE, in hfi1_user_exp_rcv_setup()
568 static u32 find_phys_blocks(struct tid_user_buf *tidbuf, unsigned int npages) in find_phys_blocks() argument
575 if (!npages) in find_phys_blocks()
584 for (pageidx = 0, pagecount = 1, i = 1; i <= npages; i++) { in find_phys_blocks()
585 this_pfn = i < npages ? page_to_pfn(pages[i]) : 0; in find_phys_blocks()
687 u16 npages, pageidx, setidx = start + idx; in program_rcvarray() local
703 npages = tbuf->psets[setidx].count; in program_rcvarray()
708 npages); in program_rcvarray()
711 mapped += npages; in program_rcvarray()
714 EXP_TID_SET(LEN, npages); in program_rcvarray()
731 u16 pageidx, unsigned int npages) in set_rcvarray_entry() argument
744 node = kzalloc(sizeof(*node) + (sizeof(struct page *) * npages), in set_rcvarray_entry()
750 npages * PAGE_SIZE, DMA_FROM_DEVICE); in set_rcvarray_entry()
761 node->npages = npages; in set_rcvarray_entry()
766 memcpy(node->pages, pages, sizeof(struct page *) * npages); in set_rcvarray_entry()
771 tbuf->vaddr + (pageidx * PAGE_SIZE), npages * PAGE_SIZE, in set_rcvarray_entry()
778 hfi1_put_tid(dd, rcventry, PT_EXPECTED, phys, ilog2(npages) + 1); in set_rcvarray_entry()
779 trace_hfi1_exp_tid_reg(uctxt->ctxt, fd->subctxt, rcventry, npages, in set_rcvarray_entry()
788 dma_unmap_single(&dd->pcidev->dev, phys, npages * PAGE_SIZE, in set_rcvarray_entry()
835 node->npages, in __clear_tid_node()
842 unpin_rcv_pages(fd, NULL, node, 0, node->npages, true); in __clear_tid_node()
916 node->rcventry, node->npages, node->dma_addr); in tid_rb_invalidate()
926 EXP_TID_SET(LEN, node->npages); in tid_rb_invalidate()