Topic: Accelerate virtio/vhost using DPDK in NFV/Cloud ......Virtio. is the defacto...
Transcript of Topic: Accelerate virtio/vhost using DPDK in NFV/Cloud ......Virtio. is the defacto...
Topic: Accelerate virtio/vhost using DPDK in NFV/Cloud Environment Company: IntelTitle: Software EngineerName: Xie, huawei; Tan, Jianfeng
Agenda• virtio/vhost background• virtio in NFV/Cloud (challenges, solutions)
1. virtio PMD optimization2. vhost TSO3. vhost reconnect4. VM2VM fastpath
• virtio in container
Virtio is the defacto para-virtualization standard for communicating with Virtual Machines (VM) efficiently.
Vhost is the KVM backend for Virtio, supplying packets to a Virtio Frontend.
Packet FlowA bridge/virtual switch, switches packets to the backend (vhost) and these are forwarded to the frontend (virtio) in the Guest.
virtio/vhost background
virtio in NFV/CloudNorth2South Perf
vhost TSO
East2West Perf :VM2VM
Stabilityvhost reconnect
vhost AVX, delayed copy
virtio PMD optimization
DPDK virtio development journey
5
virtio PMD
2013 2014 2015 2016
multiplequeue
mergeable
vhost lib
vhost user
livemigration
virtio 1.0kni vhost
vhost cuse
xenvirt
zerocopy
vhost delayed copy
2017
virtioin container
vhost PMD
virtioring layout
vhostreconnect
virtio in NFV/Cloud
6
North2South Perf
vhost TSO
East2West Perf :VM2VM
Stabilityvhost reconnect
vhost AVX, delayed copy
virtio PMD optimization
‘vhost’‘virtio’
normal virtio process
7
AVAIL
Free Descriptor List
Used
head
host mbuf
guest mbuf
head idxhead idx
8
RX ring layout optmization
9
TX ring layout optmization
normal tx simple tx
TXonly
rx vec rx
RXonly
ring layout opt. and vectorization
10
new ring layout ?
12
virtio in NFV/CloudNorth2South Perf
vhost TSO
East2West Perf :VM2VM
Stabilityvhost reconnect
vhost AVX, delayed copy
virtio PMD and optimization
VHOST TSO
13
virtio
VHOST TSO To NIC
14
vhost TSO in VM2VM
15
vhost TSO performance
VM2NIC Vhost TSO VM2VM vhost TSO
vhost TSO iperf
vhost-user no TSO vhost-user TSO legacy vhost
vhost reconnect
virtio in NFV/CloudNorth2South Perf
vhost TSO
East2West Perf :VM2VM
Stability
vhost AVX, delayed copy
virtio PMD and optimization
vhost reconnect
crash happens!
vq->last_used_idx ?
vq->last_used_idx = vq->used->idx !
restart vhost
virtio in NFV/Cloud
vhost reconnect
North2South Perf
vhost TSO
East2West Perf :VM2VM
Stability
vhost AVX, delayed copy
virtio PMD and optimization
VM2VM fastpath(WIP)
20
Lucidchart - Diagrams Done Right
Lucidchart - Diagrams Done RightLucidchart - Diagrams Done Right
Lucidchart - Dia
http://www.linux-kvm.org/images/8/87/02x09-Aspen-Jun_Nakajima-KVM_as_the_NFV_Hypervisor.pdfhttp://schd.ws/hosted_files/ons2016/36/Nakajima_and_Ergin_PreSwitch_final.pdf
Lucidchart - Diagrams Done RightVM2VM fastpath(WIP)
VM2VM fastpath(WIP)
22
Lucidchart - Diagrams Done Right
• new ISA• vhost delayed copy• vhost AVX• vhost FPGA
Future work
23
virtio for container - Motivations• Requirements for Container-based NFV
– high throughput– low latency
virtio for container - Status quo
HOST
C0 C1 …
HOST
HOST
C0 C1 Cn…
A B
C DCn
vSwitch
App0 App1
HOST
App0 App1
vSwitch
VM
Container
Appn…Appn
…
PF/VF VIRTIO
virtio for container - Architecture• A new IPC in essence
– Kernel-bypass– Well defined msg format– Cache friendly
• Virtio in Container vs VM– Device emulation– Address translation
Container/App
vhost-useradapter
vhost-netadapter
vSwitchvhost
DPDK
Device Emulation
virtio
Socket/tmp/xx.socket
Char file/dev/vhost-net
vhost_net.ko kthread
Virtio PMD
Virtio for container – Addr trans
Virtio pci dev
VM
GPA: Guest Physical Address
GPA LEN
GPA 0 Len 0
GPA 1 Len 1
… …
GPA n Len n
virtio virtual dev
Container
FVA LEN
FVA 0 Len 0
FVA 1 Len 1
… …
FVA n Len n
FVA: Frontend Virtual Address
Virtio/Container - Performance
CPU: Intel(R) Xeon(R) CPU E5-2699 v3 @ 2.30GHz with HT disabledDisclaimer: prototyping result, subject to change with different system configurations
NIC0 NIC1
Linux Bridge PCAP PMD
NIC
ixgbekernel
NIC
Test with variouspacket size
Kernel forwarding(Mpps)
DPDK Pcap Test(Mpps)
Container with virtio(Mpps)
VM with virtio(Mpps)
64 Bytes 0.933 0.699 9.8 9.5
256 Bytes 0.909 0.673 4.5 4.5
512 Bytes 0.821 0.655 2.3 2.3
1024 Bytes 0.819 0.623 1.2 1.2
vhost PMD
ixgbe PMD
virtioPMD
Kernel Space
NIC
vhost PMD
ixgbe PMD
virtioPMD
User Space
VMInstance
ContainerInstance
ixgbekernel
ixgbekernel
Tap device
GUES
T
vhost-net
ioeventfd
irqfd
Virtio DriverRX TX
KVM
Operating System
HOST
QEM
U
Kern
Spa
ceExisting kernel space components.
Virtio is the KVM standard for communicating with Virtual Machines (VM) efficiently
Vhost is the KVM backend for Virtio, supplying packets to a Virtio Frontend.
Packet FlowA virtual switch, switches packets to the backend (vhost) and these are forwarded to the frontend (virtio) in the Guest.
virtio/vhost background
DPDK virtio development journey
31
VIRTIO PMD KNI VHOST VHOST CUSE
VHOST USER and libvirtio multiple QUEUE
VIRTIO 1.0
VHOST live migration
32
virtio optimization: ring layout and vectorization
virtio optimization: ring layout and vectorization
33
Lucidchart - Diagrams Done RightVM2VM fastpath(WIP)