History

io_uring/query: introduce rings info query

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.

Pavel Begunkov committed 1 year ago

Commit 4aaa9bc1 parent 2647e2e2 files · +21 −0Browse files

Showing the changes to include/uapi (1 of 2 files). Show all

Unified · Split

include/uapi/linux/io_uring/query.h+8−0
@@ -19,6 +19,7 @@ struct io_uring_query_hdr { · 18 unmodified lines
19enum {19enum {
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
61struct 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#endif68#endif

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t