summaryrefslogtreecommitdiff
path: root/include/rdma/uverbs_ioctl.h
diff options
context:
space:
mode:
authorJason Gunthorpe <jgg@mellanox.com>2018-11-25 21:51:16 +0300
committerJason Gunthorpe <jgg@mellanox.com>2018-11-27 02:48:07 +0300
commit669dac1e00c50a65cb8ecf08862c3c9dd7a29a98 (patch)
tree9ff3e1d2931f80dbfd99dc24fe5083b1085a525b /include/rdma/uverbs_ioctl.h
parent15a1b4becba886176aa1426604548c34904fd054 (diff)
downloadlinux-669dac1e00c50a65cb8ecf08862c3c9dd7a29a98.tar.xz
RDMA/uverbs: Add structure size info to write commands
We need the structure sizes to compute the location of the udata in the core code. Annotate the sizes into the new macro language. This is generated largely by script and checked by comparing against the similar list in rdma-core. Signed-off-by: Jason Gunthorpe <jgg@mellanox.com> Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Diffstat (limited to 'include/rdma/uverbs_ioctl.h')
-rw-r--r--include/rdma/uverbs_ioctl.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/include/rdma/uverbs_ioctl.h b/include/rdma/uverbs_ioctl.h
index e0b1a77b1c2c..7bed0bb4211c 100644
--- a/include/rdma/uverbs_ioctl.h
+++ b/include/rdma/uverbs_ioctl.h
@@ -360,8 +360,12 @@ struct uapi_definition {
u16 object_id;
} object_start;
struct {
- u8 is_ex;
u16 command_num;
+ u8 is_ex:1;
+ u8 has_udata:1;
+ u8 has_resp:1;
+ u8 req_size;
+ u8 resp_size;
} write;
};
@@ -388,22 +392,24 @@ struct uapi_definition {
##__VA_ARGS__
/* Use in a var_args of DECLARE_UVERBS_OBJECT */
-#define DECLARE_UVERBS_WRITE(_command_num, _func, ...) \
+#define DECLARE_UVERBS_WRITE(_command_num, _func, _cmd_desc, ...) \
{ \
.kind = UAPI_DEF_WRITE, \
.scope = UAPI_SCOPE_OBJECT, \
.write = { .is_ex = 0, .command_num = _command_num }, \
.func_write = _func, \
+ _cmd_desc, \
}, \
##__VA_ARGS__
/* Use in a var_args of DECLARE_UVERBS_OBJECT */
-#define DECLARE_UVERBS_WRITE_EX(_command_num, _func, ...) \
+#define DECLARE_UVERBS_WRITE_EX(_command_num, _func, _cmd_desc, ...) \
{ \
.kind = UAPI_DEF_WRITE, \
.scope = UAPI_SCOPE_OBJECT, \
.write = { .is_ex = 1, .command_num = _command_num }, \
.func_write_ex = _func, \
+ _cmd_desc, \
}, \
##__VA_ARGS__