linux-rdma.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Cai Huoqing <caihuoqing@baidu.com>
To: Wenpeng Liang <liangwenpeng@huawei.com>
Cc: Jason Gunthorpe <jgg@nvidia.com>, Lijun Ou <oulijun@huawei.com>,
	"Weihang Li" <liweihang@huawei.com>,
	Doug Ledford <dledford@redhat.com>, <linux-rdma@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] RDMA/hns: Use dma_alloc_coherent() instead of kmalloc/dma_map_single()
Date: Sat, 9 Oct 2021 18:42:46 +0800	[thread overview]
Message-ID: <20211009104246.GA1205@LAPTOP-UKSR4ENP.internal.baidu.com> (raw)
In-Reply-To: <07922740-2d3d-50dc-7239-421e39c42142@huawei.com>

On 09 10月 21 17:50:50, Wenpeng Liang wrote:
> 
> 
> On 2021/10/5 3:52, Jason Gunthorpe wrote:
> > On Mon, Sep 27, 2021 at 08:59:13AM -0300, Jason Gunthorpe wrote:
> >> On Sun, Sep 26, 2021 at 02:11:15PM +0800, Cai Huoqing wrote:
> >>> Replacing kmalloc/kfree/dma_map_single/dma_unmap_single()
> >>> with dma_alloc_coherent/dma_free_coherent() helps to reduce
> >>> code size, and simplify the code, and coherent DMA will not
> >>> clear the cache every time.
> >>>
> >>> Signed-off-by: Cai Huoqing <caihuoqing@baidu.com>
> >>>  drivers/infiniband/hw/hns/hns_roce_hw_v2.c | 20 +++++---------------
> >>>  1 file changed, 5 insertions(+), 15 deletions(-)
> >>
> >> Given I don't see any dma_sync_single calls for this mapping, isn't
> >> this a correctness fix too?
> > 
> > HNS folks?
> > 
> > Jason
> > .
> > 
> 
> Our SoC can keep cache coherent, so there is no exception even if
> dma_sync_single* is not called, but the driver should not make
> assumptions about SoC.
> 
> So using dma_alloc_coherent() instead of kmalloc/dma_map_single()
> can simplify the code and achieve the same purpose.
> 
> Wenpeng Liang


Hi Liang

Thanks for your feedback.

If you think my patch is correct, you can give a Reviewed-by: to it.
You can also give a Tested-by: to it, if the test on hardware was made.

Thanks
Cai

  reply	other threads:[~2021-10-09 10:42 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-26  6:11 [PATCH] RDMA/hns: Use dma_alloc_coherent() instead of kmalloc/dma_map_single() Cai Huoqing
2021-09-27 11:59 ` Jason Gunthorpe
2021-10-04 19:52   ` Jason Gunthorpe
2021-10-09  9:50     ` Wenpeng Liang
2021-10-09 10:42       ` Cai Huoqing [this message]
2021-10-09 12:03         ` Wenpeng Liang
2021-10-12 16:11 ` Jason Gunthorpe

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=20211009104246.GA1205@LAPTOP-UKSR4ENP.internal.baidu.com \
    --to=caihuoqing@baidu.com \
    --cc=dledford@redhat.com \
    --cc=jgg@nvidia.com \
    --cc=liangwenpeng@huawei.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=liweihang@huawei.com \
    --cc=oulijun@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;
as well as URLs for NNTP newsgroup(s).