Skip to main content

Module net_queue

Module net_queue 

Source
Expand description

Shared-memory network queue.

A NetQueue owns one NET_QUEUE_SIZE region allocated from the shared ring allocator. The region is mapped into the networking strate with SYS_NET_QUEUE_MAP, so both sides address the same descriptor rings and frame pools. The kernel keeps a page table (vas/phys) because the pages are not guaranteed to be physically contiguous.

The queue is the data plane primitive: once mapped, RX and TX are driven by the descriptor rings and the kick/IRQ notifications, without a syscall per packet.

Re-exportsยง

use alloc::sync::Arc; ๐Ÿ”’
use alloc::vec::Vec; ๐Ÿ”’
use core::sync::atomic::AtomicU64; ๐Ÿ”’
use core::sync::atomic::AtomicU8; ๐Ÿ”’
use core::sync::atomic::Ordering; ๐Ÿ”’
use crate::ipc::shared_ring; ๐Ÿ”’
use crate::ipc::shared_ring::RingId; ๐Ÿ”’
use crate::ipc::shared_ring::SharedRing; ๐Ÿ”’
use crate::sync::SpinLock; ๐Ÿ”’
use crate::sync::WaitQueue; ๐Ÿ”’
use strat9_abi::net::features; ๐Ÿ”’
use strat9_abi::net::NetFrameDesc; ๐Ÿ”’
use strat9_abi::net::NetQueueHeader; ๐Ÿ”’
use strat9_abi::net::NET_FRAME_SIZE; ๐Ÿ”’
use strat9_abi::net::NET_QUEUE_SIZE; ๐Ÿ”’

Structsยง

NetQueue
One shared RX/TX queue pair for a network device.
NetQueues
A set of queues for one device.
QueueEvent
Per-queue event counter and wait queue.

Staticsยง

QUEUE_LOCK
Global serialisation for queue creation/teardown.