summaryrefslogtreecommitdiff
path: root/include/rdma
diff options
context:
space:
mode:
authorAriel Levkovich <lariel@mellanox.com>2018-04-05 18:53:24 +0300
committerJason Gunthorpe <jgg@mellanox.com>2018-04-05 11:16:39 -0600
commitbee76d7ab5d270919e80e4764df7cd7e4f06ed24 (patch)
treed8ba6c8ddbc8aa781427f4c0081e8d05b47fb2d9 /include/rdma
parent1d8eeb9f6a6e0d8ac43a54fd95126044bf8d6695 (diff)
IB/uverbs: Add alloc/free dm uverbs ioctl support
This change adds uverbs support for allocation/freeing of device memory commands. A new uverbs object is defined of type idr to represent and track the new resource type allocation per context. The API requires provider driver to implement 2 new ib_device callbacks - one for allocation and one for deallocation which return and accept (respectively) the ib_dm object which represents the allocated memory on the device. The support is added via the ioctl command infrastructure only. 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')
-rw-r--r--include/rdma/ib_verbs.h20
1 files changed, 19 insertions, 1 deletions
diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h
index ed425627efd8..6806c4f5657a 100644
--- a/include/rdma/ib_verbs.h
+++ b/include/rdma/ib_verbs.h
@@ -321,6 +321,12 @@ struct ib_cq_caps {
u16 max_cq_moderation_period;
};
+struct ib_dm_alloc_attr {
+ u64 length;
+ u32 alignment;
+ u32 flags;
+};
+
struct ib_device_attr {
u64 fw_ver;
__be64 sys_image_guid;
@@ -1769,6 +1775,14 @@ struct ib_qp {
struct rdma_restrack_entry res;
};
+struct ib_dm {
+ struct ib_device *device;
+ u32 length;
+ u32 flags;
+ struct ib_uobject *uobject;
+ atomic_t usecnt;
+};
+
struct ib_mr {
struct ib_device *device;
struct ib_pd *pd;
@@ -2425,7 +2439,11 @@ struct ib_device {
int (*modify_flow_action_esp)(struct ib_flow_action *action,
const struct ib_flow_action_attrs_esp *attr,
struct uverbs_attr_bundle *attrs);
-
+ struct ib_dm * (*alloc_dm)(struct ib_device *device,
+ struct ib_ucontext *context,
+ struct ib_dm_alloc_attr *attr,
+ struct uverbs_attr_bundle *attrs);
+ int (*dealloc_dm)(struct ib_dm *dm);
/**
* rdma netdev operation
*