Same problem as with zcrx in the previous patch, the user needs to know SQ/CQ header sizes to allocated memory before setup to use it for user provided rings, i.e. IORING_SETUP_NO_MMAP, however that information is only returned after registration, hence the user is guessing kernel implementation details. Return the header size and alignment, which is split with the same motivation, to allow the user to know the real structure size without alignment in case there will be more flexible placement schemes in the future.
Showing the changes to include/uapi (1 of 2 files). Show all
Unified · Split
| @@ -19,6 +19,7 @@ struct io_uring_query_hdr { · 18 unmodified lines | |||
| 19 | enum { | 19 | enum { |
| 20 | IO_URING_QUERY_OPCODES = 0, | 20 | IO_URING_QUERY_OPCODES = 0, |
| 21 | IO_URING_QUERY_ZCRX = 1, | 21 | IO_URING_QUERY_ZCRX = 1, |
| 22 | IO_URING_QUERY_SCQ = 2, | ||
| 22 | 23 | ||
| 23 | __IO_URING_QUERY_MAX, | 24 | __IO_URING_QUERY_MAX, |
| 24 | }; | 25 | }; |
| @@ -57,4 +58,11 @@ struct io_uring_query_zcrx { · 32 unmodified lines | |||
| 57 | __u64 __resv2; | 58 | __u64 __resv2; |
| 58 | }; | 59 | }; |
| 59 | 60 | ||
| 61 | struct io_uring_query_scq { | ||
| 62 | /* The SQ/CQ rings header size */ | ||
| 63 | __u64 hdr_size; | ||
| 64 | /* The alignment for the header */ | ||
| 65 | __u64 hdr_alignment; | ||
| 66 | }; | ||
| 67 | |||
| 60 | #endif | 68 | #endif |