Skip to main content

Module data_plane

Module data_plane 

Source
Expand description

NIC data-plane using lock-free SPSC rings (N2).

Each RSS queue gets a dedicated RX/TX LockFreeRing pair. The NIC driver writes received packets into the RX ring during interrupt handling; the networking silo (strate-net) reads from the RX ring and writes to the TX ring without kernel syscalls.

§Usage

let dp = NicDataPlane::new(queue_count, slot_size)?;
// In IRQ handler:
while let Some(pkt) = read_packet_from_hw() {
    dp.push_rx(queue_id, &pkt);
}
dp.notify_consumer(queue_id);

// In strate-net:
let pkt = dp.pop_rx(0, &mut buf)?;
dp.push_tx(0, &response)?;

Structs§

NicDataPlane
Multi-queue NIC data plane.
RingPair
A pair of RX/TX rings for one RSS queue.