summaryrefslogtreecommitdiffstats
path: root/include/rdma
diff options
context:
space:
mode:
authorMark Bloch <markb@mellanox.com>2018-08-28 14:18:52 +0300
committerJason Gunthorpe <jgg@mellanox.com>2018-09-05 15:23:59 -0600
commit841eefc5cb57030ad05a0c4bc285f93ffa668ad9 (patch)
tree9a5a4891a03844f0c9ce533e720bafef0c7c4003 /include/rdma
parentb4749bf25652689d8e33827460266b78bb2ec42c (diff)
downloadlinux-841eefc5cb57030ad05a0c4bc285f93ffa668ad9.tar.gz
linux-841eefc5cb57030ad05a0c4bc285f93ffa668ad9.tar.bz2
linux-841eefc5cb57030ad05a0c4bc285f93ffa668ad9.zip
RDMA/uverbs: Add generic function to fill in flow action object
Refactor the initialization of a flow action object to a common function. Signed-off-by: Mark Bloch <markb@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/uverbs_std_types.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/rdma/uverbs_std_types.h b/include/rdma/uverbs_std_types.h
index 3b00231cc084..526d918fcd5a 100644
--- a/include/rdma/uverbs_std_types.h
+++ b/include/rdma/uverbs_std_types.h
@@ -140,5 +140,17 @@ __uobj_alloc(const struct uverbs_api_object *obj, struct ib_uverbs_file *ufile,
#define uobj_alloc(_type, _ufile, _ib_dev) \
__uobj_alloc(uobj_get_type(_ufile, _type), _ufile, _ib_dev)
+static inline void uverbs_flow_action_fill_action(struct ib_flow_action *action,
+ struct ib_uobject *uobj,
+ struct ib_device *ib_dev,
+ enum ib_flow_action_type type)
+{
+ atomic_set(&action->usecnt, 0);
+ action->device = ib_dev;
+ action->type = type;
+ action->uobject = uobj;
+ uobj->object = action;
+}
+
#endif