1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
/// Candidate SQ sizes tried in descending order to accommodate tighter `RLIMIT_MEMLOCK` budgets.
pub const URING_RING_ENTRY_CANDIDATES: = ;
/// Number of concurrent `Accept` SQEs armed on a single-worker `io_uring` thread.
pub const URING_SINGLE_WORKER_ACCEPT_SLOTS: usize = 8;
/// Number of concurrent `Accept` SQEs armed per worker on multi-worker `io_uring` servers
/// so incoming bursts balance evenly across workers without single-thread accept hoarding.
pub const URING_MULTI_WORKER_ACCEPT_SLOTS: usize = 2;
/// Fixed heap buffer size for each connection's `Recv` and `Send` `io_uring` operations.
pub const URING_IO_BUF_SIZE: usize = 16 * 1024;
/// Maximum response tail size eligible for an in-kernel linked send and close.
pub const URING_LINKED_SEND_LIMIT: usize = 4 * 1024;
/// Maximum buffered outbound bytes queued while a `Send` SQE is already in flight.
pub const URING_PENDING_WRITE_LIMIT: usize = 64 * 1024;
/// Maximum recycled 16 KiB `Box<[u8]>` buffers retained per `io_uring` worker thread.
pub const URING_MAX_POOLED_BUFS: usize = 512;
/// Bit shift separating the 8-bit operation tag from the 56-bit slot index in `user_data`.
pub const URING_TAG_SHIFT: u32 = 56;
/// Bit mask extracting the 56-bit slot index from an `io_uring` `user_data` value.
pub const URING_INDEX_MASK: u64 = - 1;
/// `user_data` tag for `opcode::Accept` operations.
pub const URING_TAG_ACCEPT: u64 = 1;
/// `user_data` tag for `eventfd` wakeup `opcode::PollAdd` operations.
pub const URING_TAG_EVENTFD: u64 = 2;
/// `user_data` tag for `opcode::Recv` operations.
pub const URING_TAG_RECV: u64 = 3;
/// `user_data` tag for `opcode::Send` operations.
pub const URING_TAG_SEND: u64 = 4;
/// `user_data` tag for `opcode::Close` operations.
pub const URING_TAG_CLOSE: u64 = 5;
/// `user_data` tag for `opcode::AsyncCancel` operations.
pub const URING_TAG_CANCEL: u64 = 6;
/// `user_data` tag for listener accept cancellations, distinct from connection cancellations.
pub const URING_TAG_ACCEPT_CANCEL: u64 = 7;
/// `user_data` tag for linked `opcode::Shutdown(SHUT_WR)` operations.
pub const URING_TAG_SHUTDOWN: u64 = 8;
/// Thread name prefix for dedicated Linux `io_uring` worker threads.
pub const URING_THREAD_NAME_PREFIX: &str = "hyperlane-uring-";
/// Error message returned when a transport is polled outside its owning `io_uring` thread.
pub const URING_REACTOR_UNAVAILABLE: &str = "io_uring reactor unavailable";