Commit 1b09577b authored by Jason Gunthorpe's avatar Jason Gunthorpe

RDMA/uverbs: Add missing driver_data

If the struct is used with a driver_udata it should have a trailing
driver_data flex array to mark it as having udata.

In most cases this forces the end of the struct to be aligned to u64 which
is needed to make the trailing driver_data naturally aligned.

Unfortunately We have a few cases where the base struct is not aligned to
8 bytes, these are marked with a u32 driver_data and userspace will check
for alignment issues when it compiles the driver.

Also remove the empty ib_uverbs_modify_qp_resp as nothing uses this.

pahole says there is no change to any struct sizes by this change.
Signed-off-by: default avatarJason Gunthorpe <jgg@mellanox.com>
Signed-off-by: default avatarLeon Romanovsky <leonro@mellanox.com>
parent d2c9d9ab
...@@ -164,6 +164,7 @@ struct ib_uverbs_get_context { ...@@ -164,6 +164,7 @@ struct ib_uverbs_get_context {
struct ib_uverbs_get_context_resp { struct ib_uverbs_get_context_resp {
__u32 async_fd; __u32 async_fd;
__u32 num_comp_vectors; __u32 num_comp_vectors;
__aligned_u64 driver_data[0];
}; };
struct ib_uverbs_query_device { struct ib_uverbs_query_device {
...@@ -310,6 +311,7 @@ struct ib_uverbs_alloc_pd { ...@@ -310,6 +311,7 @@ struct ib_uverbs_alloc_pd {
struct ib_uverbs_alloc_pd_resp { struct ib_uverbs_alloc_pd_resp {
__u32 pd_handle; __u32 pd_handle;
__u32 driver_data[0];
}; };
struct ib_uverbs_dealloc_pd { struct ib_uverbs_dealloc_pd {
...@@ -325,6 +327,7 @@ struct ib_uverbs_open_xrcd { ...@@ -325,6 +327,7 @@ struct ib_uverbs_open_xrcd {
struct ib_uverbs_open_xrcd_resp { struct ib_uverbs_open_xrcd_resp {
__u32 xrcd_handle; __u32 xrcd_handle;
__u32 driver_data[0];
}; };
struct ib_uverbs_close_xrcd { struct ib_uverbs_close_xrcd {
...@@ -345,6 +348,7 @@ struct ib_uverbs_reg_mr_resp { ...@@ -345,6 +348,7 @@ struct ib_uverbs_reg_mr_resp {
__u32 mr_handle; __u32 mr_handle;
__u32 lkey; __u32 lkey;
__u32 rkey; __u32 rkey;
__u32 driver_data[0];
}; };
struct ib_uverbs_rereg_mr { struct ib_uverbs_rereg_mr {
...@@ -356,11 +360,13 @@ struct ib_uverbs_rereg_mr { ...@@ -356,11 +360,13 @@ struct ib_uverbs_rereg_mr {
__aligned_u64 hca_va; __aligned_u64 hca_va;
__u32 pd_handle; __u32 pd_handle;
__u32 access_flags; __u32 access_flags;
__aligned_u64 driver_data[0];
}; };
struct ib_uverbs_rereg_mr_resp { struct ib_uverbs_rereg_mr_resp {
__u32 lkey; __u32 lkey;
__u32 rkey; __u32 rkey;
__aligned_u64 driver_data[0];
}; };
struct ib_uverbs_dereg_mr { struct ib_uverbs_dereg_mr {
...@@ -372,11 +378,13 @@ struct ib_uverbs_alloc_mw { ...@@ -372,11 +378,13 @@ struct ib_uverbs_alloc_mw {
__u32 pd_handle; __u32 pd_handle;
__u8 mw_type; __u8 mw_type;
__u8 reserved[3]; __u8 reserved[3];
__aligned_u64 driver_data[0];
}; };
struct ib_uverbs_alloc_mw_resp { struct ib_uverbs_alloc_mw_resp {
__u32 mw_handle; __u32 mw_handle;
__u32 rkey; __u32 rkey;
__aligned_u64 driver_data[0];
}; };
struct ib_uverbs_dealloc_mw { struct ib_uverbs_dealloc_mw {
...@@ -419,6 +427,7 @@ struct ib_uverbs_ex_create_cq { ...@@ -419,6 +427,7 @@ struct ib_uverbs_ex_create_cq {
struct ib_uverbs_create_cq_resp { struct ib_uverbs_create_cq_resp {
__u32 cq_handle; __u32 cq_handle;
__u32 cqe; __u32 cqe;
__aligned_u64 driver_data[0];
}; };
struct ib_uverbs_ex_create_cq_resp { struct ib_uverbs_ex_create_cq_resp {
...@@ -629,6 +638,7 @@ struct ib_uverbs_create_qp_resp { ...@@ -629,6 +638,7 @@ struct ib_uverbs_create_qp_resp {
__u32 max_recv_sge; __u32 max_recv_sge;
__u32 max_inline_data; __u32 max_inline_data;
__u32 reserved; __u32 reserved;
__u32 driver_data[0];
}; };
struct ib_uverbs_ex_create_qp_resp { struct ib_uverbs_ex_create_qp_resp {
...@@ -733,9 +743,6 @@ struct ib_uverbs_ex_modify_qp { ...@@ -733,9 +743,6 @@ struct ib_uverbs_ex_modify_qp {
__u32 reserved; __u32 reserved;
}; };
struct ib_uverbs_modify_qp_resp {
};
struct ib_uverbs_ex_modify_qp_resp { struct ib_uverbs_ex_modify_qp_resp {
__u32 comp_mask; __u32 comp_mask;
__u32 response_length; __u32 response_length;
...@@ -863,10 +870,12 @@ struct ib_uverbs_create_ah { ...@@ -863,10 +870,12 @@ struct ib_uverbs_create_ah {
__u32 pd_handle; __u32 pd_handle;
__u32 reserved; __u32 reserved;
struct ib_uverbs_ah_attr attr; struct ib_uverbs_ah_attr attr;
__aligned_u64 driver_data[0];
}; };
struct ib_uverbs_create_ah_resp { struct ib_uverbs_create_ah_resp {
__u32 ah_handle; __u32 ah_handle;
__u32 driver_data[0];
}; };
struct ib_uverbs_destroy_ah { struct ib_uverbs_destroy_ah {
...@@ -1175,6 +1184,7 @@ struct ib_uverbs_create_srq_resp { ...@@ -1175,6 +1184,7 @@ struct ib_uverbs_create_srq_resp {
__u32 max_wr; __u32 max_wr;
__u32 max_sge; __u32 max_sge;
__u32 srqn; __u32 srqn;
__u32 driver_data[0];
}; };
struct ib_uverbs_modify_srq { struct ib_uverbs_modify_srq {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment