On Tue, May 28, 2019 at 03:46:16PM +0300, Gal Pressman wrote: > @@ -1500,13 +1443,17 @@ struct ib_mr *efa_reg_mr(struct ib_pd *ibpd, u64 start, u64 length, > params.iova = virt_addr; > params.mr_length_in_bytes = length; > params.permissions = access_flags & 0x1; > - max_page_shift = fls64(dev->dev_attr.page_size_cap); > > - efa_cont_pages(mr->umem, start, max_page_shift, &npages, > - ¶ms.page_shift, ¶ms.page_num); > + pg_sz = ib_umem_find_best_pgsz(mr->umem, > + dev->dev_attr.page_size_cap, > + virt_addr); I think this needs to check pg_sz is not zero.. Jason