History

io_uring: change registration/upd/rsrc tagging ABI

There are ABI moments about recently added rsrc registration/update and tagging that might become a nuisance in the future. First, IORING_REGISTER_RSRC[_UPD] hide different types of resources under it, so breaks fine control over them by restrictions. It works for now, but once those are wanted under restrictions it would require a rework. It was also inconvenient trying to fit a new resource not supporting all the features (e.g. dynamic update) into the interface, so better to return to IORING_REGISTER_* top level dispatching. Second, register/update were considered to accept a type of resource, however that's not a good idea because there might be several ways of registration of a single resource type, e.g. we may want to add non-contig buffers or anything more exquisite as dma mapped memory. So, remove IORING_RSRC_[FILE,BUFFER] out of the ABI, and place them internally for now to limit changes.

Pavel Begunkov committed 5 years ago

Commit 992da011 parent 216e5832 files · +36 −21Browse files

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

Unified · Split

include/uapi/linux/io_uring.h+9−9
@@ -298,8 +298,12 @@ enum { · 297 unmodified lines
298 IORING_UNREGISTER_PERSONALITY = 10,298 IORING_UNREGISTER_PERSONALITY = 10,
299 IORING_REGISTER_RESTRICTIONS = 11,299 IORING_REGISTER_RESTRICTIONS = 11,
300 IORING_REGISTER_ENABLE_RINGS = 12,300 IORING_REGISTER_ENABLE_RINGS = 12,
301 IORING_REGISTER_RSRC = 13,301
302 IORING_REGISTER_RSRC_UPDATE = 14,302 /* extended with tagging */
303 IORING_REGISTER_FILES2 = 13,
304 IORING_REGISTER_FILES_UPDATE2 = 14,
305 IORING_REGISTER_BUFFERS2 = 15,
306 IORING_REGISTER_BUFFERS_UPDATE = 16,
303 307
304 /* this goes last */308 /* this goes last */
305 IORING_REGISTER_LAST309 IORING_REGISTER_LAST
@@ -312,14 +316,10 @@ struct io_uring_files_update { · 6 unmodified lines
312 __aligned_u64 /* __s32 * */ fds;316 __aligned_u64 /* __s32 * */ fds;
313};317};
314 318
315enum {
316 IORING_RSRC_FILE = 0,
317 IORING_RSRC_BUFFER = 1,
318};
319
320struct io_uring_rsrc_register {319struct io_uring_rsrc_register {
321 __u32 type;
322 __u32 nr;320 __u32 nr;
321 __u32 resv;
322 __u64 resv2;
323 __aligned_u64 data;323 __aligned_u64 data;
324 __aligned_u64 tags;324 __aligned_u64 tags;
325};325};
@@ -335,8 +335,8 @@ struct io_uring_rsrc_update2 { · 9 unmodified lines
335 __u32 resv;335 __u32 resv;
336 __aligned_u64 data;336 __aligned_u64 data;
337 __aligned_u64 tags;337 __aligned_u64 tags;
338 __u32 type;
339 __u32 nr;338 __u32 nr;
339 __u32 resv2;
340};340};
341 341
342/* Skip updating fd indexes set to this value in the fd table */342/* Skip updating fd indexes set to this value in the fd table */