On Wed, Sep 2, 2020 at 6:14 AM Jason Gunthorpe <jgg@xxxxxxxxxx> wrote: > > ib_umem_page_count() returns the number of 4k entries required for a DMA > map, but bnxt_re already computes a variable page size. The correct API to > determine the size of the page table array is ib_umem_num_dma_blocks(). > > Fix the overallocation of the page array in fill_umem_pbl_tbl() when > working with larger page sizes by using the right function. Lightly > re-organize this function to make it clearer. > > Replace the other calls to ib_umem_num_pages(). > > Fixes: d85582517e91 ("RDMA/bnxt_re: Use core helpers to get aligned DMA address") > Signed-off-by: Jason Gunthorpe <jgg@xxxxxxxxxx> > --- > drivers/infiniband/hw/bnxt_re/ib_verbs.c | 70 ++++++++---------------- > 1 file changed, 24 insertions(+), 46 deletions(-) > Acked-by: Selvin Xavier <selvin.xavier@xxxxxxxxxxxx> Thanks