Module virtio_net

Module virtio_net 

Source
Expand description

§VirtIO Network Device Driver

This module provides a driver for VirtIO network devices, implementing the NetworkDevice trait for integration with the kernel’s network subsystem.

The driver supports basic network operations (packet transmission and reception) and handles the VirtIO queue management for network device requests.

§VirtIO Network Device Features

The driver checks for and handles the following VirtIO network device features:

  • Basic packet transmission and reception
  • MAC address configuration
  • MTU management
  • Link status detection

§Implementation Details

The driver uses two virtqueues:

  • Receive queue (index 0): For receiving packets from the network
  • Transmit queue (index 1): For sending packets to the network

Each network packet is handled through the VirtIO descriptor chain mechanism, with proper memory management for packet buffers.

Structs§

VirtioNetConfig
VirtIO Network Device Configuration
VirtioNetDevice
VirtIO Network Device
VirtioNetHdr
VirtIO Network Header (for packet transmission/reception)
VirtioNetHdrBasic
Basic VirtIO Network Header (without num_buffers field)

Constants§

DEFAULT_MTU 🔒
VIRTIO_NET_F_CSUM 🔒
VIRTIO_NET_F_CTRL_GUEST_OFFLOADS 🔒
VIRTIO_NET_F_CTRL_MAC_ADDR 🔒
VIRTIO_NET_F_CTRL_RX 🔒
VIRTIO_NET_F_CTRL_VLAN 🔒
VIRTIO_NET_F_CTRL_VQ 🔒
VIRTIO_NET_F_GUEST_ANNOUNCE 🔒
VIRTIO_NET_F_GUEST_CSUM 🔒
VIRTIO_NET_F_GUEST_ECN 🔒
VIRTIO_NET_F_GUEST_TSO4 🔒
VIRTIO_NET_F_GUEST_TSO6 🔒
VIRTIO_NET_F_GUEST_UFO 🔒
VIRTIO_NET_F_HOST_ECN 🔒
VIRTIO_NET_F_HOST_TSO4 🔒
VIRTIO_NET_F_HOST_TSO6 🔒
VIRTIO_NET_F_HOST_UFO 🔒
VIRTIO_NET_F_MAC 🔒
VIRTIO_NET_F_MQ 🔒
VIRTIO_NET_F_MRG_RXBUF 🔒
VIRTIO_NET_F_MTU 🔒
VIRTIO_NET_F_STATUS 🔒
VIRTIO_NET_S_ANNOUNCE 🔒
VIRTIO_NET_S_LINK_UP 🔒