diff options
author | Ariel Levkovich <lariel@mellanox.com> | 2018-04-05 17:53:25 +0200 |
---|---|---|
committer | Jason Gunthorpe <jgg@mellanox.com> | 2018-04-05 19:16:39 +0200 |
commit | be934cca9e987e73eb20e3c80731a9580d5acc79 (patch) | |
tree | 5f86dc099337c73984135db42a3ec003416b5ca8 /include/rdma/uverbs_ioctl.h | |
parent | IB/uverbs: Add alloc/free dm uverbs ioctl support (diff) | |
download | linux-be934cca9e987e73eb20e3c80731a9580d5acc79.tar.xz linux-be934cca9e987e73eb20e3c80731a9580d5acc79.zip |
IB/uverbs: Add device memory registration ioctl support
Adding new ioctl method for the MR object - REG_DM_MR.
This command can be used by users to register an allocated
device memory buffer as an MR and receive lkey and rkey
to be used within work requests.
It is added as a new method under the MR object and using a new
ib_device callback - reg_dm_mr.
The command creates a standard ib_mr object which represents the
registered memory.
Signed-off-by: Ariel Levkovich <lariel@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Diffstat (limited to 'include/rdma/uverbs_ioctl.h')
-rw-r--r-- | include/rdma/uverbs_ioctl.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/include/rdma/uverbs_ioctl.h b/include/rdma/uverbs_ioctl.h index 3d6ac684b8f0..4a4201d997a7 100644 --- a/include/rdma/uverbs_ioctl.h +++ b/include/rdma/uverbs_ioctl.h @@ -408,6 +408,18 @@ static inline int uverbs_attr_get_enum_id(const struct uverbs_attr_bundle *attrs return attr->ptr_attr.enum_id; } +static inline void *uverbs_attr_get_obj(const struct uverbs_attr_bundle *attrs_bundle, + u16 idx) +{ + struct ib_uobject *uobj = + uverbs_attr_get(attrs_bundle, idx)->obj_attr.uobject; + + if (IS_ERR(uobj)) + return uobj; + + return uobj->object; +} + static inline int uverbs_copy_to(const struct uverbs_attr_bundle *attrs_bundle, size_t idx, const void *from, size_t size) { |