lkml.org 
[lkml]   [2021]   [Oct]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] RDMA/hns: Use dma_alloc_coherent() instead of kmalloc/dma_map_single()
From
Date
On 2021/10/9 18:42, Cai Huoqing wrote:
> 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
> .
>

Hi, Cai

After testing, it seems ok to me.

Reviewed-by: Wenpeng Liang <liangwenpeng@huawei.com>
Tested-by: Wenpeng Liang <liangwenpeng@huawei.com>

Thanks,
Wenpeng

\
 
 \ /
  Last update: 2021-10-09 14:04    [W:0.043 / U:0.188 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site