pub struct XskConfig {Show 13 fields
pub ifindex: u32,
pub queue_id: u32,
pub zero_copy: bool,
pub fill_ring_size: u32,
pub rx_ring_size: u32,
pub tx_ring_size: u32,
pub completion_ring_size: u32,
pub shared_umem: bool,
pub frame_size: u32,
pub headroom: u32,
pub so_rcvbuf: i32,
pub so_sndbuf: i32,
pub prefill_chunk: usize,
}Expand description
AF_XDP Socket 配置
Fields§
§ifindex: u32网卡接口索引
queue_id: u32队列 ID
zero_copy: bool是否使用 Zero-Copy 模式
fill_ring_size: u32Fill Ring 大小(必须是 2 的幂)
rx_ring_size: u32RX Ring 大小
tx_ring_size: u32TX Ring 大小
completion_ring_size: u32Completion Ring 大小
UMEM 共享标志
frame_size: u32UMEM 帧(chunk)大小,必须是 2 的幂且 ≥ 2048(XDP_UMEM_MIN_CHUNK_SIZE)
headroom: u32UMEM 帧头预留(headroom),必须 < frame_size
so_rcvbuf: i32SO_RCVBUF 内核接收缓冲(字节)。默认 1MB;调用方可按需调整。
so_sndbuf: i32SO_SNDBUF 内核发送缓冲(字节)。默认 1MB;调用方可按需调整。
prefill_chunk: usizeFill Ring 预填/再填充的分块大小(栈上批量数组)。默认 64。
Trait Implementations§
Auto Trait Implementations§
impl Freeze for XskConfig
impl RefUnwindSafe for XskConfig
impl Send for XskConfig
impl Sync for XskConfig
impl Unpin for XskConfig
impl UnsafeUnpin for XskConfig
impl UnwindSafe for XskConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more