SlideShare a Scribd company logo
Can VMs networking benefit from
DPDK?
Virtio/Vhost-user status & updates
Maxime Coquelin – Victor Kaplansky
2017-01-27
2
AGENDA
Can VMs networking benefit from DPDK?
● Overview
● Challenges
● New & upcoming features
Overview
4
DPDK – project overview
Overview
DPDK is a set of userspace libraries aimed at fast
packet processing.
● Data Plane Development Kit
● Goal:
● Benefit from software flexibility
● Achieving performance close to dedicated HW solutions
5
DPDK – project overview
Overview
● License: BSD
● CPU architectures: x86, Power8, TILE-Gx & ARM
● NICs: Intel, Mellanox, Broadcom, Cisco,...
● Other HW: Crypto, SCSI for SPDK project
● Operating systems: Linux, BSD
6
1st
release
by Intel as
Zip file
2012 2013
6Wind intiates
dpdk.org
community
DPDK - project history
Overview
Packaged
In Fedora
2014 2015
Power8 &
TILE-Gx
support
ARM
Support /
Crypto
2016 2017
Moving to
Linux Foundation
v1.2
v1.3
v1.4
v1.5
v1.6
v1.7
v1.8
v2.0
v2.1
v2.2
v16.04v16.07
v16.11
v17.02v17.05v17.08v17.11
v16.11: ~750K LoC / ~6000 commits / ~350 contributors
7
DPDK – comparison
Overview
User
Kernel
NIC
Application
Socket
Net stack
Driver
User
Kernel
NIC
Application
DPDK
VFIO
8
DPDK – performance
Overview
DPDK uses:
● CPU isolation/partitioning & polling
→ Dedicated CPU cores to poll the device
● VFIO/UIO
→ Direct devices registers accesses from user-space
● NUMA awareness
● → Resources local to the Poll-Mode Driver’s (PMD) CPU
● Hugepages
→ Less TLB misses, no swap
9
DPDK – performance
Overview
To avoid:
● Interrupt handling
→ Kernel’s NAPI polling mode is not enough
● Context switching
● Kernel/user data copies
● Syscalls overhead
→ More than the time budget for a 64B packet at 14.88Mpps
10
DPDK - components
Overview
Credits: Tim O’Driscoll - Intel
11
Virtio/Vhost
Overview
●
Device emulation, direct assignment, VirtIO
● Vhost: In-kernel virtio device emulation
● device emulation code calls to directly call into kernel
subsystems
● Vhost worker thread in host kernel
● Bypasses system calls from user to kernel space on host
12
Vhost driver model
VM
QEMU
Userspace
Kvm.ko
ioeventfd
irqfd
ioeventfd
Vhost
Host Kernel
13
In-kernel device emulation
● In-kernel restricted to virtqueue emulation
● QEMU handles control plane, feature negotiation, migration,
etc
● File descriptor polling done by vhost in kernel
● Buffers moved between tap device and virtqueues by kernel
worker thread
Overview
14
Vhost as user space interface
● Vhost architecture is not tied to KVM
● Backend: Vhost instance in user space
● Eventfd is set up to signal backend when new buffers are
placed by guest (kickfd)
● Irqfd is set up to signal the guest about new buffers placed by
backend (callfd)
● The beauty: backend only knows about guest memory
mapping, kick eventfd and call eventfd
● Vhost-user implemented in DPDK in v16.7
Overview
Challenges
16
Performance
Challenges
DPDK is about performance, which is a trade-off between:
● Bandwidth → achieving line rate even for small packets
● Latency → as low as possible (of course)
● CPU utilization → $$$
→ Prefer bandwidth & latency at the expense of CPU utilization
→ Take into account HW architectures as much as possible
17
0% packet-loss
• Some use-cases of Virtio cannot afford packet loss, like NFV
• Hard to achieve max perf without loss, as Virtio is CPU intensive
→ Scheduling “glitches” may cause packets drop
Migration
• Requires restoration of internal state including the backend
• Interface exposed by QEMU must stay unchanged for cross-
version migration
• Interface exposed to guest depends on capabilities of third-party
application
• Support from the management tool is required
Reliability
Challenges
18
• Isolation of untrusted guests
• Direct access to device from untrusted guests
• Current implementations require mediator for guest -to-
guest communication.
• Zero-copy is problematic from security point of view
Security
Challenges
New & upcoming features
20
Pro:
• Allows receiving packets larger
than descriptors’ buffer size
Con:
• Introduce extra-cache miss in the
dequeue path
Rx mergeable buffers
New & upcoming features
Desc 0
Desc 1
Desc 2
Desc 3
Desc 4
Desc n
Desc n-1
num_buffers = 1
num_buffers = 3
21
Indirect descriptors (DPDK v16.11)
New & upcoming features
Desc 0
Desc 1
Desc 2
Desc 3
Desc 4
Desc n
Desc n-1
Desc 0
Desc 1
Desc 2
Desc 3
Desc 4
Desc n
Desc n-1
iDesc 2-0
iDesc 2-1
iDesc 2-2
iDesc 2-3
Direct descriptors chaining Indirect descriptors table
22
Pros:
• Increase ring capacity
• Improve performance for large number of large requests
• Improve 0% packet loss perf even for small requests
→ If system is not fine-tuned
→ If Virtio headers are in dedicated descriptor
Cons:
• One more level of indirection
→ Impacts raw performance (~-3%)
Indirect descriptors (DPDK v16.11)
New & upcoming features
23
Vhost dequeue 0-copy (DPDK v16.11)
New & upcoming features
addr
len
flags
next
descriptor
desc's buf mbuf's buf
addr
paddr
len
...
mbuf
Memcpy
addr
len
flags
next
descriptor
desc's buf
addr
paddr
len
...
mbuf
Default
dequeuing
Zero-copy
dequeuing
24
Pros:
• Big perf improvement for standard & large packet sizes
→ More than +50% for VM-to-VM with iperf benchs
• Reduces memory footprint
Cons:
• Performance degradation for small packets
→ But disabled by default
• Only for VM-to-VM using Vhost lib API (No PMD support)
• Does not work for VM-to-NIC
→ Mbuf lacks release notif mechanism / No headroom
Vhost dequeue 0-copy (DPDK v16.11)
New & upcoming features
25
Way for the host to share its max supported MTU
• Can be used to set MTU values across the infra
• Can improve performance for small packet
→ If MTU fits in rx buffer size, disable Rx mergeable buffers
→ Save one cache-miss when parsing the virtio-net header
MTU feature (DPDK v17.05?)
New & upcoming features
26
Vhost-pci (DPDK v17.05?)
New & upcoming features
vSwitch
VM1
Virtio
Vhost
VM2
Virtio
Vhost
VM1
Vhost-pci
VM2
Virtio
Traditional VM to VM
communication
Direct VM to VM
communication
27
Vhost-pci (DPDK v17.05?)
New & upcoming features
VM1
Vhost-pci
driver 1
VM2
Virtio-pci
driver
Vhost-pci
device 1
Virtio-pci
device
Vhost-pci
client
Vhost-pci server
Vhost-pci protocol
28
Pros:
• Performance improvement
→ The 2 VMs share the same virtqueues
→ Packets doesn’t go through host’s vSwitch
• No change needed in Virtio’s guest drivers
Vhost-pci (DPDK v17.05?)
New & upcoming features
29
Cons:
• Security
→ Vhost-pci’s VM maps all Virtio-pci’s VM memory space
→ Could be solved with IOTLB support
• Live migration
→ Not supported in current version
→ Hard to implement as VMs are connected to each other
through a socket
Vhost-pci (DPDK v17.05?)
New & upcoming features
30
IOTLB in kernel
New & upcoming features
VM
IOMMU
driver
VM
QEMU VHOST
IOMMU
Device
IOTLB
iova
IOTLB miss
IOTLB update,
invalidate
TLB invalidation
hva
memory
Syscall/eventfd
31
IOTLB for vhost-user
New & upcoming features
VM
IOMMU
driver
VM
QEMU Backend
IOMMU
IOTLB
Cache
iova
IOTLB miss
IOTLB update,
invalidate
TLB invalidation
hva
memory
Unix Socket
32
• DPDK support for VM is in active development
• 10M pps is real in VM with DPDK
• New features to boost performance of VM networking
• Accelerate transition to NFV / SDN
Conclusions
33
Q / A
THANK YOU

More Related Content

PDF
DPDK Summit 2015 - RIFT.io - Tim Mortsolf
PDF
Hardware accelerated virtio networking for nfv linux con
PDF
DPDK Summit - 08 Sept 2014 - NTT - High Performance vSwitch
PDF
DPDK & Layer 4 Packet Processing
PDF
DPDK Summit - 08 Sept 2014 - Futurewei - Jun Xu - Revisit the IP Stack in Lin...
PDF
DPDK Summit 2015 - NTT - Yoshihiro Nakajima
PDF
Lagopus presentation on 14th Annual ON*VECTOR International Photonics Workshop
PPTX
Revisit DCA, PCIe TPH and DDIO
DPDK Summit 2015 - RIFT.io - Tim Mortsolf
Hardware accelerated virtio networking for nfv linux con
DPDK Summit - 08 Sept 2014 - NTT - High Performance vSwitch
DPDK & Layer 4 Packet Processing
DPDK Summit - 08 Sept 2014 - Futurewei - Jun Xu - Revisit the IP Stack in Lin...
DPDK Summit 2015 - NTT - Yoshihiro Nakajima
Lagopus presentation on 14th Annual ON*VECTOR International Photonics Workshop
Revisit DCA, PCIe TPH and DDIO

What's hot (20)

PDF
OVS and DPDK - T.F. Herbert, K. Traynor, M. Gray
PDF
Intel DPDK Step by Step instructions
PDF
DPDK Summit - 08 Sept 2014 - Intel - Networking Workloads on Intel Architecture
PPTX
Netsft2017 day in_life_of_nfv
PDF
DPDK: Multi Architecture High Performance Packet Processing
PPTX
DPDK summit 2015: It's kind of fun to do the impossible with DPDK
PDF
DPDK Summit - 08 Sept 2014 - 6WIND - High Perf Networking Leveraging the DPDK...
PDF
SR-IOV ixgbe Driver Limitations and Improvement
PDF
Intel dpdk Tutorial
PDF
WAN - trends and use cases
PPTX
High Performance Networking Leveraging the DPDK and Growing Community
PDF
7 hands on
PDF
Openstack v4 0
PDF
DPDK Summit 2015 - Intel - Keith Wiles
PDF
Intel® Ethernet Update
PDF
DPDK Summit 2015 - HP - Al Sanders
PPSX
FD.io Vector Packet Processing (VPP)
PDF
DPDK Summit 2015 - Aspera - Charles Shiflett
PDF
Quieting noisy neighbor with Intel® Resource Director Technology
PDF
Introduction to NVMe Over Fabrics-V3R
OVS and DPDK - T.F. Herbert, K. Traynor, M. Gray
Intel DPDK Step by Step instructions
DPDK Summit - 08 Sept 2014 - Intel - Networking Workloads on Intel Architecture
Netsft2017 day in_life_of_nfv
DPDK: Multi Architecture High Performance Packet Processing
DPDK summit 2015: It's kind of fun to do the impossible with DPDK
DPDK Summit - 08 Sept 2014 - 6WIND - High Perf Networking Leveraging the DPDK...
SR-IOV ixgbe Driver Limitations and Improvement
Intel dpdk Tutorial
WAN - trends and use cases
High Performance Networking Leveraging the DPDK and Growing Community
7 hands on
Openstack v4 0
DPDK Summit 2015 - Intel - Keith Wiles
Intel® Ethernet Update
DPDK Summit 2015 - HP - Al Sanders
FD.io Vector Packet Processing (VPP)
DPDK Summit 2015 - Aspera - Charles Shiflett
Quieting noisy neighbor with Intel® Resource Director Technology
Introduction to NVMe Over Fabrics-V3R
Ad

Similar to Devconf2017 - Can VMs networking benefit from DPDK (20)

PDF
DPDK In Depth
PDF
FreeBSD VPC Introduction
PDF
Dev Conf 2017 - Meeting nfv networking requirements
PPTX
Introduction to DPDK
PDF
DPDK Integration: A Product's Journey - Roger B. Melton
PDF
DPDK Support for New HW Offloads
PDF
Nicolas Vazquez - Open vSwitch with DPDK on CloudStack
PDF
LF_DPDK17_DPDK support for new hardware offloads
PPTX
DPDK layer for porting IPS-IDS
PDF
Achieving the Ultimate Performance with KVM
PPTX
Hardware support for efficient virtualization
PDF
Achieving the Ultimate Performance with KVM
PDF
XPDDS17: PVH Dom0: The Road so Far - Roger Pau Monné, Citrix
PDF
High performance and flexible networking
PDF
Storage-Performance-Tuning-for-FAST-Virtual-Machines_Fam-Zheng.pdf
PDF
Making Networking Apps Scream on Windows with DPDK
PDF
Network Programming: Data Plane Development Kit (DPDK)
PDF
NFV в сетях операторов связи
PPT
Linux virtualization
PDF
LF_OVS_17_OVS-DPDK Installation and Gotchas
DPDK In Depth
FreeBSD VPC Introduction
Dev Conf 2017 - Meeting nfv networking requirements
Introduction to DPDK
DPDK Integration: A Product's Journey - Roger B. Melton
DPDK Support for New HW Offloads
Nicolas Vazquez - Open vSwitch with DPDK on CloudStack
LF_DPDK17_DPDK support for new hardware offloads
DPDK layer for porting IPS-IDS
Achieving the Ultimate Performance with KVM
Hardware support for efficient virtualization
Achieving the Ultimate Performance with KVM
XPDDS17: PVH Dom0: The Road so Far - Roger Pau Monné, Citrix
High performance and flexible networking
Storage-Performance-Tuning-for-FAST-Virtual-Machines_Fam-Zheng.pdf
Making Networking Apps Scream on Windows with DPDK
Network Programming: Data Plane Development Kit (DPDK)
NFV в сетях операторов связи
Linux virtualization
LF_OVS_17_OVS-DPDK Installation and Gotchas
Ad

Recently uploaded (20)

PPTX
Odoo POS Development Services by CandidRoot Solutions
PPTX
Essential Infomation Tech presentation.pptx
PDF
Odoo Companies in India – Driving Business Transformation.pdf
PDF
How Creative Agencies Leverage Project Management Software.pdf
PPTX
Introduction to Artificial Intelligence
PPTX
Reimagine Home Health with the Power of Agentic AI​
PPTX
Transform Your Business with a Software ERP System
PDF
Upgrade and Innovation Strategies for SAP ERP Customers
PDF
System and Network Administraation Chapter 3
PDF
Softaken Excel to vCard Converter Software.pdf
PPTX
ai tools demonstartion for schools and inter college
PDF
PTS Company Brochure 2025 (1).pdf.......
PDF
Design an Analysis of Algorithms I-SECS-1021-03
PDF
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
PDF
Which alternative to Crystal Reports is best for small or large businesses.pdf
PDF
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
PDF
2025 Textile ERP Trends: SAP, Odoo & Oracle
PDF
Understanding Forklifts - TECH EHS Solution
PDF
Nekopoi APK 2025 free lastest update
PPTX
Operating system designcfffgfgggggggvggggggggg
Odoo POS Development Services by CandidRoot Solutions
Essential Infomation Tech presentation.pptx
Odoo Companies in India – Driving Business Transformation.pdf
How Creative Agencies Leverage Project Management Software.pdf
Introduction to Artificial Intelligence
Reimagine Home Health with the Power of Agentic AI​
Transform Your Business with a Software ERP System
Upgrade and Innovation Strategies for SAP ERP Customers
System and Network Administraation Chapter 3
Softaken Excel to vCard Converter Software.pdf
ai tools demonstartion for schools and inter college
PTS Company Brochure 2025 (1).pdf.......
Design an Analysis of Algorithms I-SECS-1021-03
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
Which alternative to Crystal Reports is best for small or large businesses.pdf
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
2025 Textile ERP Trends: SAP, Odoo & Oracle
Understanding Forklifts - TECH EHS Solution
Nekopoi APK 2025 free lastest update
Operating system designcfffgfgggggggvggggggggg

Devconf2017 - Can VMs networking benefit from DPDK

  • 1. Can VMs networking benefit from DPDK? Virtio/Vhost-user status & updates Maxime Coquelin – Victor Kaplansky 2017-01-27
  • 2. 2 AGENDA Can VMs networking benefit from DPDK? ● Overview ● Challenges ● New & upcoming features
  • 4. 4 DPDK – project overview Overview DPDK is a set of userspace libraries aimed at fast packet processing. ● Data Plane Development Kit ● Goal: ● Benefit from software flexibility ● Achieving performance close to dedicated HW solutions
  • 5. 5 DPDK – project overview Overview ● License: BSD ● CPU architectures: x86, Power8, TILE-Gx & ARM ● NICs: Intel, Mellanox, Broadcom, Cisco,... ● Other HW: Crypto, SCSI for SPDK project ● Operating systems: Linux, BSD
  • 6. 6 1st release by Intel as Zip file 2012 2013 6Wind intiates dpdk.org community DPDK - project history Overview Packaged In Fedora 2014 2015 Power8 & TILE-Gx support ARM Support / Crypto 2016 2017 Moving to Linux Foundation v1.2 v1.3 v1.4 v1.5 v1.6 v1.7 v1.8 v2.0 v2.1 v2.2 v16.04v16.07 v16.11 v17.02v17.05v17.08v17.11 v16.11: ~750K LoC / ~6000 commits / ~350 contributors
  • 7. 7 DPDK – comparison Overview User Kernel NIC Application Socket Net stack Driver User Kernel NIC Application DPDK VFIO
  • 8. 8 DPDK – performance Overview DPDK uses: ● CPU isolation/partitioning & polling → Dedicated CPU cores to poll the device ● VFIO/UIO → Direct devices registers accesses from user-space ● NUMA awareness ● → Resources local to the Poll-Mode Driver’s (PMD) CPU ● Hugepages → Less TLB misses, no swap
  • 9. 9 DPDK – performance Overview To avoid: ● Interrupt handling → Kernel’s NAPI polling mode is not enough ● Context switching ● Kernel/user data copies ● Syscalls overhead → More than the time budget for a 64B packet at 14.88Mpps
  • 10. 10 DPDK - components Overview Credits: Tim O’Driscoll - Intel
  • 11. 11 Virtio/Vhost Overview ● Device emulation, direct assignment, VirtIO ● Vhost: In-kernel virtio device emulation ● device emulation code calls to directly call into kernel subsystems ● Vhost worker thread in host kernel ● Bypasses system calls from user to kernel space on host
  • 13. 13 In-kernel device emulation ● In-kernel restricted to virtqueue emulation ● QEMU handles control plane, feature negotiation, migration, etc ● File descriptor polling done by vhost in kernel ● Buffers moved between tap device and virtqueues by kernel worker thread Overview
  • 14. 14 Vhost as user space interface ● Vhost architecture is not tied to KVM ● Backend: Vhost instance in user space ● Eventfd is set up to signal backend when new buffers are placed by guest (kickfd) ● Irqfd is set up to signal the guest about new buffers placed by backend (callfd) ● The beauty: backend only knows about guest memory mapping, kick eventfd and call eventfd ● Vhost-user implemented in DPDK in v16.7 Overview
  • 16. 16 Performance Challenges DPDK is about performance, which is a trade-off between: ● Bandwidth → achieving line rate even for small packets ● Latency → as low as possible (of course) ● CPU utilization → $$$ → Prefer bandwidth & latency at the expense of CPU utilization → Take into account HW architectures as much as possible
  • 17. 17 0% packet-loss • Some use-cases of Virtio cannot afford packet loss, like NFV • Hard to achieve max perf without loss, as Virtio is CPU intensive → Scheduling “glitches” may cause packets drop Migration • Requires restoration of internal state including the backend • Interface exposed by QEMU must stay unchanged for cross- version migration • Interface exposed to guest depends on capabilities of third-party application • Support from the management tool is required Reliability Challenges
  • 18. 18 • Isolation of untrusted guests • Direct access to device from untrusted guests • Current implementations require mediator for guest -to- guest communication. • Zero-copy is problematic from security point of view Security Challenges
  • 19. New & upcoming features
  • 20. 20 Pro: • Allows receiving packets larger than descriptors’ buffer size Con: • Introduce extra-cache miss in the dequeue path Rx mergeable buffers New & upcoming features Desc 0 Desc 1 Desc 2 Desc 3 Desc 4 Desc n Desc n-1 num_buffers = 1 num_buffers = 3
  • 21. 21 Indirect descriptors (DPDK v16.11) New & upcoming features Desc 0 Desc 1 Desc 2 Desc 3 Desc 4 Desc n Desc n-1 Desc 0 Desc 1 Desc 2 Desc 3 Desc 4 Desc n Desc n-1 iDesc 2-0 iDesc 2-1 iDesc 2-2 iDesc 2-3 Direct descriptors chaining Indirect descriptors table
  • 22. 22 Pros: • Increase ring capacity • Improve performance for large number of large requests • Improve 0% packet loss perf even for small requests → If system is not fine-tuned → If Virtio headers are in dedicated descriptor Cons: • One more level of indirection → Impacts raw performance (~-3%) Indirect descriptors (DPDK v16.11) New & upcoming features
  • 23. 23 Vhost dequeue 0-copy (DPDK v16.11) New & upcoming features addr len flags next descriptor desc's buf mbuf's buf addr paddr len ... mbuf Memcpy addr len flags next descriptor desc's buf addr paddr len ... mbuf Default dequeuing Zero-copy dequeuing
  • 24. 24 Pros: • Big perf improvement for standard & large packet sizes → More than +50% for VM-to-VM with iperf benchs • Reduces memory footprint Cons: • Performance degradation for small packets → But disabled by default • Only for VM-to-VM using Vhost lib API (No PMD support) • Does not work for VM-to-NIC → Mbuf lacks release notif mechanism / No headroom Vhost dequeue 0-copy (DPDK v16.11) New & upcoming features
  • 25. 25 Way for the host to share its max supported MTU • Can be used to set MTU values across the infra • Can improve performance for small packet → If MTU fits in rx buffer size, disable Rx mergeable buffers → Save one cache-miss when parsing the virtio-net header MTU feature (DPDK v17.05?) New & upcoming features
  • 26. 26 Vhost-pci (DPDK v17.05?) New & upcoming features vSwitch VM1 Virtio Vhost VM2 Virtio Vhost VM1 Vhost-pci VM2 Virtio Traditional VM to VM communication Direct VM to VM communication
  • 27. 27 Vhost-pci (DPDK v17.05?) New & upcoming features VM1 Vhost-pci driver 1 VM2 Virtio-pci driver Vhost-pci device 1 Virtio-pci device Vhost-pci client Vhost-pci server Vhost-pci protocol
  • 28. 28 Pros: • Performance improvement → The 2 VMs share the same virtqueues → Packets doesn’t go through host’s vSwitch • No change needed in Virtio’s guest drivers Vhost-pci (DPDK v17.05?) New & upcoming features
  • 29. 29 Cons: • Security → Vhost-pci’s VM maps all Virtio-pci’s VM memory space → Could be solved with IOTLB support • Live migration → Not supported in current version → Hard to implement as VMs are connected to each other through a socket Vhost-pci (DPDK v17.05?) New & upcoming features
  • 30. 30 IOTLB in kernel New & upcoming features VM IOMMU driver VM QEMU VHOST IOMMU Device IOTLB iova IOTLB miss IOTLB update, invalidate TLB invalidation hva memory Syscall/eventfd
  • 31. 31 IOTLB for vhost-user New & upcoming features VM IOMMU driver VM QEMU Backend IOMMU IOTLB Cache iova IOTLB miss IOTLB update, invalidate TLB invalidation hva memory Unix Socket
  • 32. 32 • DPDK support for VM is in active development • 10M pps is real in VM with DPDK • New features to boost performance of VM networking • Accelerate transition to NFV / SDN Conclusions