mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04:00
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 <[email protected]> Signed-off-by: Leon Romanovsky <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
This commit is contained in:
parent
bee76d7ab5
commit
be934cca9e
7 changed files with 193 additions and 12 deletions
|
|
@ -321,6 +321,12 @@ struct ib_cq_caps {
|
|||
u16 max_cq_moderation_period;
|
||||
};
|
||||
|
||||
struct ib_dm_mr_attr {
|
||||
u64 length;
|
||||
u64 offset;
|
||||
u32 access_flags;
|
||||
};
|
||||
|
||||
struct ib_dm_alloc_attr {
|
||||
u64 length;
|
||||
u32 alignment;
|
||||
|
|
@ -1797,6 +1803,8 @@ struct ib_mr {
|
|||
struct list_head qp_entry; /* FR */
|
||||
};
|
||||
|
||||
struct ib_dm *dm;
|
||||
|
||||
/*
|
||||
* Implementation details of the RDMA core, don't use in drivers:
|
||||
*/
|
||||
|
|
@ -2444,6 +2452,9 @@ struct ib_device {
|
|||
struct ib_dm_alloc_attr *attr,
|
||||
struct uverbs_attr_bundle *attrs);
|
||||
int (*dealloc_dm)(struct ib_dm *dm);
|
||||
struct ib_mr * (*reg_dm_mr)(struct ib_pd *pd, struct ib_dm *dm,
|
||||
struct ib_dm_mr_attr *attr,
|
||||
struct uverbs_attr_bundle *attrs);
|
||||
/**
|
||||
* rdma netdev operation
|
||||
*
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue