Re: [PATCH for-next 1/6] RDMA/bnxt_re: Use the common mmap helper functions

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

 



On Mon, Apr 10, 2023 at 04:11:50AM -0700, Selvin Xavier wrote:
> Replace the mmap handling function with common code in
> IB core. Create rdma_user_mmap_entry for each mmap
> resource and add to the ib_core mmap list. Add mmap_free
> verb support. Also, use rdma_user_mmap_io while mapping
> Doorbell pages.
> 
> Signed-off-by: Selvin Xavier <selvin.xavier@xxxxxxxxxxxx>
> ---
>  drivers/infiniband/hw/bnxt_re/ib_verbs.c  | 110 ++++++++++++++++++++++++++----
>  drivers/infiniband/hw/bnxt_re/ib_verbs.h  |  15 ++++
>  drivers/infiniband/hw/bnxt_re/main.c      |   1 +
>  drivers/infiniband/hw/bnxt_re/qplib_fp.c  |  10 +--
>  drivers/infiniband/hw/bnxt_re/qplib_res.c |   2 +-
>  5 files changed, 115 insertions(+), 23 deletions(-)
> 
> diff --git a/drivers/infiniband/hw/bnxt_re/ib_verbs.c b/drivers/infiniband/hw/bnxt_re/ib_verbs.c
> index e86afec..c9d134c 100644
> --- a/drivers/infiniband/hw/bnxt_re/ib_verbs.c
> +++ b/drivers/infiniband/hw/bnxt_re/ib_verbs.c
> @@ -533,12 +533,42 @@ static int bnxt_re_create_fence_mr(struct bnxt_re_pd *pd)
>  	return rc;
>  }
>  
> +static struct rdma_user_mmap_entry*
> +bnxt_re_mmap_entry_insert(struct bnxt_re_ucontext *uctx, u64 mem_offset,
> +			  enum bnxt_re_mmap_flag mmap_flag, u64 *offset)
> +{
> +	struct bnxt_re_user_mmap_entry *entry = kzalloc(sizeof(*entry), GFP_KERNEL);

Please separate calls to kzalloc() and variable initialization.

Thanks



[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