Re: [PATCH 11/16] IB uverbs: add mthca mmap support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Roland Dreier <[email protected]> wrote:
>
> Add support for mmap() method to mthca, so that userspace can get
> access to doorbell registers.  This allows userspace to get direct
> access to the HCA for data path operations.
> 
> Each userspace context gets its own copy of the doorbell registers and
> is only allowed to use resources that the kernel has given it access
> to.  In other words, this is safe.
> 
> ...
>  
> +static int mthca_mmap_uar(struct ib_ucontext *context,
> +			  struct vm_area_struct *vma)
> +{
> +	if (vma->vm_end - vma->vm_start != PAGE_SIZE)
> +		return -EINVAL;
> +
> +	vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
> +	vma->vm_flags    |= VM_DONTCOPY;
> +
> +	if (remap_pfn_range(vma, vma->vm_start,
> +			    to_mucontext(context)->uar.pfn,
> +			    PAGE_SIZE, vma->vm_page_prot))
> +		return -EAGAIN;
> +
> +	return 0;
> +}

What's the thinking behind the VM_DONTCOPY there?

What's actually being mapped here?  Hardware?  If so, is VM_IO not needed?
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux