diff options
author | Yishai Hadas <yishaih@mellanox.com> | 2018-07-23 15:25:09 +0300 |
---|---|---|
committer | Jason Gunthorpe <jgg@mellanox.com> | 2018-07-24 23:03:49 +0300 |
commit | 32269441240064c7475241ae28fee787fcdf55b9 (patch) | |
tree | 85341db77286ba0ec948b96a92f1f0caa848e62b /include/rdma/uverbs_named_ioctl.h | |
parent | 6cd080a674a7adce97c0189c4579cf40782c2770 (diff) | |
download | linux-32269441240064c7475241ae28fee787fcdf55b9.tar.xz |
IB/mlx5: Introduce driver create and destroy flow methods
Introduce driver create and destroy flow methods on the uverbs flow
object.
This allows the driver to get its specific device attributes to match the
underlay specification while still using the generic ib_flow object for
cleanup and code sharing.
The IB object's attributes are set via the ib_set_flow() helper function.
The specific implementation for the given specification is added in
downstream patches.
Signed-off-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_named_ioctl.h')
-rw-r--r-- | include/rdma/uverbs_named_ioctl.h | 29 |
1 files changed, 17 insertions, 12 deletions
diff --git a/include/rdma/uverbs_named_ioctl.h b/include/rdma/uverbs_named_ioctl.h index 2eb1767042af..b3b21733cc55 100644 --- a/include/rdma/uverbs_named_ioctl.h +++ b/include/rdma/uverbs_named_ioctl.h @@ -97,22 +97,14 @@ .methods = &UVERBS_OBJECT_METHODS(_object_id) \ } -/* Used by drivers to declare a complete parsing tree for a single method that - * differs only in having additional driver specific attributes. +/* Used by drivers to declare a complete parsing tree for new methods */ -#define ADD_UVERBS_ATTRIBUTES_SIMPLE(_name, _object_id, _method_id, ...) \ - static const struct uverbs_attr_def *const UVERBS_METHOD_ATTRS( \ - _method_id)[] = { __VA_ARGS__ }; \ - static const struct uverbs_method_def UVERBS_METHOD(_method_id) = { \ - .id = _method_id, \ - .num_attrs = ARRAY_SIZE(UVERBS_METHOD_ATTRS(_method_id)), \ - .attrs = &UVERBS_METHOD_ATTRS(_method_id), \ - }; \ +#define ADD_UVERBS_METHODS(_name, _object_id, ...) \ static const struct uverbs_method_def *const UVERBS_OBJECT_METHODS( \ - _object_id)[] = { &UVERBS_METHOD(_method_id) }; \ + _object_id)[] = { __VA_ARGS__ }; \ static const struct uverbs_object_def _name##_struct = { \ .id = _object_id, \ - .num_methods = 1, \ + .num_methods = ARRAY_SIZE(UVERBS_OBJECT_METHODS(_object_id)), \ .methods = &UVERBS_OBJECT_METHODS(_object_id) \ }; \ static const struct uverbs_object_def *const _name##_ptrs[] = { \ @@ -123,4 +115,17 @@ .objects = &_name##_ptrs, \ } +/* Used by drivers to declare a complete parsing tree for a single method that + * differs only in having additional driver specific attributes. + */ +#define ADD_UVERBS_ATTRIBUTES_SIMPLE(_name, _object_id, _method_id, ...) \ + static const struct uverbs_attr_def *const UVERBS_METHOD_ATTRS( \ + _method_id)[] = { __VA_ARGS__ }; \ + static const struct uverbs_method_def UVERBS_METHOD(_method_id) = { \ + .id = _method_id, \ + .num_attrs = ARRAY_SIZE(UVERBS_METHOD_ATTRS(_method_id)), \ + .attrs = &UVERBS_METHOD_ATTRS(_method_id), \ + }; \ + ADD_UVERBS_METHODS(_name, _object_id, &UVERBS_METHOD(_method_id)) + #endif |