1
Virtio 1 - why do it? And - are we there yet? 2015 Michael S. Tsirkin Red Hat
Uses material from https://lwn.net/Kernel/LDD3/ Gcompris, tuxpaint Distributed under the Creative commons license.
Virtio 1 - why do it? And - are we there yet? 2015 Michael S. - - PowerPoint PPT Presentation
Virtio 1 - why do it? And - are we there yet? 2015 Michael S. Tsirkin Red Hat Uses material from https://lwn.net/Kernel/LDD3/ Gcompris, tuxpaint 1 Distributed under the Creative commons license. Lots of work ... main-title 300 250
1
Uses material from https://lwn.net/Kernel/LDD3/ Gcompris, tuxpaint Distributed under the Creative commons license.
2
2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 50 100 150 200 250 300
main-title
year commits Aug 6 to Aug 6 in each year
3
4
drv→probe(dev); netif_carrier_on(dev) add_status(dev, DRIVER_OK); The driver MUST NOT notify the device before setting DRIVER_OK.
drv→probe(dev); add_status(dev, DRIVER_OK); netif_carrier_on(dev)
5
FF FF 00 00 0.......................................31 FF FF 01 00 00 00 01 00 0.......................................31
+1
6
FF FF 00 00 0.......................................31 00 00 01 00 0.......................................31
+1
FF FF 00 00 00 00 01 00
7
FFFFFFFF 00000000 0.......................................63 00000000 00000001 0.......................................63
+1 1
FFFFFFFF 00000001 00000000 00000001
8
COMMON FEATURES QUEUE STATUS ISR
0.9 1.0
DEVICE SPECIFIC CAPABILITY LIST IO BAR MEMORY BAR VIRTIO CAPABILITY #1 VIRTIO CAPABILITY #2 DEVICE SPECIFIC COMMON FEATURES QUEUE STATUS ISR ...
9
10
0.9
VQ NUMBER 0...................15 DATA
1.0
NOTIFY 0...................15 ADDRESS VQ NUMBER DATA NOTIFY 0...................15 ADDRESS 16............……......31 IGNORED
11
CPU cycles 500 1000 1500 2000 2500 3000 3500 4000 MMIO Fast MMIO Port IO
12
13
CAPABILITY LIST IO BAR MEMORY BAR VIRTIO CONFIG CAPABILITY VIRTIO CAPABILITY Queue Notify Queue Notify VirtQueue Queue Notify
14
52 54 00 12 34 56
Ethernet MAC 52 54 00 12 34 56 VirtQueue
0.9 1.0
15
1 1
0..............1...........2............. DEVICE FEATURES DRIVER 1
DRIVER FEATURES
Defaults must be maintained forever!
16
17
18
virtio-net GUEST VM RAM VHOST USER CLIENT
SETUP DMA Client crash or restart need not cause guest crash!
19
Read STATUS; Detect: NEEDS_RESET set Write STATUS=0 Will reset device Reconfigure device. Write STATUS=DRIVER_OK Restart operation.
20
Transitional Device & Driver Legacy Driver Legacy Device
21
GUEST VHOST USER
DMA
GUEST BIOS
22
– Virtio-blk: writeback / writethrough control – More update guidance
– Virtio-input – Virtio-gpu – Virtio-vsock
23
uplink
24
uplink
25
Virtio Net (on host)
26
27
– Improved robustness for virtual devices
– Yes! – And there's more to come.
28
29
CPU cycles 500 1000 1500 2000 2500 3000 3500 4000 MMIO Port IO
30
PCI CCW (PPC) MMIO (ARM)
31
– Replace Port IO with Memory mapped IO – PCI Express (hotplug, AER, multi-root, SRIOV) – Infinite features
32
33
VALID? PTE
34
VALID? PTE
35
CAPABILITY LIST IO BAR MEMORY BAR VIRTIO CAPABILITY #1 VIRTIO CAPABILITY #2
36
desc avail used VQ
0.9
desc avail used VQ
1.0
37
0.9
1 1
0.......................................31 DEVICE FEATURES DRIVER
1 v
1
DRIVER FEATURES 0... …. …. …. …. …. …. ... 1 2 3 4 DRIVER STATUS = FEATURES_OK
1.0
….. …. ….
SEL
38
Endianness
Virtio LE Virtio BE Device LE Device BE Virtio LE Device Device Device
Virtio 1.0
intel PPC
Virtio 0.9
39
0.9 1.0
Driver Driver Device Device Compatibility
40
Virtio 1.0 Virtio 0.9
INDIRECT next header header
41
transactions/sec 500 1000 1500 2000 2500 3000 3500 virtio 0.9 virtio 1.0
42
43
44
45
London Heathrow Paris CDG London Paris Paris Heathrow CDG London uplink
46
London Heathrow Paris CDG Bangkok Paris Heathrow CDG London uplink
47
London Heathrow Paris CDG London Paris Paris Heathrow CDG London Bangkok uplink
48
virtio-net MAC
00:12:23:45:67:89
NEW
49
London Heathrow Paris CDG Paris Paris Heathrow CDG
NEW
uplink
50
51
52
Current?
RAM?
53
transactions/sec 1000 2000 3000 4000 5000 6000 7000 thread irq
Hit 331668 Miss 79
54
RX TX
55
56
256 512 1024 2048 4096 8192 16384 2000 4000 6000 8000 10000 12000 14000 16000 thread wq
57
256 512 1024 2048 4096 8192 16384 2000 4000 6000 8000 10000 12000 14000 thread wq
58
59
60
PACKET FLOW 192.68.0.1 22 192.68.0.1 12865 22 VM 12865 OVS-VSWITCHD kernel userspace
61
PACKET FLOW 192.68.0.1
22 VM 12865 OVS-VSWITCHD kernel userspace
62
bi-connections/sec 500 1000 1500 2000 2500 match wildcard
63