All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg@nvidia.com>
To: Wenpeng Liang <liangwenpeng@huawei.com>
Cc: dledford@redhat.com, linux-rdma@vger.kernel.org, linuxarm@huawei.com
Subject: Re: [PATCH v4 for-next] RDMA/hns: Add a new mmap implementation
Date: Fri, 29 Oct 2021 14:08:38 -0300	[thread overview]
Message-ID: <20211029170838.GA872068@nvidia.com> (raw)
In-Reply-To: <20211028105640.1056-1-liangwenpeng@huawei.com>

On Thu, Oct 28, 2021 at 06:56:40PM +0800, Wenpeng Liang wrote:
> From: Chengchang Tang <tangchengchang@huawei.com>
> 
> Add a new implementation for mmap by using the new mmap entry API.
> 
> Signed-off-by: Chengchang Tang <tangchengchang@huawei.com>
> Signed-off-by: Yixing Liu <liuyixing1@huawei.com>
> Signed-off-by: Wenpeng Liang <liangwenpeng@huawei.com>
> ---
>  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

      reply	other threads:[~2021-10-29 17:08 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-28 10:56 [PATCH v4 for-next] RDMA/hns: Add a new mmap implementation Wenpeng Liang
2021-10-29 17:08 ` Jason Gunthorpe [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211029170838.GA872068@nvidia.com \
    --to=jgg@nvidia.com \
    --cc=dledford@redhat.com \
    --cc=liangwenpeng@huawei.com \
    --cc=linux-rdma@vger.kernel.org \
    --cc=linuxarm@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.