# Understanding Physical Functions and Virtual Functions

The topic describes physical and virtual network.

The PF manages and controls SR-IOV functionality, while VFs act as efficient, high-performance network interfaces that deliver traffic directly to individual VMs.

## Physical Function (PF)

A Physical Function (PF) represents a full-featured PCIe device on a physical network adapter that manages and controls SR-IOV functionality.

The key functionalities of PF include:

- Full-featured device: The host OS or hypervisor discovers and manages the PF like a standard physical NIC.
- Management and configuration: The PF driver controls the hardware, enables SR-IOV, and creates Virtual Functions.
- Data movement: The PF handles network traffic for the host OS and for VMs that do not have an assigned VF.
- VF creation: The PF enables the hypervisor to create multiple lightweight VFs and assign them directly to VMs for high-performance I/O.

The PF acts as the root controller for the physical port and manages all associated Virtual Functions.

## Virtual Function (VF)

A Virtual Function (VF) represents a lightweight, virtualized instance of a physical NIC port derived from a PF. It provides direct hardware access to a VM.

The key functionalities of VF include:

- Derivation: The PF driver creates VFs, and the hypervisor defines how many VFs to instantiate.
- Resource sharing: VFs share the physical port, memory buffers, and other hardware resources with the PF and other VFs.
- Direct assignment: The system assigns each VF to a single VM, where it appears as a dedicated NIC with its own PCI configuration space.
- High-performance I/O: The VF bypasses the host networking stack and delivers near-native throughput with very low latency.
- Mailbox communication: The VF communicates with its parent PF through an out-of-band mailbox channel to request configuration updates (such as MAC address or MTU changes).
