aboutsummaryrefslogtreecommitdiffstats
path: root/include/rdma/uverbs_std_types.h
diff options
context:
space:
mode:
authorMark Bloch <markb@mellanox.com>2018-09-06 17:27:02 +0300
committerJason Gunthorpe <jgg@mellanox.com>2018-09-11 09:28:06 -0600
commit86e1d464a8ccd627b6ea3e9a98a0389b0d27fd1f (patch)
tree8ed6bfd4271a810cf23f3d42b8fbfd50825a3523 /include/rdma/uverbs_std_types.h
parentIB/uverbs: Add IDRs array attribute type to ioctl() interface (diff)
downloadlinux-dev-86e1d464a8ccd627b6ea3e9a98a0389b0d27fd1f.tar.xz
linux-dev-86e1d464a8ccd627b6ea3e9a98a0389b0d27fd1f.zip
RDMA/uverbs: Move flow resources initialization
Use ib_set_flow() when initializing flow related resources. Signed-off-by: Mark Bloch <markb@mellanox.com> Reviewed-by: Yishai Hadas <yishaih@mellanox.com> Signed-off-by: Leon Romanovsky <leonro@mellanox.com> Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Diffstat (limited to 'include/rdma/uverbs_std_types.h')
-rw-r--r--include/rdma/uverbs_std_types.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/include/rdma/uverbs_std_types.h b/include/rdma/uverbs_std_types.h
index 526d918fcd5a..dfd6d35f1783 100644
--- a/include/rdma/uverbs_std_types.h
+++ b/include/rdma/uverbs_std_types.h
@@ -152,5 +152,38 @@ static inline void uverbs_flow_action_fill_action(struct ib_flow_action *action,
uobj->object = action;
}
+struct ib_uflow_resources {
+ size_t max;
+ size_t num;
+ size_t collection_num;
+ size_t counters_num;
+ struct ib_counters **counters;
+ struct ib_flow_action **collection;
+};
+
+struct ib_uflow_object {
+ struct ib_uobject uobject;
+ struct ib_uflow_resources *resources;
+};
+
+static inline void ib_set_flow(struct ib_uobject *uobj, struct ib_flow *ibflow,
+ struct ib_qp *qp, struct ib_device *device,
+ struct ib_uflow_resources *uflow_res)
+{
+ struct ib_uflow_object *uflow;
+
+ uobj->object = ibflow;
+ ibflow->uobject = uobj;
+
+ if (qp) {
+ atomic_inc(&qp->usecnt);
+ ibflow->qp = qp;
+ }
+
+ ibflow->device = device;
+ uflow = container_of(uobj, typeof(*uflow), uobject);
+ uflow->resources = uflow_res;
+}
+
#endif