forked from Minki/linux
f7c6a7b5d5
Export ib_umem_get()/ib_umem_release() and put low-level drivers in control of when to call ib_umem_get() to pin and DMA map userspace, rather than always calling it in ib_uverbs_reg_mr() before calling the low-level driver's reg_user_mr method. Also move these functions to be in the ib_core module instead of ib_uverbs, so that driver modules using them do not depend on ib_uverbs. This has a number of advantages: - It is better design from the standpoint of making generic code a library that can be used or overridden by device-specific code as the details of specific devices dictate. - Drivers that do not need to pin userspace memory regions do not need to take the performance hit of calling ib_mem_get(). For example, although I have not tried to implement it in this patch, the ipath driver should be able to avoid pinning memory and just use copy_{to,from}_user() to access userspace memory regions. - Buffers that need special mapping treatment can be identified by the low-level driver. For example, it may be possible to solve some Altix-specific memory ordering issues with mthca CQs in userspace by mapping CQ buffers with extra flags. - Drivers that need to pin and DMA map userspace memory for things other than memory regions can use ib_umem_get() directly, instead of hacks using extra parameters to their reg_phys_mr method. For example, the mlx4 driver that is pending being merged needs to pin and DMA map QP and CQ buffers, but it does not need to create a memory key for these buffers. So the cleanest solution is for mlx4 to call ib_umem_get() in the create_qp and create_cq methods. Signed-off-by: Roland Dreier <rolandd@cisco.com> |
||
---|---|---|
.. | ||
ipath_common.h | ||
ipath_cq.c | ||
ipath_debug.h | ||
ipath_diag.c | ||
ipath_dma.c | ||
ipath_driver.c | ||
ipath_eeprom.c | ||
ipath_file_ops.c | ||
ipath_fs.c | ||
ipath_iba6110.c | ||
ipath_iba6120.c | ||
ipath_init_chip.c | ||
ipath_intr.c | ||
ipath_kernel.h | ||
ipath_keys.c | ||
ipath_layer.c | ||
ipath_layer.h | ||
ipath_mad.c | ||
ipath_mmap.c | ||
ipath_mr.c | ||
ipath_qp.c | ||
ipath_rc.c | ||
ipath_registers.h | ||
ipath_ruc.c | ||
ipath_srq.c | ||
ipath_stats.c | ||
ipath_sysfs.c | ||
ipath_uc.c | ||
ipath_ud.c | ||
ipath_user_pages.c | ||
ipath_verbs_mcast.c | ||
ipath_verbs.c | ||
ipath_verbs.h | ||
ipath_wc_ppc64.c | ||
ipath_wc_x86_64.c | ||
Kconfig | ||
Makefile |