]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
RDMA/bnxt: Do not use ib_umem_page_count() or ib_umem_num_pages()
authorJason Gunthorpe <jgg@nvidia.com>
Fri, 4 Sep 2020 22:41:52 +0000 (19:41 -0300)
committerJason Gunthorpe <jgg@nvidia.com>
Fri, 11 Sep 2020 13:24:54 +0000 (10:24 -0300)
commit84e71b4d9bd8bb5dfde6a298875d32e8ddf7f06e
tree715da5295ba1403484fe3b35a56887f3616b78ef
parent901bca71cd5bb940c7a57042c4c1cc15bc847ffe
RDMA/bnxt: Do not use ib_umem_page_count() or ib_umem_num_pages()

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")
Link: https://lore.kernel.org/r/11-v2-270386b7e60b+28f4-umem_1_jgg@nvidia.com
Acked-by: Selvin Xavier <selvin.xavier@broadcom.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
drivers/infiniband/hw/bnxt_re/ib_verbs.c