History

io_uring/zcrx: allow synchronous buffer return

Returning buffers via a ring is performant and convenient, but it becomes a problem when/if the user misconfigured the ring size and it becomes full. Add a synchronous way to return buffers back to the page pool via a new register opcode. It's supposed to be a reliable slow path for refilling.

Pavel Begunkov committed 1 year ago

Commit 705d2ac1 parent 8fd08d84 files · +90 −0Browse files

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

Unified · Split

include/uapi/linux/io_uring.h+12−0
@@ -689,6 +689,9 @@ enum io_uring_register_op { · 688 unmodified lines
689 /* query various aspects of io_uring, see linux/io_uring/query.h */689 /* query various aspects of io_uring, see linux/io_uring/query.h */
690 IORING_REGISTER_QUERY = 35,690 IORING_REGISTER_QUERY = 35,
691 691
692 /* return zcrx buffers back into circulation */
693 IORING_REGISTER_ZCRX_REFILL = 36,
694
692 /* this goes last */695 /* this goes last */
693 IORING_REGISTER_LAST,696 IORING_REGISTER_LAST,
694 697
@@ -1070,6 +1073,15 @@ struct io_uring_zcrx_ifq_reg { · 375 unmodified lines
1070 __u64 __resv[3];1073 __u64 __resv[3];
1071};1074};
1072 1075
1076struct io_uring_zcrx_sync_refill {
1077 __u32 zcrx_id;
1078 /* the number of entries to return */
1079 __u32 nr_entries;
1080 /* pointer to an array of struct io_uring_zcrx_rqe */
1081 __u64 rqes;
1082 __u64 __resv[2];
1083};
1084
1073#ifdef __cplusplus1085#ifdef __cplusplus
1074}1086}
1075#endif1087#endif