>Subject: Re: [PATCH rdma-next v1 2/6] RDMA/umem: Add API to find best driver >supported page size in an MR > >On 19-Feb-19 16:57, Shiraz Saleem wrote: >> This helper iterates through the SG list to find the best page size to >> use from a bitmap of HW supported page sizes. Drivers that support >> multiple page sizes, but not mixed pages in an MR can use this API. >> >> Suggested-by: Jason Gunthorpe <jgg@xxxxxxxx> >> Reviewed-by: Michael J. Ruhl <michael.j.ruhl@xxxxxxxxx> >> Signed-off-by: Shiraz Saleem <shiraz.saleem@xxxxxxxxx> > >I've tested this patch comparing our existing efa_cont_pages() implementation vs >ib_umem_find_single_pg_size() running different test suites: Thanks for testing! > >Supported page sizes are anything between 4k to 2G. >I'm using page shift to compare results of both functions (ilog2 the return value of >ib_umem_find_single_pg_size). > >When huge pages are disabled, in many cases efa_cont_pages() returns page shift >of 13 where ib_umem_find_single_pg_size() returns 12. Didn't see a test where >ib_umem_find_single_pg_size() returns anything other than 12 (PAGE_SIZE). I wonder if the checks in place to guarantee offset into large page align for user-space virt buf and phy buf is downgrading the page bit. And that EFA might not need it. > >When huge pages are enabled, most of the times both functions return the same >value (page shift 21/22) but in some cases efa_cont_pages() returns 21 and >ib_umem_find_single_pg_size() returns 22 which causes register MR verb to fail due >to invalid page address. I see. Seems like there's a bug here. I can provided you a debug hooked patch that should narrow it down. If you can run it for the mismatch cases, it would be great. Shiraz