Commit 97bca9c6 authored by Jiasen Lin's avatar Jiasen Lin Committed by Yang Yingliang
Browse files

NTB: ntb_perf: Fix address err in perf_copy_chunk



mainline inclusion
from mainline-v5.7-rc1
commit 99a06056
category: bugfix
bugzilla: NA
CVE: NA
---------------------------

peer->outbuf is a virtual address which is get by ioremap, it can not
be converted to a physical address by virt_to_page and page_to_phys.
This conversion will result in DMA error, because the destination address
which is converted by page_to_phys is invalid.

This patch save the MMIO address of NTB BARx in perf_setup_peer_mw,
and map the BAR space to DMA address after we assign the DMA channel.
Then fill the destination address of DMA descriptor with this DMA address
to guarantee that the address of memory write requests fall into
memory window of NBT BARx with IOMMU enabled and disabled.

Fixes: 5648e56d ("NTB: ntb_perf: Add full multi-port NTB API support")
Signed-off-by: default avatarJiasen Lin <linjiasen@hygon.cn>
Reviewed-by: default avatarLogan Gunthorpe <logang@deltatee.com>
Signed-off-by: default avatarJon Mason <jdmason@kudzu.us>
Signed-off-by: default avatarHanjun Guo <guohanjun@huawei.com>
Reviewed-by: default avatarXie XiuQi <xiexiuqi@huawei.com>
Signed-off-by: default avatarYang Yingliang <yangyingliang@huawei.com>
parent 66feadda
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment