History

io_uring: add IORING_REGISTER_RSRC

Add a new io_uring_register() opcode for rsrc registeration. Instead of accepting a pointer to resources, fds or iovecs, it @arg is now pointing to a struct io_uring_rsrc_register, and the second argument tells how large that struct is to make it easily extendible by adding new fields. All that is done mainly to be able to pass in a pointer with tags. Pass it in and enable CQE posting for file resources. Doesn't support setting tags on update yet. A design choice made here is to not post CQEs on rsrc de-registration, but only when we updated-removed it by rsrc dynamic update.

Pavel Begunkov committed 5 years ago

Commit 792e3581 parent fdecb662 files · +48 −5Browse files

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

Unified · Split

include/uapi/linux/io_uring.h+8−0
@@ -298,6 +298,7 @@ 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
302 /* this goes last */303 /* this goes last */
303 IORING_REGISTER_LAST304 IORING_REGISTER_LAST
@@ -320,6 +321,13 @@ enum { · 16 unmodified lines
320 IORING_RSRC_FILE = 0,321 IORING_RSRC_FILE = 0,
321};322};
322 323
324struct io_uring_rsrc_register {
325 __u32 type;
326 __u32 nr;
327 __aligned_u64 data;
328 __aligned_u64 tags;
329};
330
323/* Skip updating fd indexes set to this value in the fd table */331/* Skip updating fd indexes set to this value in the fd table */
324#define IORING_REGISTER_FILES_SKIP (-2)332#define IORING_REGISTER_FILES_SKIP (-2)
325 333