diff options
author | Jason Gunthorpe <jgg@mellanox.com> | 2018-05-28 20:44:35 +0300 |
---|---|---|
committer | Jason Gunthorpe <jgg@mellanox.com> | 2018-05-28 20:44:35 +0300 |
commit | 0394808d9ed5ca9d3595ca4d97ce79faf845ac77 (patch) | |
tree | fd183abcc31abe5baeaaabf0b00e2671e4b11ad9 /include/rdma/ib_verbs.h | |
parent | bb42f87e2924e3b118aed3b3790ce792ae7bb86c (diff) | |
parent | d8f9cc328c8888369880e2527e9186d745f2bbf6 (diff) | |
download | linux-0394808d9ed5ca9d3595ca4d97ce79faf845ac77.tar.xz |
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.h | 14 |
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 |