aboutsummaryrefslogtreecommitdiffstats
path: root/include/rdma/ib_verbs.h
diff options
context:
space:
mode:
authorJason Gunthorpe <jgg@mellanox.com>2018-05-28 11:44:35 -0600
committerJason Gunthorpe <jgg@mellanox.com>2018-05-28 11:44:35 -0600
commit0394808d9ed5ca9d3595ca4d97ce79faf845ac77 (patch)
treefd183abcc31abe5baeaaabf0b00e2671e4b11ad9 /include/rdma/ib_verbs.h
parentIB/rxe: avoid unnecessary export (diff)
parentIB/mlx4: Mark user MR as writable if actual virtual memory is writable (diff)
downloadlinux-dev-0394808d9ed5ca9d3595ca4d97ce79faf845ac77.tar.xz
linux-dev-0394808d9ed5ca9d3595ca4d97ce79faf845ac77.zip
Merge branch 'mr_fix' into git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma for-next
Update mlx4 to support user MR creation against read-only memory, previously it required the memory to be writable. Based on rdma for-rc due to dependencies. * mr_fix: (2 commits) IB/mlx4: Mark user MR as writable if actual virtual memory is writable IB/core: Make testing MR flags for writability a static inline function
Diffstat (limited to 'include/rdma/ib_verbs.h')
-rw-r--r--include/rdma/ib_verbs.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h
index e849bd0fc618..406c98d7a09a 100644
--- a/include/rdma/ib_verbs.h
+++ b/include/rdma/ib_verbs.h
@@ -3766,6 +3766,20 @@ static inline int ib_check_mr_access(int flags)
return 0;
}
+static inline bool ib_access_writable(int access_flags)
+{
+ /*
+ * We have writable memory backing the MR if any of the following
+ * access flags are set. "Local write" and "remote write" obviously
+ * require write access. "Remote atomic" can do things like fetch and
+ * add, which will modify memory, and "MW bind" can change permissions
+ * by binding a window.
+ */
+ return access_flags &
+ (IB_ACCESS_LOCAL_WRITE | IB_ACCESS_REMOTE_WRITE |
+ IB_ACCESS_REMOTE_ATOMIC | IB_ACCESS_MW_BIND);
+}
+
/**
* ib_check_mr_status: lightweight check of MR status.
* This routine may provide status checks on a selected