#[non_exhaustive]pub struct Config {
pub gro: bool,
pub gso: bool,
pub multishot: bool,
pub rx_buffers_max: u16,
pub rx_buffer_len: usize,
pub tx_buffers_max: u16,
pub tx_buffer_len: usize,
}Expand description
How a socket uses the ring. The defaults are the production path; the toggles exist so the benchmarks can ablate one mechanism at a time.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.gro: boolCoalesce received datagrams with UDP_GRO.
gso: boolSend with a UDP_SEGMENT control message instead of one sendmsg per
datagram.
multishot: boolReceive through one persistent multishot recvmsg and the provided
buffer ring, instead of re-armed oneshot receives.
rx_buffers_max: u16Receive pool ceiling: at most this many buffers, and at most 32768.
Each receive completion consumes one buffer whatever its size, so the pool is a queue depth in packets rather than in bytes: GRO coalescing collapses as connections multiply, and the depth a socket needs follows that, not its bitrate. Buffers are allocated on demand, so this bounds the memory rather than reserving it.
rx_buffer_len: usizeReceive pool: bytes per buffer. Must hold one worst-case receive.
tx_buffers_max: u16Send pool ceiling: at most this many buffers, allocated on demand.
One buffer stages one GSO train, so the pool is the socket’s in-flight send concurrency. Set it to 1 to serialize sends.
tx_buffer_len: usizeSend pool: bytes per buffer, the ceiling for one GSO train.