History

io_uring/zcrx: add sync refill queue flushing

Add an zcrx interface via IORING_REGISTER_ZCRX_CTRL that forces the kernel to flush / consume entries from the refill queue. Just as with the IORING_REGISTER_ZCRX_REFILL attempt, the motivation is to address cases where the refill queue becomes full, and the user can't return buffers and needs to stash them. It's still a slow path, and the user should size refill queue appropriately, but it should be helpful for handling temporary traffic spikes and other unpredictable conditions. The interface is simpler comparing to ZCRX_REFILL as it doesn't need temporary refill entry arrays and gives natural batching, whereas ZCRX_REFILL requires even more user logic to be somewhat efficient. Also, add a structure for the operation. It's not currently used but can serve for future improvements like limiting the number of buffers to process, etc.

Pavel Begunkov committed 1 year ago

Commit 475eb391 parent d6639762 files · +80 −4Browse files

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

Unified · Split

include/uapi/linux/io_uring.h+9−1
@@ -1082,13 +1082,21 @@ struct io_uring_zcrx_ifq_reg { · 1081 unmodified lines
10821082 };
10831083
10841084 enum zcrx_ctrl_op {
1085+ ZCRX_CTRL_FLUSH_RQ,
1086+
10851087 __ZCRX_CTRL_LAST,
10861088 };
10871089
1090+struct zcrx_ctrl_flush_rq {
1091+ __u64 __resv[6];
1092+};
1093+
10881094 struct zcrx_ctrl {
10891095 __u32 zcrx_id;
10901096 __u32 op; /* see enum zcrx_ctrl_op */
1091− __u64 __resv[8];
1097+ __u64 __resv[2];
1098+
1099+ struct zcrx_ctrl_flush_rq zc_flush;
10921100 };
10931101
10941102 #ifdef __cplusplus

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