RDMA/hns: Use dma_alloc_coherent() instead of kmalloc/dma_map_single()
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. The SOC that this driver supports does not have incoherent DMA, so this makes the code follow the DMA API properly with no performance impact. Currently there are missing dma sync calls around the DMA transfers. Link: https://lore.kernel.org/r/20210926061116.282-1-caihuoqing@baidu.comSigned-off-by:Cai Huoqing <caihuoqing@baidu.com> Reviewed-by:
Wenpeng Liang <liangwenpeng@huawei.com> Tested-by:
Wenpeng Liang <liangwenpeng@huawei.com> Signed-off-by:
Jason Gunthorpe <jgg@nvidia.com>
Showing
Please register or sign in to comment