-
Notifications
You must be signed in to change notification settings - Fork 0
[TASK] Phase 4.3.2: virtio-net Driver (QEMU NIC) #136
Copy link
Copy link
Open
Labels
component-networkNetworking stack and NIC driversNetworking stack and NIC driversmilestone-4.3Milestone 4.3: NetworkingMilestone 4.3: Networkingphase-4Phase 4: Modern WorkloadsPhase 4: Modern Workloadspriority-highHigh priority - important workHigh priority - important worktype-enhancementFeature enhancementFeature enhancement
Milestone
Description
Metadata
Metadata
Assignees
Labels
component-networkNetworking stack and NIC driversNetworking stack and NIC driversmilestone-4.3Milestone 4.3: NetworkingMilestone 4.3: Networkingphase-4Phase 4: Modern WorkloadsPhase 4: Modern Workloadspriority-highHigh priority - important workHigh priority - important worktype-enhancementFeature enhancementFeature enhancement
Projects
StatusShow more project fields
Todo
Overview
Implement a user-space virtio-net driver for QEMU's paravirtual NIC. virtio-net is the standard NIC in QEMU/KVM environments and is the correct first target — it is simpler than real PCIe NICs and avoids PCI enumeration complexity.
Background
virtio-net uses shared memory virtqueues (TX and RX rings in DMA buffers) for zero-copy packet transfer. The driver places packet buffers in the RX virtqueue; QEMU fills them with incoming frames and fires an interrupt. For TX, the driver places frames in the TX virtqueue; QEMU drains them.
Design
Virtqueue
Driver Lifecycle
sys_dma_allocIrqCapabilityfor virtio interruptsys_nic_send(to kernel RX ring)sys_nic_recv, place in TX virtqueue, kick deviceAcceptance Criteria
sys_dma_alloc(physically contiguous)ReadySignalafter init-netdev usermode: ping to host gateway succeeds (verified via ARP/ICMP in Phase 4.3.3)"virtio-net: found PCI device at bus 0 slot N","virtio-net: MAC=52:54:00:xx:xx:xx, MTU=1500","virtio-net: ready"Files
userspace/drivers/virtio-net/src/main.rsuserspace/drivers/virtio-net/src/pci.rs— PCI enumerationuserspace/drivers/virtio-net/src/virtqueue.rsuserspace/drivers/virtio-net/src/net.rs— TX/RX loopsuserspace/drivers/virtio-net/Cargo.tomlDependencies
sys_nic_send/sys_nic_recvsys_dma_allocfor virtqueue memorysys_irq_registerfor virtio IRQ