Lines Matching refs:npages
194 int mlx4_mtt_init(struct mlx4_dev *dev, int npages, int page_shift, in mlx4_mtt_init() argument
199 if (!npages) { in mlx4_mtt_init()
206 for (mtt->order = 0, i = 1; i < npages; i <<= 1) in mlx4_mtt_init()
418 u64 iova, u64 size, u32 access, int npages, in mlx4_mr_alloc_reserved() argument
428 return mlx4_mtt_init(dev, npages, page_shift, &mr->mtt); in mlx4_mr_alloc_reserved()
528 int npages, int page_shift, struct mlx4_mr *mr) in mlx4_mr_alloc() argument
538 access, npages, page_shift, mr); in mlx4_mr_alloc()
590 u64 iova, u64 size, int npages, in mlx4_mr_rereg_mem_write() argument
595 err = mlx4_mtt_init(dev, npages, page_shift, &mr->mtt); in mlx4_mr_rereg_mem_write()
693 int start_index, int npages, u64 *page_list) in mlx4_write_mtt_chunk() argument
707 npages * sizeof(u64), DMA_TO_DEVICE); in mlx4_write_mtt_chunk()
709 for (i = 0; i < npages; ++i) in mlx4_write_mtt_chunk()
713 npages * sizeof(u64), DMA_TO_DEVICE); in mlx4_write_mtt_chunk()
719 int start_index, int npages, u64 *page_list) in __mlx4_write_mtt() argument
731 chunk = min_t(int, max_mtts_first_page, npages); in __mlx4_write_mtt()
733 while (npages > 0) { in __mlx4_write_mtt()
737 npages -= chunk; in __mlx4_write_mtt()
741 chunk = min_t(int, mtts_per_page, npages); in __mlx4_write_mtt()
747 int start_index, int npages, u64 *page_list) in mlx4_write_mtt() argument
764 while (npages > 0) { in mlx4_write_mtt()
766 npages); in mlx4_write_mtt()
778 npages -= chunk; in mlx4_write_mtt()
786 return __mlx4_write_mtt(dev, mtt, start_index, npages, page_list); in mlx4_write_mtt()
797 page_list = kcalloc(buf->npages, sizeof(*page_list), GFP_KERNEL); in mlx4_buf_write_mtt()
801 for (i = 0; i < buf->npages; ++i) in mlx4_buf_write_mtt()
807 err = mlx4_write_mtt(dev, mtt, 0, buf->npages, page_list); in mlx4_buf_write_mtt()
970 int npages, u64 iova) in mlx4_check_fmr() argument
974 if (npages > fmr->max_pages) in mlx4_check_fmr()
985 for (i = 0; i < npages; ++i) { in mlx4_check_fmr()
997 int npages, u64 iova, u32 *lkey, u32 *rkey) in mlx4_map_phys_fmr() argument
1002 err = mlx4_check_fmr(fmr, page_list, npages, iova); in mlx4_map_phys_fmr()
1018 npages * sizeof(u64), DMA_TO_DEVICE); in mlx4_map_phys_fmr()
1020 for (i = 0; i < npages; ++i) in mlx4_map_phys_fmr()
1024 npages * sizeof(u64), DMA_TO_DEVICE); in mlx4_map_phys_fmr()
1028 fmr->mpt->length = cpu_to_be64(npages * (1ull << fmr->page_shift)); in mlx4_map_phys_fmr()