On 2021/8/20 7:43, Jason Gunthorpe wrote: > On Thu, Jul 29, 2021 at 10:19:20AM +0800, Wenpeng Liang wrote: > >> +static int hns_roce_mmap(struct ib_ucontext *uctx, struct vm_area_struct *vma) >> +{ >> + switch (hns_roce_mmap_get_command(vma->vm_pgoff)) { >> + case HNS_ROCE_MMAP_REGULAR_PAGE: >> + return mmap_uar(uctx, vma); >> + case HNS_ROCE_MMAP_DCA_PAGE: >> + return mmap_dca(uctx, vma); >> + default: >> + return -EINVAL; >> + } >> +} > > New code should not copy the vm_pgoff stuff from old mlx5. > > New code needs to use the mmap infrastructure and new APIs with proper > mmap cookies for the things it is exporting. > > See the newer stuff added to mlx5, the efa driver, etc. > > Jason > . > The new code will be implemented according to the new APIs, while the old code will continue to be retained for compatibility.