Skip to main content

Zero-Copy in Containers: Accelerating KubeVirt and Memory Providers

[HPP] David WeiDecember 18, 202549 min
33 connections·40 entities in this video→

Addressing Virtualization Challenges

  • πŸ’‘ Rising virtualization costs are pushing enterprises to migrate from traditional VM setups to cloud-native Kubernetes environments for infrastructure convergence and cost savings.
  • πŸš€ KubeVirt enables running virtual machines within Kubernetes Pods, allowing for unified management of both VM and container workloads.
  • 🚧 The default KubeVirt data path, using V devices and network namespaces, introduces significant overhead, leading to suboptimal network performance.

Limitations of Existing Solutions

  • πŸ“‰ Initial attempts with Netkit devices improved throughput by 30% and latency by 12% but were deemed insufficient for high-performance needs.
  • 🚫 SR-IOV (SIOV) offers hardware virtualization for the fastest path but lacks host visibility for policy enforcement and Kubernetes service access, making it unsuitable for managed environments.
  • ⚠️ Applications in containers with their own network namespaces cannot directly bind to physical NIC queues, posing a challenge for zero-copy mechanisms like AF_XDP and memory providers.

Introducing NIC Queue Leasing

  • πŸ”‘ The proposed solution involves leasing physical hardware queues from the NIC to virtual queues created within Netkit devices.
  • πŸ”„ This allows containerized applications to bind to these virtual queues, which then transparently proxy traffic to the underlying physical queues.
  • βœ… This mechanism enables zero-copy solutions such as AF_XDP for KubeVirt's QEMU backend and memory providers (io_uring, Devmem TCP for GPU memory) within containers.

Performance and Implementation Details

  • πŸ“Š Preliminary benchmarks using the QEMU AF_XDP backend with queue leasing showed a 37% improvement in throughput and 30-35% lower latency.
  • πŸ› οΈ The implementation introduces a new Q_CREATE API command with a lease attribute, allowing specification of the physical device and queue ID for leasing.
  • πŸ”’ The system ensures proper lifetime management and prevents deadlocks by consistently locking virtual devices before physical ones, and blocking queue resizing on leased queues.

Extending the XDP API

  • 🎯 To enhance KubeVirt, a new AF_XDP TX hook is needed for policy enforcement on egress traffic from VMs, complementing existing ingress policy capabilities.
  • πŸ“ˆ The XDP API is being revamped to support BPF multi-attach capabilities (similar to TCX), enabling multiple XDP programs and queue-range specific attachments.
  • βš™οΈ This revamp aims to provide a more flexible and powerful XDP framework for future networking needs, including dynamic program execution without extensive driver modifications.
Knowledge graph40 entities Β· 33 connections

How they connect

An interactive map of every person, idea, and reference from this conversation. Hover to trace connections, click to explore.

Hover Β· drag to explore
40 entities
Chapters17 moments

Key Moments

Transcript179 segments

Full Transcript

Topics15 themes

What’s Discussed

Zero-copy mechanismsContainersKubeVirtMemory providersXDP APINetwork namespacesKubernetesVirtualizationNetkit devicesSR-IOV (SIOV)AF_XDPio_uringGPU memoryNIC queue leasingBPF multi-attach
Smart Objects40 Β· 33 links
ConceptsΒ· 20
ProductsΒ· 17
PeopleΒ· 2
CompanyΒ· 1