Re: [PATCH rdma-next v1 5/6] RDMA/bnxt_re: Use umem APIs to retrieve aligned DMA address

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Feb 19, 2019 at 01:18:49PM -0800, Ira Weiny wrote:
> On Tue, Feb 19, 2019 at 08:57:44AM -0600, Shiraz Saleem wrote:
> > Call the core helpers to retrieve the HW aligned
> > address to use for the MR, within a supported bnxt_re
> > page size.
> > 
> > Remove checking the umem->hugtetlb flag as it is no
> > longer required. The core helpers will return the 2M
> > aligned address if the MR is backed by 2M huge pages.
> > 
> > Cc: Selvin Xavier <selvin.xavier@xxxxxxxxxxxx>
> > Cc: Devesh Sharma <devesh.sharma@xxxxxxxxxxxx>
> > Signed-off-by: Shiraz Saleem <shiraz.saleem@xxxxxxxxx>
[...]
 
> > @@ -3623,7 +3619,9 @@ struct ib_mr *bnxt_re_reg_user_mr(struct ib_pd *ib_pd, u64 start, u64 length,
> >  		goto free_umem;
> >  	}
> >  
> > -	page_shift = PAGE_SHIFT;
> > +	page_shift = __ffs(ib_umem_find_single_pg_size(umem,
> > +				BNXT_RE_PAGE_SIZE_4K | BNXT_RE_PAGE_SIZE_2M,
> > +				virt_addr));
> 
> Maybe this is impossible but __ffs requires the value to not be 0 and
> ib_umem_find_single_pg_size may return 0?
It is expected that the driver supports the system page size or smaller.
Othewrise, its possible. The API will also throw a WARN_ON.   

> 
> Is this not possible with this driver?
>

 



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux