On Fri, Dec 03, 2021 at 06:18:55PM +0800, Barry Song wrote: > > + 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; > > + /* > > + * The BAR region of direct WQE supports Early Write Ack, > > + * so pgprot_device is used to improve performance. > > + */ > > + case HNS_ROCE_MMAP_TYPE_DWQE: > > + prot = pgprot_device(vma->vm_page_prot); > > + break; > > + default: > > + return -EINVAL; > > + } > > i am still not convinced why HNS_ROCE_MMAP_TYPE_DB needs nocache and > HNS_ROCE_MMAP_TYPE_DWQE needs device. generally people use ioremap() > to map pci bar spaces in pci device drivers, and ioremap() is pretty > much nGnRE: Me too, please confirm with your HW that the device really cannot handle device for the DB, and it is better to put the comment on the noncached case as that is the obnormal thing here. Jason