Commit 690f0f9f authored by Cai Huoqing's avatar Cai Huoqing Committed by Zheng Zengkai
Browse files

RDMA/hns: Use dma_alloc_coherent() instead of kmalloc/dma_map_single()

mainline inclusion
from mainline-v5.15-rc5
commit 9a33f398
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I4QOTS
CVE: NA

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma.git/commit/?id=9a33f3980978e420672b0b54e3fa0c7908fd7c78

---------------------------------------------------------------------

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.com


Signed-off-by: default avatarCai Huoqing <caihuoqing@baidu.com>
Reviewed-by: default avatarWenpeng Liang <liangwenpeng@huawei.com>
Tested-by: default avatarWenpeng Liang <liangwenpeng@huawei.com>
Signed-off-by: default avatarJason Gunthorpe <jgg@nvidia.com>
sigend-off-by: default avatarGuofeng Yue <yueguofeng@hisilicon.com>

Reviewed-by: default avatarYangyang Li <liyangyang20@huawei.com>
Acked-by: default avatarXie XiuQi <xiexiuqi@huawei.com>
Signed-off-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
parent 1b5e8433
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment