On 2021/11/22 19:10, Leon Romanovsky wrote: > On Mon, Nov 22, 2021 at 05:28:31PM +0800, Wenpeng Liang wrote: >> >> >> On 2021/11/22 16:58, Leon Romanovsky wrote: >>>> entry = to_hns_mmap(rdma_entry); >>>> pfn = entry->address >> PAGE_SHIFT; >>>> - prot = vma->vm_page_prot; >>>> >>>> - if (entry->mmap_type != HNS_ROCE_MMAP_TYPE_TPTR) >>>> - prot = pgprot_noncached(prot); >>>> + switch (entry->mmap_type) { >>>> + case HNS_ROCE_MMAP_TYPE_DB: >>>> + prot = pgprot_noncached(vma->vm_page_prot); >>>> + break; >>>> + case HNS_ROCE_MMAP_TYPE_TPTR: >>>> + prot = vma->vm_page_prot; >>>> + break; >>>> + case HNS_ROCE_MMAP_TYPE_DWQE: >>>> + prot = pgprot_device(vma->vm_page_prot); >>> Everything fine, except this pgprot_device(). You probably need to check >>> WC internally in your driver and use or pgprot_writecombine() or >>> pgprot_noncached() explicitly. >>> >>> Thanks >>> . >>> >> >> This issue is also discussed in the v2 version, direct wqe uses >> this prot on HIP09 can achieve better performance than NC. >> >> v2 link: https://patchwork.kernel.org/project/linux-rdma/patch/1622705834-19353-3-git-send-email-liweihang@xxxxxxxxxx/ > > But isn't it specific to ARM model that behaves such? Will it be the case > when you move to upgrade your ARM core? > > Thanks > Although the hns roce engine is a PCIe device, it is integrated into the SoC, and using pgprot_device() will bring a higher performance improvement. If the ARM core is upgraded, we will consider this issue again. Thanks Wenpeng >> >> Thanks >> Wenpeng > . >