Expand description
Kernel-bypass-ready packet I/O. M4 adds the io_uring backend (single ring
servicing UDP + TUN/TAP), then AF_XDP. This is the only crate permitted to
contain unsafe; every unsafe block must carry a // SAFETY: comment.
Re-exports§
pub use addr::sockaddr_to_std;pub use addr::std_to_sockaddr;pub use bpf::BpfFilterStatus;pub use bpf::XdpRedirectFilter;
Modules§
- addr
sockaddr⇄SocketAddrconversions for the addressed socket seam.- af_xdp
- AF_XDP (XSK) kernel-bypass driver and UMEM shared memory pool.
- batch
- Vectorized
recvmmsgandsendmmsgsocket engine. - bpf
- Self-contained eBPF XSK redirect driver and map loader.
- epoll
- A minimal, safe
epollprimitive for the QUIC-mimicry driver (3c.1). - nonce
- poll
- Single-threaded epoll-driven event loop for the yip data plane.
- spsc
- Lock-free Single-Producer Single-Consumer (SPSC) bounded ring buffer.
- tun_
offload - Local TUN
virtio_net_hdr(GSO/GRO) framing + the RX coalescer / TX splitter. Purely local to the yipd↔kernel-TUN boundary — never touches the wire. - uring
- io_uring driver using one ring over UDP + TUN with provided-buffer receives.
Structs§
- IoUring
Io - A
DataPlaneIobackend that submits Read/Write ops on a connected UDP socket through anio_uringring. - PlainIo
- A portable fallback backend over a plain (connected) UDP socket.
Enums§
- Backend
- Selected I/O backend, in fallback-preference order.
Constants§
- MAX_
DATAGRAM_ BATCH - Maximum number of datagrams in a single batched send/recv call.
- MAX_
WIRE_ DATAGRAM - Maximum size (bytes) of a single wire datagram. 2 KiB is ample for any encapsulated MTU-1500 payload plus yip-wire framing overhead.
Traits§
- Data
Plane Io - Sends and receives wire datagrams via the selected backend. Implemented in M4.
Functions§
- pin_
current_ thread - Pin the calling thread to
corevialibc::sched_setaffinity. - select_
backend - Choose the lowest-latency backend that initializes: io_uring if its ring builds on this kernel, else the portable plain-socket fallback.
- set_
socket_ buffers - Set the OS send and receive socket buffer sizes to
bytesbytes onsock.