From: Christoph Hellwig <hch@infradead.org>
To: Sherry Sun <sherry.sun@nxp.com>
Cc: Christoph Hellwig <hch@infradead.org>,
"sudeep.dutt@intel.com" <sudeep.dutt@intel.com>,
"ashutosh.dixit@intel.com" <ashutosh.dixit@intel.com>,
"arnd@arndb.de" <arnd@arndb.de>,
"gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
"kishon@ti.com" <kishon@ti.com>,
"lorenzo.pieralisi@arm.com" <lorenzo.pieralisi@arm.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-pci@vger.kernel.org" <linux-pci@vger.kernel.org>,
dl-linux-imx <linux-imx@nxp.com>
Subject: Re: [PATCH V2 3/4] misc: vop: simply return the saved dma address instead of virt_to_phys
Date: Mon, 5 Oct 2020 14:42:40 +0100 [thread overview]
Message-ID: <20201005134240.GA11178@infradead.org> (raw)
In-Reply-To: <VI1PR04MB4960288477F1DA7AB56D4ECC92330@VI1PR04MB4960.eurprd04.prod.outlook.com>
On Wed, Sep 30, 2020 at 07:30:21AM +0000, Sherry Sun wrote:
> There may be some misunderstandings here.
> For ->get_dp_dma callback, it is used to get the device page dma address,
> which is allocated by MIC layer instead of vop layer.
> For Intel mic, it still use kzalloc and dma_map_single apis, although we
> recommended and we did use dma_alloc_coherent to get consistent device
> page memory on our i.MX platform, but we didn't change the original implementation
> method of Intel mic till now, as our main goal is to change the vop code to make it
> more generic.
Given how the memory is used everyone should use dma_alloc_coherent.
Note that for x86 the ony difference is that dma_alloc_coherent also
dips into the CMA pools where available, which eases allocator pressure,
and that it properly deals with the AMD SEV memory encryption, which
does't matter for Intel platforms.
> Which is means that the device page may use different allocate methods for
> different platform, and now it is transparent to the vop layer.
> So I think here use ->get_dp_dma callback to get device page dma address
> is the most simple and convenient way.
>
> We change to use dma_alloc_coherent in patch 1 to allocate vrings memory, as it is
> the main job that the vop layer is responsible for.
> So I still suggest to use ->get_dp or ->get_dp_dma callback for device page here, what do you think?
As mentioned you need to move the code to mmap the buffers to the
same layer as the one doing the allocation. If that is taken care of
we're fine, and I think a ->mmap callback might be the best way to
archive that, but this is not code I know intimately.
next prev parent reply other threads:[~2020-10-05 13:42 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-29 8:44 [PATCH V2 0/4] Change vring space from nomal memory to dma coherent memory Sherry Sun
2020-09-29 8:44 ` [PATCH V2 1/4] misc: vop: change the way of allocating vring Sherry Sun
2020-09-29 10:23 ` Christoph Hellwig
2020-09-29 13:02 ` Sherry Sun
2020-09-29 8:44 ` [PATCH V2 2/4] misc: vop: do not allocate and reassign the used ring Sherry Sun
2020-09-29 10:24 ` Christoph Hellwig
2020-09-29 13:02 ` Sherry Sun
2020-09-29 14:28 ` David Laight
2020-09-29 8:44 ` [PATCH V2 3/4] misc: vop: simply return the saved dma address instead of virt_to_phys Sherry Sun
2020-09-29 10:26 ` Christoph Hellwig
2020-09-29 13:10 ` Sherry Sun
2020-09-29 18:11 ` Christoph Hellwig
2020-09-30 7:30 ` Sherry Sun
2020-10-05 13:42 ` Christoph Hellwig [this message]
2020-09-29 8:44 ` [PATCH V2 4/4] misc: vop: mapping kernel memory to user space as noncached Sherry Sun
2020-09-29 10:28 ` Christoph Hellwig
2020-09-29 13:12 ` Sherry Sun
2020-09-29 15:39 ` David Laight
2020-10-13 2:02 ` Sherry Sun
2020-10-20 1:33 ` Sherry Sun
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=20201005134240.GA11178@infradead.org \
--to=hch@infradead.org \
--cc=arnd@arndb.de \
--cc=ashutosh.dixit@intel.com \
--cc=gregkh@linuxfoundation.org \
--cc=kishon@ti.com \
--cc=linux-imx@nxp.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=lorenzo.pieralisi@arm.com \
--cc=sherry.sun@nxp.com \
--cc=sudeep.dutt@intel.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;
as well as URLs for NNTP newsgroup(s).