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
1082};1082};
1083 1083
1084enum zcrx_ctrl_op {1084enum zcrx_ctrl_op {
1085 ZCRX_CTRL_FLUSH_RQ,
1086
1085 __ZCRX_CTRL_LAST,1087 __ZCRX_CTRL_LAST,
1086};1088};
1087 1089
1090struct zcrx_ctrl_flush_rq {
1091 __u64 __resv[6];
1092};
1093
1088struct zcrx_ctrl {1094struct zcrx_ctrl {
1089 __u32 zcrx_id;1095 __u32 zcrx_id;
1090 __u32 op; /* see enum zcrx_ctrl_op */1096 __u32 op; /* see enum zcrx_ctrl_op */
1091 __u64 __resv[8];1097 __u64 __resv[2];
1098
1099 struct zcrx_ctrl_flush_rq zc_flush;
1092};1100};
1093 1101
1094#ifdef __cplusplus1102#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