From: Leon Romanovsky <leon@kernel.org>
To: "Wei Hu (Xavier)" <xavier.huwei@huawei.com>
Cc: dledford@redhat.com, linux-rdma@vger.kernel.org,
lijun_nudt@163.com, oulijun@huawei.com,
charles.chenxin@huawei.com, liuyixian@huawei.com,
linux-mm@kvack.org, zhangxiping3@huawei.com,
xavier.huwei@tom.com, linuxarm@huawei.com,
linux-kernel@vger.kernel.org, shaobo.xu@intel.com,
shaoboxu@tom.com, leizhen 00275356 <thunder.leizhen@huawei.com>,
joro@8bytes.org, iommu@lists.linux-foundation.org
Subject: Re: [PATCH for-next 2/4] RDMA/hns: Add IOMMU enable support in hip08
Date: Thu, 12 Oct 2017 17:54:20 +0300 [thread overview]
Message-ID: <20171012145420.GQ2106@mtr-leonro.local> (raw)
In-Reply-To: <59DF60A3.7080803@huawei.com>
[-- Attachment #1: Type: text/plain, Size: 1451 bytes --]
On Thu, Oct 12, 2017 at 08:31:31PM +0800, Wei Hu (Xavier) wrote:
>
>
> On 2017/10/1 0:10, Leon Romanovsky wrote:
> > On Sat, Sep 30, 2017 at 05:28:59PM +0800, Wei Hu (Xavier) wrote:
> > > If the IOMMU is enabled, the length of sg obtained from
> > > __iommu_map_sg_attrs is not 4kB. When the IOVA is set with the sg
> > > dma address, the IOVA will not be page continuous. and the VA
> > > returned from dma_alloc_coherent is a vmalloc address. However,
> > > the VA obtained by the page_address is a discontinuous VA. Under
> > > these circumstances, the IOVA should be calculated based on the
> > > sg length, and record the VA returned from dma_alloc_coherent
> > > in the struct of hem.
> > >
> > > Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
> > > Signed-off-by: Shaobo Xu <xushaobo2@huawei.com>
> > > Signed-off-by: Lijun Ou <oulijun@huawei.com>
> > > ---
> > Doug,
> >
> > I didn't invest time in reviewing it, but having "is_vmalloc_addr" in
> > driver code to deal with dma_alloc_coherent is most probably wrong.
> >
> > Thanks
> Hi, Leon & Doug
> We refered the function named __ttm_dma_alloc_page in the kernel code as
> below:
> And there are similar methods in bch_bio_map and mem_to_page functions
> in current 4.14-rcx.
Let's put aside TTM, I don't know the rationale behind their implementation,
but both mem_to_page and bch_bio_map are don't operate on DMA addresses
and don't belong to HW driver code.
Thanks
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2017-10-12 14:54 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-30 9:28 [PATCH for-next 0/4] Add Features & Code improvements for hip08 Wei Hu (Xavier)
2017-09-30 9:28 ` [PATCH for-next 2/4] RDMA/hns: Add IOMMU enable support in hip08 Wei Hu (Xavier)
[not found] ` <1506763741-81429-3-git-send-email-xavier.huwei-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2017-09-30 16:10 ` Leon Romanovsky
2017-10-12 12:31 ` Wei Hu (Xavier)
[not found] ` <59DF60A3.7080803-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2017-10-12 12:59 ` Robin Murphy
2017-11-01 7:46 ` Wei Hu (Xavier)
[not found] ` <59F97BBE.5070207-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2017-11-01 12:26 ` Robin Murphy
[not found] ` <fc7433af-4fa7-6b78-6bec-26941a427002-5wv7dgnIgG8@public.gmane.org>
2017-11-07 2:45 ` Wei Hu (Xavier)
[not found] ` <5A011E49.6060407-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2017-11-07 6:32 ` Leon Romanovsky
[not found] ` <20171107063209.GA18825-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
2017-11-09 1:17 ` Wei Hu (Xavier)
2017-11-07 15:48 ` Jason Gunthorpe
[not found] ` <20171107154838.GC21466-uk2M96/98Pc@public.gmane.org>
2017-11-07 15:58 ` Christoph Hellwig
[not found] ` <20171107155805.GA24082-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>
2017-11-07 16:03 ` Jason Gunthorpe
2017-11-09 1:26 ` Wei Hu (Xavier)
2017-11-09 1:30 ` Wei Hu (Xavier)
2017-11-09 1:36 ` Wei Hu (Xavier)
2017-10-12 14:54 ` Leon Romanovsky [this message]
2017-10-18 8:42 ` Wei Hu (Xavier)
[not found] ` <59E713EE.5040703-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2017-10-18 9:12 ` Wei Hu (Xavier)
[not found] ` <59E71AE2.6080202-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2017-10-18 14:23 ` Leon Romanovsky
[not found] ` <1506763741-81429-1-git-send-email-xavier.huwei-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2017-09-30 9:28 ` [PATCH for-next 1/4] RDMA/hns: Support WQE/CQE/PBL page size configurable feature " Wei Hu (Xavier)
2017-09-30 9:29 ` [PATCH for-next 3/4] RDMA/hns: Update the IRRL table chunk size " Wei Hu (Xavier)
[not found] ` <1506763741-81429-4-git-send-email-xavier.huwei-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2017-10-01 5:40 ` Leon Romanovsky
2017-10-17 11:40 ` Wei Hu (Xavier)
2017-09-30 9:29 ` [PATCH for-next 4/4] RDMA/hns: Update the PD&CQE&MTT specification " Wei Hu (Xavier)
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=20171012145420.GQ2106@mtr-leonro.local \
--to=leon@kernel.org \
--cc=charles.chenxin@huawei.com \
--cc=dledford@redhat.com \
--cc=iommu@lists.linux-foundation.org \
--cc=joro@8bytes.org \
--cc=lijun_nudt@163.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linux-rdma@vger.kernel.org \
--cc=linuxarm@huawei.com \
--cc=liuyixian@huawei.com \
--cc=oulijun@huawei.com \
--cc=shaobo.xu@intel.com \
--cc=shaoboxu@tom.com \
--cc=thunder.leizhen@huawei.com \
--cc=xavier.huwei@huawei.com \
--cc=xavier.huwei@tom.com \
--cc=zhangxiping3@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox