On Wed, Feb 13, 2019 at 9:28 PM Jason Gunthorpe <jgg@xxxxxxxx> wrote: > > On Wed, Feb 13, 2019 at 01:12:37PM +0200, Gal Pressman wrote: > > On 11-Feb-19 17:24, Shiraz Saleem wrote: > > > diff --git a/drivers/infiniband/hw/bnxt_re/qplib_res.c b/drivers/infiniband/hw/bnxt_re/qplib_res.c > > > index c8502c2..c8478c1 100644 > > > +++ b/drivers/infiniband/hw/bnxt_re/qplib_res.c > > > @@ -85,7 +85,7 @@ static void __free_pbl(struct pci_dev *pdev, struct bnxt_qplib_pbl *pbl, > > > static int __alloc_pbl(struct pci_dev *pdev, struct bnxt_qplib_pbl *pbl, > > > struct scatterlist *sghead, u32 pages, u32 pg_size) > > > { > > > - struct scatterlist *sg; > > > + struct sg_dma_page_iter sg_iter; > > > bool is_umem = false; > > > int i; > > > > > > @@ -116,12 +116,13 @@ static int __alloc_pbl(struct pci_dev *pdev, struct bnxt_qplib_pbl *pbl, > > > } else { > > > i = 0; > > > is_umem = true; > > > - for_each_sg(sghead, sg, pages, i) { > > > - pbl->pg_map_arr[i] = sg_dma_address(sg); > > > - pbl->pg_arr[i] = sg_virt(sg); > > > + for_each_sg_dma_page(sghead, &sg_iter, pages, 0) { > > > + pbl->pg_map_arr[i] = sg_page_iter_dma_address(&sg_iter); > > > + pbl->pg_arr[i] = NULL; > > if (!pbl->pg_arr[i]) > > > > Surely something went wrong here? > > That if does look wrong. > > I recall Shiraz removed the pg_arr as it wasn't being used, so maybe > the if should go to? > > Devesh? > > Someone send a patch... We will sent the patch. > > Jason