diff options
author | Matan Barak <matanb@mellanox.com> | 2018-06-17 11:59:53 +0200 |
---|---|---|
committer | Jason Gunthorpe <jgg@mellanox.com> | 2018-06-19 18:53:02 +0200 |
commit | 2d9c1bd7e177bd8b460403db9513b0a223e46ab8 (patch) | |
tree | c14d68a71a2c971245b66fd6f8599b1ce04242cd /include/rdma/uverbs_ioctl.h | |
parent | IB/uverbs: Add PTR_IN attributes that are allocated/copied automatically (diff) | |
download | linux-2d9c1bd7e177bd8b460403db9513b0a223e46ab8.tar.xz linux-2d9c1bd7e177bd8b460403db9513b0a223e46ab8.zip |
IB/uverbs: Add a macro to define a type with no kernel known size
Sometimes the uverbs uAPI doesn't really care about the structure it gets
from user-space. All it wants to do is to allocate enough space and send
it to the hardware/provider driver. Adding a UVERBS_ATTR_MIN_SIZE that
could be used for this scenarios. We use USHRT_MAX as the kernel known
size to bypass any zero validations.
Signed-off-by: Matan Barak <matanb@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Diffstat (limited to 'include/rdma/uverbs_ioctl.h')
-rw-r--r-- | include/rdma/uverbs_ioctl.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/rdma/uverbs_ioctl.h b/include/rdma/uverbs_ioctl.h index 11cc40ef1cb6..970357d0ccc4 100644 --- a/include/rdma/uverbs_ioctl.h +++ b/include/rdma/uverbs_ioctl.h @@ -215,6 +215,8 @@ struct uverbs_object_tree_def { .min_len = ((uintptr_t)(&((_type *)0)->_last + 1)), .len = sizeof(_type) #define UVERBS_ATTR_SIZE(_min_len, _len) \ .min_len = _min_len, .len = _len +#define UVERBS_ATTR_MIN_SIZE(_min_len) \ + UVERBS_ATTR_SIZE(_min_len, USHRT_MAX) /* * In new compiler, UVERBS_ATTR could be simplified by declaring it as |