From 669dac1e00c50a65cb8ecf08862c3c9dd7a29a98 Mon Sep 17 00:00:00 2001 From: Jason Gunthorpe Date: Sun, 25 Nov 2018 20:51:16 +0200 Subject: 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 Signed-off-by: Leon Romanovsky --- include/rdma/uverbs_ioctl.h | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'include') 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__ -- cgit v1.2.3