Re: [PATCH for-next 19/23] RDMA/hfi2: Add in support for verbs

Jason Gunthorpe
2025-08-25T14:45:08Z

On Mon, Jun 30, 2025 at 11:31:23AM -0400, Dennis Dalessandro wrote:

> +int hfi2_rdma_mmap(struct ib_ucontext *ucontext, struct vm_area_struct *vma)
> +{
> + struct rvt_ucontext *rcontext = container_of(ucontext, struct rvt_ucontext, ibucontext);
> + struct hfi2_filedata *fd = rcontext->priv;
> + unsigned long token;
> + u8 type;
> +
> + if (!fd)
> + return -EINVAL;
> +
> + token = vma->vm_pgoff << PAGE_SHIFT;
> + type = rdma_mmap_get_type(token);
> +
> + return hfi2_do_mmap(fd, type, vma);
> +}

New drivers need to use the new mmap infrastructure, so this should be
all be modernized here too

Jason