summaryrefslogtreecommitdiff
path: root/include/rdma
diff options
context:
space:
mode:
authorMoni Shoua <monis@mellanox.com>2020-01-15 15:43:32 +0300
committerLeon Romanovsky <leonro@mellanox.com>2020-01-16 17:14:36 +0300
commit33006bd4f37f7d2c3d1cf0268b4f327b5fdc2558 (patch)
tree3bac9bd2dd2756a60df3a798420008f3654c4216 /include/rdma
parentc320e527e1548305f31d95ec405140b04aed25f5 (diff)
downloadlinux-33006bd4f37f7d2c3d1cf0268b4f327b5fdc2558.tar.xz
IB/core: Introduce ib_reg_user_mr
Add ib_reg_user_mr() for kernel ULPs to register user MRs. The common use case that uses this function is a userspace application that allocates memory for HCA access but the responsibility to register the memory at the HCA is on an kernel ULP. This ULP that acts as an agent for the userspace application. This function is intended to be used without a user context so vendor drivers need to be aware of calling reg_user_mr() device operation with udata equal to NULL. Among all drivers, i40iw is the only driver which relies on presence of udata, so check udata existence for that driver. Signed-off-by: Moni Shoua <monis@mellanox.com> Reviewed-by: Guy Levi <guyle@mellanox.com> Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Diffstat (limited to 'include/rdma')
-rw-r--r--include/rdma/ib_verbs.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h
index 5608e14e3aad..170d5ec95b79 100644
--- a/include/rdma/ib_verbs.h
+++ b/include/rdma/ib_verbs.h
@@ -4153,6 +4153,12 @@ static inline void ib_dma_free_coherent(struct ib_device *dev,
dma_free_coherent(dev->dma_device, size, cpu_addr, dma_handle);
}
+/* ib_reg_user_mr - register a memory region for virtual addresses from kernel
+ * space. This function should be called when 'current' is the owning MM.
+ */
+struct ib_mr *ib_reg_user_mr(struct ib_pd *pd, u64 start, u64 length,
+ u64 virt_addr, int mr_access_flags);
+
/**
* ib_dereg_mr_user - Deregisters a memory region and removes it from the
* HCA translation table.