Re: [PATCH v4 for-next] RDMA/hns: Add a new mmap implementation

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

 



On Thu, Oct 28, 2021 at 06:56:40PM +0800, Wenpeng Liang wrote:
> From: Chengchang Tang <tangchengchang@xxxxxxxxxx>
> 
> Add a new implementation for mmap by using the new mmap entry API.
> 
> Signed-off-by: Chengchang Tang <tangchengchang@xxxxxxxxxx>
> Signed-off-by: Yixing Liu <liuyixing1@xxxxxxxxxx>
> Signed-off-by: Wenpeng Liang <liangwenpeng@xxxxxxxxxx>
> ---
>  drivers/infiniband/hw/hns/hns_roce_device.h |  23 ++++
>  drivers/infiniband/hw/hns/hns_roce_main.c   | 142 ++++++++++++++++----
>  include/rdma/ib_verbs.h                     |   8 ++
>  3 files changed, 146 insertions(+), 27 deletions(-)

Applied to for-next, thanks

> +static int hns_roce_mmap(struct ib_ucontext *uctx, struct vm_area_struct *vma)
>  {
> -	struct hns_roce_dev *hr_dev = to_hr_dev(context->device);
> -
> -	switch (vma->vm_pgoff) {
> -	case 0:
> -		return rdma_user_mmap_io(context, vma,
> -					 to_hr_ucontext(context)->uar.pfn,
> -					 PAGE_SIZE,
> -					 pgprot_noncached(vma->vm_page_prot),
> -					 NULL);
> -
> -	/* vm_pgoff: 1 -- TPTR */
> -	case 1:
> -		if (!hr_dev->tptr_dma_addr || !hr_dev->tptr_size)
> -			return -EINVAL;
> -		/*
> -		 * FIXME: using io_remap_pfn_range on the dma address returned
> -		 * by dma_alloc_coherent is totally wrong.
> -		 */
> -		return rdma_user_mmap_io(context, vma,
> -					 hr_dev->tptr_dma_addr >> PAGE_SHIFT,
> -					 hr_dev->tptr_size,
> -					 vma->vm_page_prot,
> -					 NULL);
> +	struct hns_roce_dev *hr_dev = to_hr_dev(uctx->device);
> +	struct ib_device *ibdev = &hr_dev->ib_dev;

These two variables are unused, I deleted them

Jason



[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