SlideShare ist ein Scribd-Unternehmen logo
1 von 24
Downloaden Sie, um offline zu lesen
Reconnaissance of Virtio: What’s new 
and how it’s all connected? 
© 2013 SAMSUNG Electronics Co. 
Mario Smarduch 
Senior Virtualization Architect 
Open Source Group 
Samsung Research America (Silicon Valley) 
m.smarduch@samsung.comSmarduch 
Senior Virtualization Architect 
Open Source Group 
Samsung Research America (Silicon Valley) 
m.smarduch@samsung.com
2 
© 2013 SAMSUNG Electronics Co. 
Agenda 
 QEMU/Guest Machine Model  IO Overview 
 Concepts - transport/backend – recent re-factoring 
 PCI transport and most recent virtio-mmio transport 
 Virtio and Device Passthrough, virtio performance
LTTPMeawaevbgomele elosry BACKEND FRONTEND WDT IDE/SCSI ………. BACKEND 
KVM mmio-TRANSPORT 
3 
© 2013 SAMSUNG Electronics Co. 
Machine Model 
Host 
QEMU Guest 
ISnPtRe rVruvirCptPtu, aUTliizmaetiro,n ISnPtRe rVruivrptCtu,P aTUliizmaetiro,n CONSOLENIC Drivers -FRONTEND 
TTAUPN/ LSITBDCIO ECmOuNlSaOtioLnE ENmICulation 
• Like host, unmodified guest expects real hardware 
• Machine model – combination of hw extensions, KVM, QEMU, GUest 
 Interrupt Local and Distributor – hw virt extensions + kvm 
 Special Purpose Register – i.e. enable/disable MMU, discover CPU features – hw virt ext + kvm 
 Timer – hw virt extensions + kvm 
 Memory – hw virt + kvm 
 Drivers/Devices – (i) mmio (ii) para-virtualized (iii) dev passthrough 
 Machine Model - defines hw – CPU, Peripherals, HW address map 
• Some Terms 
 Transport – way Guest to (i) probe, discover backend – resources; (ii) configure backend 
 Frontend – guest driver 
 Backend – whole QEMU I/O emulation + host device
LTTPMeawaevbgomele elosry BACKEND FRONTEND WDT IDE/SCSI ………. BACKEND 
4 
© 2013 SAMSUNG Electronics Co. 
MMIO Example 
QEMU Guest 
ISnPtRe rVruvirCptPtu, aUTliizmaetiro,n ISnPtRe rVruivrptCtu,P aTUliizmaetiro,n CONSOLENIC Drivers -FRONTEND 
TTAUPN/ LSITBDCIO ECmOuNlSaOtioLnE ENmICulation 
Host 
KVM mmio-TRANSPORT 
• Typing a charter – ‘-nographic’ 
 Keyboard stroke – QEMU backend (IO thread) reads from stdio 
 Finds Qemu Frontend – console emulation device passes character 
 Console device injects interrupt via KVM, guest exit/resume 
 Console interrupt handler – mmio read of device buffer 
o guest exits, decodes regs to packages addr/data size 
o Returns from vCPU KVM_RUN loop to QEMU 
o QEMU finds console device handler from addr (GPA) 
o Console handler returns data at address 
o Return to KVM, data placed in dest register 
o Resume guest 
• MMIO a lot of overhead!
5 
© 2013 SAMSUNG Electronics Co. 
Vision and Practice 
• QEMU/Guest - Vision 
 Portability any backend plugs into any transport – no clue about transport 
o Typically one transport configured 
o ‘- virtio_xxx_device’ option – no hint of transport – plug into first available one 
 Guest virtio driver unaware of transport 
o All transports can probe, discover backend 
o Indirect transport interface – i.e. virtio-net does not know what transport 
 Example 
QEMU Guest 
PCI transport virtio-vmirtmio-ionett-ransport vdiertviioc-enet- device EnumeErantuemerate virtiov-pirctiio-mmPrioobe vdirritvioer-net
6 
© 2013 SAMSUNG Electronics Co. 
Vision and Practice 
• In Practice – PCI preferred transport 
 Transport/backends ‘fused’ 
 Backend plugged into PCI 
 Prior knowledge of machine model required 
o Command line – specify transport 
o No Portability 
QEMU 
PCvdI ierttvriioac-nensept-ort 
virtio-net-pci 
Guest 
virtiov-pirctiio-mmPrioobe vdirritvioer-net
7 
© 2013 SAMSUNG Electronics Co. 
Virtio – moving data 
• virtio – ring buffers accessed from several contexts 
• Must deal with different addresses when moving data to/from virtio device 
QEMU 
TTAUBPNA/CKENLSITBDDCIOBACKENCODNFRONNTIECND GMueemsto ry • Between Guest  QEMU – QEMU view 
• Host mmap() address – QEMU VA – HVA 
• To get HVA from GPA 
 Find memory region section 
 Offset = GPA – MemoryRegion base 
 Add HVA base in RAMBlock add offset 
• To get GPA from HVA 
 From RAMBlock find MemoryRegion 
 Offset = HVA address – HVA base 
 Add to MemoryRegion base address
8 
© 2013 SAMSUNG Electronics Co. 
Virtio – moving data 
GMueemsto ry 
• Between Guest  QEMU or host – Guest view 
 Guest knows nothing abut HVA 
 Current hw supports two level page tables 
 2nd level page table maps GPA  HPA
VVVrrriiinnngggDDDeeesssccc===TTTxxxGGGPPPAAA++ VVVrrriiinnngggDDDeeesssccc===GGGPPPAAA++…… TTTxxxGGGPPPAAA++DDeesscc+ Avail Rx....GPA GUEST 
• Performance achieved through direct memory access (see Rusty Russels spec) 
9 
© 2013 SAMSUNG Electronics Co. 
Virtio – moving data 
IO Thread Virtqueue Virtqueue 
fTNdoe/tsfwerlooemrckt 
QEMU GUEST 
TxQueue VraindgdrDesRcx Queue 
 
VVrrffv…iillrnnaa.i.ggngggss__,,au_ vuiisnnaesddideGleedPxx_,Ae rl;e inlmegn[[,]] …ring 
VraindgdrDesc 
 
VVrrffv…iillrnnaa.i.ggngggss__,,au_ vuiisnnaesddideGleedPxx_,Ae rl;e inlmegn[[,]] …ring 
1 - virtio_net_hdr (skb-cb[]) 
2 – skb-data[] 
Scatterlist 
1 – page_link = page – of virtio_net_hdr 
offset = offset within page 
length = sizeof virtio_net_hdr 
2 – page_link = page – of skb-data 
offset = … 
length = skb-len 
Simple pkt – no fragments 
Vring descriptor 
1 – GPA addr of virtio_net_Hdr 
length 
2 – GPA addr of skb-data 
length 
NOTIFY
VVVrrriiinnngggDDDeeesssccc===TTTxxxGGGPPPAAA++ VVVrrriiinnngggDDDeeesssccc===GGGPPPAAA++…… TTTxxxGGGPPPAAA++DDeesscc+ Avail Rx....GPA QEMU 
10 
© 2013 SAMSUNG Electronics Co. 
IO Thread Virtqueue Virtqueue 
fTNdoe/tsfwerlooemrckt 
QEMU GUEST 
TxQueue VraindgdrDesRcx Queue 
 
VVrrffv…iillrnnaa.i.ggngggss__,,au_ vuiisnnaesddideGleedPxx_,Ae rl;e inlmegn[[,]] …ring 
VraindgdrDesc 
 
VVrrffv…iillrnnaa.i.ggngggss__,,au_ vuiisnnaesddideGleedPxx_,Ae rl;e inlmegn[[,]] …ring 
VirtQueueElement 
1. out_addr = GPA virtio_net_hdr 
out_sg.iov_len = virtio_net_hdr length 
2. out_addr = GPA skb-data 
out_sg.iov_len = skb-len VirtQueueElement 
1. out_sg.iov_base = HVA virtio_net_hdr 
out_sg.iov_len = virtio_net_hdr length 
2. out_sg.iov_base= HVA skb-data 
out_sg.iov_len = skb-len 
qemu_sendv_packet_async 
(…, out_sg, out_len, … 
virtio_net_tx_coplete) 
Virtio – moving data
11 
© 2013 SAMSUNG Electronics Co. 
Virtio – moving data 
Guest – convert GVA - HPA Host GPA - HVA, HVA - GPA 
Tx-GPA 
1v0r[__0i__2_vrisn-_n6u_]_4.g_un41 u*_1 e6 tgr__uu__1aa6x vdv6ft c1uut6s3e ra rl=daiifning1rlla;ggs, g_;_[[ _v2fdrl iaindgg;s s1d1_u;0_] e._;_ 3_u__su_u2ns_21c4eu 6]xl1 e n eu3d12_6 el t6n=e;2i dx, tx…; eliednmx;;ring[] 
Tx-GPA+0x4000 TX-Vring Tx-GPA+0x5000 
VRing vring; 
{ 
unsinged int num=… 
hwaddr desc = Desc Tx-GPA 
hwaddr avail = Desc Tx-GPA + ofst 
hwaddr used = Tx-GPA + ofst 
} /* VRing */ 
Guest Vring Operations 
xmssggi---…t___ss…sssseegggktt---b__(bb…lopuuefa)ffgf((gsnsseecctt_aah ltt=ittn…ee kprrlla=iissgtt ep** assogggfe,,f s……et,, svkirbti-o_dnaetta_h)dr) vvvv…qqqq-.----mvvnvmrrroiiiinnntoigggfyw...ddd(vreeeiqtssse)ccc [[[–iii]]]...aafVlddaIRgddTsrr IO=== _ sG…xgxPx-A_Q leoUnfE gpUtahEg_NeOTIFY 
Host Vring Operations 
virvtiioihrt_w=qn uaevG-deti_rudhtVferqlwu_uAdaspehedo us_d-ptecrx(__q(ppg…- aaeG. )tt==_xVh _vevvAqaqqd-- , (Bvvvqearri,l nisenvgmeqg.a- .)dv+aelai slsc(t+p;_ aaovfa f–isle_itnGodfP(eVxAR+i)+ng)Avail, ring[i]) Chflawogpraensa-dt vud==rerre ntvddurr eelirtndsns cguc t_l__wdopdpu_a eapwGs+=hc_ _Vy psfvsihlAqza(ypeg-soas(()fvpd(rVaeinR)sgcin_.dgpeDas,e cis)c) * i+ offsetof(VringDesc, flags) eeCll…eeomm..n--vooeuurttt__ saGgd[d…Pr[]Ae.iole v–m_l-eno=vu rtv_irnninugmg__]d d=ees vcs_rcilen-ng(_ddaeesdscc_d_parad, tdi)or(d GesVc_Apa, i) Convert GPA – vring_desc-addr to GVA 
--…e.TNl.exomoti-fuyt ogBuuatec_ksstge n[–…dT].xioivn_tbearrsuep=t ccopmu_pplehtyiosnical_memory_map(elem-out_addr[…], …)
Virtio and Device Pass-through 
12 
© 2013 SAMSUNG Electronics Co. 
Basic Operation - Backend/Guest direct access to 
shared Vring buffers - PIO 
- Switching at software level 
- Management Flexibility – internal 
SDN support 
ovs-vsctladd-port br0 ofctl–control flowsphys-intfc -vSwitch - IRQ bottleneck – 
inject Kernel –injectQ dEiMrecUt l–ycall into kvm 
- Direct access to hw memory regions 
- DMA Support 
- Switching at hw level – SR-IOV 
depends on #of Queues 
- Management Flexibility – external 
SDN capable 
- IRQ bottleneck – hw enhancements, 
posted interrupts, exitless EOI 
improve things – closer to native 
Migration - Virtio lockless 
- Saves device state, tracks dirty 
pages 
- QEMU sets ‘unmigratable’, or installs 
migration blocker 
- Guest can be holding a lock – 
deadlock, hw state, …. 
Scalability - Practical limitations – primarily per 
formance 
- Number of Devices limited, limits 
#VMs 
- SR-IOV - #of VF - # of queues 
Network 
Performance 
- Soft switching – bridge, vSwitch 
- Several IO HOPS 
- Can approach near native – 10Ge 
for few bridged Guest 
- Switching done at HW level – hw 
queues 
- Performance scales with # of Guests 
- DMA support 
- IRQ Passthrough still a problem 
Host 
Performance 
- PIO – takes cpu cycles 
- Exits – few but still 
- Guest pages swapable 
- Guest pinned – can’t swap 
- Fewer exits 
- Less PIO 
Cloud 
Environment 
- Cloud friendly – migration, SDN, 
paging 
- Not Cloud friendly, great for NFV/RT 
DPDK, run to completion
13 
© 2013 SAMSUNG Electronics Co. 
Virtio PCI Architecture 
• virtio-net example with QEMU backend – virtio-pci 
Guest 
ISnPtRe rVruvirCptPtu, aUTliizmaetiro,n ISnPtRe rVruivrptCtu,P aTUliizmaetiro,n 
QEMU 
BACBKAECNKDEND FRONTEND 
TUN/TAP tvriar12Mtn..i osMPVp-CpioIrOcIrt iti oEAndOudmptvrreieaarrtnsraiasost pt-iRiomooanrnmtnsgioe RAM Addresvdsir riRtvieoarn-ngeet 
cvoirntifoig_p_ocip_s --VirvreetvdvIOisniiroPobtPrnCui_C,oiI sdPcI-,l randoBseesxuvyt_sid RViinrtgio Buffers • Virtio device – combination of mmio  paravirt device 
PCI Config 
• Before Guest Runs …. QEMU does 
 creates proxy that plugs into PCI Bus 
 During instantiation of VirtIOPCIProxy its 
o PCIDevice vendor id, device id, class, … are set 
 Instantiates virtio-net – bus_type = TYPE_VIRTIO_BUS 
o Plugs into VirtIOPCIProxy bus – TYPE_VIRTIO_BUS 
o Fills in PCI BAR0 type PIO 
o Associates virtio_pci_config_ops with B/D/F BAR0 
• Guest 
 Enumarates PCI Bus – discovers virtio-net – via mmio 
 Loads virtio-pci, creates virtio-net device 
 virtio-net driver loads probes virtio-net backend – via mmio
QEMU Object Model 
• QEMU Class, Object view of ‘–device virtio-net-pci’ 
 First instantiate Class – C++ Class definition 
 Next the Object – C++ Declare Class variable 
 Realize it– C++ constructor default or defined 
14 
VirtioBusState 
© 2013 SAMSUNG Electronics Co. 
TYPE_DEVICE 
TYPE_PCI_DEVICE 
TYPE_VIRTIO_PCI 
.init/realizefn 
TYPE_VIRTIO_NET_PCI 
.instance_init 
TYPE_BUS 
TYPE_VIRTIO_BUS 
VirtIONet 
TYPE_DEVICE 
TYPE_VIRTIO_DEVICE 
- bus_type = TYPE_VIRTIO_BUS 
TYPE_VIRTIO_NET 
PCI Bus 
Object View 
VirtIONetPCI 
- VirtIOPCIProxy dev 
- PCIDevice pdev 
config[] – vednor, device id, 
- VirtioBusState bus 
- VirtIONet vdev 
TYPE_VIRTIO_NET_PCI 
TYPE_VIRTIO_BUS 
TYPE_VIRTIO_NET 
Class View
15 
© 2013 SAMSUNG Electronics Co. 
virtio-mmio transport 
• virtio-net example with QEMU backend – virtio-mmio 
• Discovery/Probing … like PCI 
• Primarily ARM – with Guest QEMU/Guest PCI support – virtio-mmio less use 
• Some Use cases 
 Want your own Machine Model – don’t want PCI, have Device Tree support 
 Lots of Embedded Devices – simplified machine model 
o Automotive, Edge Network, Set top Box 
 virtio-mmio another option
• Virtio-mmio – example similar to PCI 
TYPE_DEVICE ‘pvliurgtigoe-db udsy’ ncaremvaiitcreatdilol yb-DeviceState 
macmkeinod/virtio-mmiodevconfig12M.. TYPE_TYPE_MVMiIrMOti IoOAdO BUS 
Edpnreeursmast VirtioBusState 
VIRTIO_BUS 
aiRoraantnsiogne 16 
© 2013 SAMSUNG Electronics Co. 
Virtio MMIO Architecture 
Guest 
ISnPtRe rVruvirCptPtu, aUTliizmaetiro,n ISnPtRe rVruivrptCtu,P aTUliizmaetiro,n 
QEMU 
BACBKAECNKDEND FRONTEND 
TUN/TAP tvriartniosp-mormtio tvriartniosp-pocrit RAM Addresvdsir riRtvieoarn-ngeet 
_voirptiso_memVirmtIOaiMbnu_MssIyOsPteromxy_bus 1. Instantiate multiple virtio-mmio devices – no qemuRViinartgio rBugffesrsimplicitly done 
TYPE_SYS_BUS_DEVICE SysBusDevice 
TYPE_VIRTIO_MMIO VirtIOMMIOProxy 
…. 
VirtioBustState bus 
.init/.realizefn 
2. Associate resources with each virtio-mmio range 
• MMIO address range a page, interrupt # - only machine models what resources
Virtio MMIO Architecture 
VirtioBusState 
VirtIONet 
17 
Guest 
ISnPtRe rVruvirCptPtu, aUTliizmaetiro,n ISnPtRe rVruivrptCtu,P aTUliizmaetiro,n 
© 2013 SAMSUNG Electronics Co. 
QEMU 
BACBKAECNKDEND FRONTEND 
TUN/TAP tvriartniosp-mormtio tvriartniosp-pocrit RAM Addresvdsir riRtvieoarn-ngeet 
_voirptiso_memVirmtvIOairiMbntui_Moss-IyOnsPteertomxy_bus virtio-mmio/virtio-mmiodevconfig12M.. MVMiIrMOti IoOAdO Edpnreeursmast aiRoraantnsiogne RViinrtgio Buffers 
3. ‘-virtio-net-device’ – instantiates/plugs TYPE_VIRTIO_NET 
• No transport specified any backend (virtio-net, virtio-blk,…) plug into transport 
• Virtio-net inherits VirtIODevice which sets ‘bus_type = TYPE_VIRTIO_BUS’ 
• Finds matching bus VirtIOMMIOproxy-bus, plugs TYPE_VIRTIO_NET 
• Finds and binds to QEMU backend – f.e. –netdev type=tap …. 
TYPE_DEVICE 
TYPE_VIRTIO_DEVICE 
- bus_type = TYPE_VIRTIO_BUS 
TYPE_VIRTIO_NET 
TYPE_DEVICE DeviceState 
TYPE_SYS_BUS_DEVICE SysBusDevice 
TYPE_VIRTIO_MMIO VirtIOMMIOProxy 
…. 
VirtioBustState bus 
VirtIONet vdev 
.init/.realizefn 
TYPE_BUS 
TYPE_VIRTIO_BUS
Guest virtio discovery framework – virtio-mmio view 
• Transparent to Guest – enable virtio and mmio 
• Device Tree used 
18 
© 2013 SAMSUNG Electronics Co. 
QEMU 
- Machine Initialization 
- creates virtio-mmio transports 
plugs into system bus 
- specific machine model knows 
resources 
- modifes Guest FDT with mmio 
addr/size, Intr 
QEMU 
- Backend Initialization 
- ‘-virtio-xxx-device’ specified 
- device instanitated 
- searches for ‘virtio-bus’ class 
here virtio-mmio plugs in 
Guest 
- virtio-mmio driver probe 
- OF instantiates platform_device 
for ‘virtio-mmio’ 
- virtio-mmio – driver called probes 
transports 
- sanity checks virtio-mmio transport 
Guest 
- Discover Backend 
- check if transport plugged? 
- probe device – vendor, device id 
- register virtio device 
Guest 
- Virtio driver probe 
- probe device indirectly through 
virtio-mmio transport 
- create queues, program backend 
- present interface to kernel 
- more next slide ….
Guest virtio discovery framework – virtio-mmio view 
Machine Initialization 
TYPE_DEVICE DeviceState 
TYPE_SYS_BUS_DEVICE SysBusDevice 
TYPE_VIRTIO_MMIO VirtIOMMIOProxy 
of_platform_populate(…, of_device_id match[], …) 
DT Node 
virtio-mmio { 
addr, size, irq; 
} 
19 
platform_device { 
…. 
} 
© 2013 SAMSUNG Electronics Co. 
sysbus_create_simple(“virtio-mmio’, base, pic[irq]) 
…. 
…. …. 
VirtioBustState bus 
.init/.realizefn 
VirtioBusState 
TYPE_BUS 
TYPE_VIRTIO_BUS 
add_virtio_mmio_node(fdt, …, mmio addr, irq pin) 
Backend Initialization 
……. 
QEMU option … ‘-virtio-net-device’ 
device_init_func(opts, ….) 
VirtIONet 
TYPE_DEVICE 
TYPE_VIRTIO_DEVICE 
- bus_type = TYPE_VIRTIO_BUS 
TYPE_VIRTIO_NET 
virtio-mmio driver probe 
… virtio_mmio_driver = { 
.probe = virtio_mmio_probe, 
… 
} 
virtio_mmio_probe(*pdef) 
- virtio_mmio_vdev *vm_dev 
vm_dev-base = ioremap(virtio-mmio – GPA, size) 
virtio_device transport interface, PCI has one too 
vm_dev-vdev.config = virtio_mmio_config_ops 
sanity check – mmio to ‘virtio_mem_ops’ handlers 
magic = readl(vm_dev-base + VIRTIO_MMIO_MAGIC_VALUE) 
version = readl (…..)
Guest virtio discovery framework – virtio-mmio view 
20 
© 2013 SAMSUNG Electronics Co. 
Discover Backend 
Identify if device plugged, if yes identify device 
register the device 
) 
vm_register_dev-virtio_vdev.id.device(device= vendor= readl(structvirtio_readl(….) vm_dev-devicedev=base + vm_dev-VIRTIO_vdev 
MMIO_DEVICE_ID) Ack device found by transport, use transport interface 
-dev-config-set_status( … get_stattus() | VIRTIO_CONFIG_S_ACKNOWLEDGE) find matching driver on virtio bus 
-b-uvsi_rftoior__edaecvh_m_dartvc(…h(.d)ev, drv) Ack driver found for device 
Fe---a-Gdwtueieafrvtl ek s-b uNdapcrceopikvgnoeeofrdrittg e fif-aedeta aisstotueeuntrtr e_ ev–s sdtt aate–htbvuelb-esse( e… _f- efgaeacreatheutte_ urkscerteeksays ti uf=p sb e(d)ar cef| okvVer-ImnRdcTao InOsncu_fepiCg pOf-eoNargtFtsueI Gtr–_e_fbSse_eaD_tufRerIaeVtsEu(vRrde)sevb)it set --scabea))ll elb dcdartri cvi vkefeeerrna ftdpeu arrfoteeubsar ete–u s–rv endvsoie rntvt no-seut tcps_ouppnporfopritgboe-erdt( e)fb diny a bblyiaz cedk_rfeiveneadrt u ddroeosnn(’’vttd ggeeevtt- sseefelleeacctttueerddes[]) virtio driver probe 
instantiate network device interface 
d…e.v= alloc_etherdev_mq(…, # of queues) Various performance features – primarily offload, big packets 
-----CVhdITBneeeaiclvtclik- kab elsianczucoedpk n peq–fnoiugsdree-t uetGsedf Fsi GnN f–edP a_Aoatvf luql aorVsnec(rds…ain t)–GegdPfar Aonb mdyin gbdvuuedefxefseevts-r icnfoetuoan tDut refeosscr r –iepastceohtr sdq, euAvev-uaeihl awb_lefe, aUtsuereds ring.
21 
© 2013 SAMSUNG Electronics Co. 
Virtio Performance 
• When transport/backend are not ‘fused’ performance features not exported 
 Due to way QEMU instantiates objects – properties set at TYPE_DEVICE class 
 After device plugged – properties not set 
 If transport/backend not fused – properties/performance features not used 
 Created patch for virtio-mmio – applies when backend plugged 
o https://github.com/mjsmar/virtio_net_fix.git
22 
© 2013 SAMSUNG Electronics Co. 
Virtio Performance 
• Performance features 
 Red Hat multi-queue tap 
o tap arg – ‘queues=n’ for scalability 
o Creates multiple queue virtio/tap tx/rx queue pairs 
o vCPU scaling for tx/rx, serializes flows - TCP sessions, UDP connections 
 tx=timer,x-txtimer=nuS 
o Host kicks the backend periodically – limit exits 
o you can adjust how often backend polls tx virtqueue – tune latency vs. CPU 
 Offload – bigger pkts few exits, offload to host 
o Ring descriptors have – 1 for virtio_net_hdr other for data 
o probe tun/tap for vnet hdr support – for offloads - IFF_VNET_HDR 
o Probe tun/tap for GSO – TCP,UDP, - TSO, UFO 
o Options eventually make it to virtio-net net_device ‘features’ 
 virtio_net_hdr – flags for CSUM  define range 
 check skb fragments for for GSO – set vnet_hdr_net gso_type, size
Reconnaissance of Virtio: What’s new 
and how it’s all connected? 
© 2013 SAMSUNG Electronics Co. 
Q  A
Thank you. 
© 2013 SAMSUNG Electronics Co. 
Mario Smarduch 
Senior Virtualization Architect 
Open Source Group 
Samsung Research America (Silicon Valley) 
m.smarduch@samsung.com

Weitere ähnliche Inhalte

Was ist angesagt?

Linux KVMではじめるカンタン仮想化入門
Linux KVMではじめるカンタン仮想化入門Linux KVMではじめるカンタン仮想化入門
Linux KVMではじめるカンタン仮想化入門VirtualTech Japan Inc.
 
ARM LinuxのMMUはわかりにくい
ARM LinuxのMMUはわかりにくいARM LinuxのMMUはわかりにくい
ARM LinuxのMMUはわかりにくいwata2ki
 
Page cache in Linux kernel
Page cache in Linux kernelPage cache in Linux kernel
Page cache in Linux kernelAdrian Huang
 
AvailabilityZoneとHostAggregate
AvailabilityZoneとHostAggregateAvailabilityZoneとHostAggregate
AvailabilityZoneとHostAggregateHiroki Ishikawa
 
eBPF Perf Tools 2019
eBPF Perf Tools 2019eBPF Perf Tools 2019
eBPF Perf Tools 2019Brendan Gregg
 
Faster Container Image Distribution on a Variety of Tools with Lazy Pulling
Faster Container Image Distribution on a Variety of Tools with Lazy PullingFaster Container Image Distribution on a Variety of Tools with Lazy Pulling
Faster Container Image Distribution on a Variety of Tools with Lazy PullingKohei Tokunaga
 
containerdの概要と最近の機能
containerdの概要と最近の機能containerdの概要と最近の機能
containerdの概要と最近の機能Kohei Tokunaga
 
Kernel Recipes 2017: Using Linux perf at Netflix
Kernel Recipes 2017: Using Linux perf at NetflixKernel Recipes 2017: Using Linux perf at Netflix
Kernel Recipes 2017: Using Linux perf at NetflixBrendan Gregg
 
BHyVeってなんや
BHyVeってなんやBHyVeってなんや
BHyVeってなんやTakuya ASADA
 
エンジニアなら知っておきたい「仮想マシン」のしくみ v1.1 (hbstudy 17)
エンジニアなら知っておきたい「仮想マシン」のしくみ v1.1 (hbstudy 17)エンジニアなら知っておきたい「仮想マシン」のしくみ v1.1 (hbstudy 17)
エンジニアなら知っておきたい「仮想マシン」のしくみ v1.1 (hbstudy 17)Takeshi HASEGAWA
 
Lxc で始めるケチケチ仮想化生活?!
Lxc で始めるケチケチ仮想化生活?!Lxc で始めるケチケチ仮想化生活?!
Lxc で始めるケチケチ仮想化生活?!Etsuji Nakai
 
Linux Performance Analysis: New Tools and Old Secrets
Linux Performance Analysis: New Tools and Old SecretsLinux Performance Analysis: New Tools and Old Secrets
Linux Performance Analysis: New Tools and Old SecretsBrendan Gregg
 
Vmlinux: anatomy of bzimage and how x86 64 processor is booted
Vmlinux: anatomy of bzimage and how x86 64 processor is bootedVmlinux: anatomy of bzimage and how x86 64 processor is booted
Vmlinux: anatomy of bzimage and how x86 64 processor is bootedAdrian Huang
 
linux device driver
linux device driverlinux device driver
linux device driverRahul Batra
 
VirtualBox と Rocky Linux 8 で始める Pacemaker ~ VirtualBox でも STONITH 機能が試せる! Vi...
VirtualBox と Rocky Linux 8 で始める Pacemaker  ~ VirtualBox でも STONITH 機能が試せる! Vi...VirtualBox と Rocky Linux 8 で始める Pacemaker  ~ VirtualBox でも STONITH 機能が試せる! Vi...
VirtualBox と Rocky Linux 8 で始める Pacemaker ~ VirtualBox でも STONITH 機能が試せる! Vi...ksk_ha
 
Achieving the ultimate performance with KVM
Achieving the ultimate performance with KVM Achieving the ultimate performance with KVM
Achieving the ultimate performance with KVM ShapeBlue
 
LinuxCon 2015 Linux Kernel Networking Walkthrough
LinuxCon 2015 Linux Kernel Networking WalkthroughLinuxCon 2015 Linux Kernel Networking Walkthrough
LinuxCon 2015 Linux Kernel Networking WalkthroughThomas Graf
 
[CNCF TAG-Runtime 2022-10-06] Lima
[CNCF TAG-Runtime 2022-10-06] Lima[CNCF TAG-Runtime 2022-10-06] Lima
[CNCF TAG-Runtime 2022-10-06] LimaAkihiro Suda
 

Was ist angesagt? (20)

Linux Network Stack
Linux Network StackLinux Network Stack
Linux Network Stack
 
Linux KVMではじめるカンタン仮想化入門
Linux KVMではじめるカンタン仮想化入門Linux KVMではじめるカンタン仮想化入門
Linux KVMではじめるカンタン仮想化入門
 
initramfsについて
initramfsについてinitramfsについて
initramfsについて
 
ARM LinuxのMMUはわかりにくい
ARM LinuxのMMUはわかりにくいARM LinuxのMMUはわかりにくい
ARM LinuxのMMUはわかりにくい
 
Page cache in Linux kernel
Page cache in Linux kernelPage cache in Linux kernel
Page cache in Linux kernel
 
AvailabilityZoneとHostAggregate
AvailabilityZoneとHostAggregateAvailabilityZoneとHostAggregate
AvailabilityZoneとHostAggregate
 
eBPF Perf Tools 2019
eBPF Perf Tools 2019eBPF Perf Tools 2019
eBPF Perf Tools 2019
 
Faster Container Image Distribution on a Variety of Tools with Lazy Pulling
Faster Container Image Distribution on a Variety of Tools with Lazy PullingFaster Container Image Distribution on a Variety of Tools with Lazy Pulling
Faster Container Image Distribution on a Variety of Tools with Lazy Pulling
 
containerdの概要と最近の機能
containerdの概要と最近の機能containerdの概要と最近の機能
containerdの概要と最近の機能
 
Kernel Recipes 2017: Using Linux perf at Netflix
Kernel Recipes 2017: Using Linux perf at NetflixKernel Recipes 2017: Using Linux perf at Netflix
Kernel Recipes 2017: Using Linux perf at Netflix
 
BHyVeってなんや
BHyVeってなんやBHyVeってなんや
BHyVeってなんや
 
エンジニアなら知っておきたい「仮想マシン」のしくみ v1.1 (hbstudy 17)
エンジニアなら知っておきたい「仮想マシン」のしくみ v1.1 (hbstudy 17)エンジニアなら知っておきたい「仮想マシン」のしくみ v1.1 (hbstudy 17)
エンジニアなら知っておきたい「仮想マシン」のしくみ v1.1 (hbstudy 17)
 
Lxc で始めるケチケチ仮想化生活?!
Lxc で始めるケチケチ仮想化生活?!Lxc で始めるケチケチ仮想化生活?!
Lxc で始めるケチケチ仮想化生活?!
 
Linux Performance Analysis: New Tools and Old Secrets
Linux Performance Analysis: New Tools and Old SecretsLinux Performance Analysis: New Tools and Old Secrets
Linux Performance Analysis: New Tools and Old Secrets
 
Vmlinux: anatomy of bzimage and how x86 64 processor is booted
Vmlinux: anatomy of bzimage and how x86 64 processor is bootedVmlinux: anatomy of bzimage and how x86 64 processor is booted
Vmlinux: anatomy of bzimage and how x86 64 processor is booted
 
linux device driver
linux device driverlinux device driver
linux device driver
 
VirtualBox と Rocky Linux 8 で始める Pacemaker ~ VirtualBox でも STONITH 機能が試せる! Vi...
VirtualBox と Rocky Linux 8 で始める Pacemaker  ~ VirtualBox でも STONITH 機能が試せる! Vi...VirtualBox と Rocky Linux 8 で始める Pacemaker  ~ VirtualBox でも STONITH 機能が試せる! Vi...
VirtualBox と Rocky Linux 8 で始める Pacemaker ~ VirtualBox でも STONITH 機能が試せる! Vi...
 
Achieving the ultimate performance with KVM
Achieving the ultimate performance with KVM Achieving the ultimate performance with KVM
Achieving the ultimate performance with KVM
 
LinuxCon 2015 Linux Kernel Networking Walkthrough
LinuxCon 2015 Linux Kernel Networking WalkthroughLinuxCon 2015 Linux Kernel Networking Walkthrough
LinuxCon 2015 Linux Kernel Networking Walkthrough
 
[CNCF TAG-Runtime 2022-10-06] Lima
[CNCF TAG-Runtime 2022-10-06] Lima[CNCF TAG-Runtime 2022-10-06] Lima
[CNCF TAG-Runtime 2022-10-06] Lima
 

Ähnlich wie Reconnaissance of Virtio: What’s new and how it’s all connected?

DPDK Summit 2015 - RIFT.io - Tim Mortsolf
DPDK Summit 2015 - RIFT.io - Tim MortsolfDPDK Summit 2015 - RIFT.io - Tim Mortsolf
DPDK Summit 2015 - RIFT.io - Tim MortsolfJim St. Leger
 
State of the Union: Open Source Network Function Virtualization
State of the Union: Open Source Network Function VirtualizationState of the Union: Open Source Network Function Virtualization
State of the Union: Open Source Network Function VirtualizationSamsung Open Source Group
 
Android Things Linux Day 2017
Android Things Linux Day 2017 Android Things Linux Day 2017
Android Things Linux Day 2017 Stefano Sanna
 
44CON 2014 - Stupid PCIe Tricks, Joe Fitzpatrick
44CON 2014 - Stupid PCIe Tricks, Joe Fitzpatrick44CON 2014 - Stupid PCIe Tricks, Joe Fitzpatrick
44CON 2014 - Stupid PCIe Tricks, Joe Fitzpatrick44CON
 
Reverse engineering Swisscom's Centro Grande Modem
Reverse engineering Swisscom's Centro Grande ModemReverse engineering Swisscom's Centro Grande Modem
Reverse engineering Swisscom's Centro Grande ModemCyber Security Alliance
 
Vpu technology &gpgpu computing
Vpu technology &gpgpu computingVpu technology &gpgpu computing
Vpu technology &gpgpu computingArka Ghosh
 
Ganglia Monitoring Tool
Ganglia Monitoring ToolGanglia Monitoring Tool
Ganglia Monitoring Toolsudhirpg
 
Achieving the Ultimate Performance with KVM
Achieving the Ultimate Performance with KVMAchieving the Ultimate Performance with KVM
Achieving the Ultimate Performance with KVMdata://disrupted®
 
Achieving the Ultimate Performance with KVM
Achieving the Ultimate Performance with KVMAchieving the Ultimate Performance with KVM
Achieving the Ultimate Performance with KVMDevOps.com
 
Vpu technology &gpgpu computing
Vpu technology &gpgpu computingVpu technology &gpgpu computing
Vpu technology &gpgpu computingArka Ghosh
 
Vpu technology &gpgpu computing
Vpu technology &gpgpu computingVpu technology &gpgpu computing
Vpu technology &gpgpu computingArka Ghosh
 
Vpu technology &gpgpu computing
Vpu technology &gpgpu computingVpu technology &gpgpu computing
Vpu technology &gpgpu computingArka Ghosh
 
Skydive, real-time network analyzer, container integration
Skydive, real-time network analyzer, container integrationSkydive, real-time network analyzer, container integration
Skydive, real-time network analyzer, container integrationSylvain Afchain
 
Debugging Ruby
Debugging RubyDebugging Ruby
Debugging RubyAman Gupta
 
Labs_BT_20221017.pptx
Labs_BT_20221017.pptxLabs_BT_20221017.pptx
Labs_BT_20221017.pptxssuserb4d806
 
Containers with systemd-nspawn
Containers with systemd-nspawnContainers with systemd-nspawn
Containers with systemd-nspawnGábor Nyers
 
SiteGround Tech TeamBuilding
SiteGround Tech TeamBuildingSiteGround Tech TeamBuilding
SiteGround Tech TeamBuildingMarian Marinov
 
20171206 PGconf.ASIA LT gstore_fdw
20171206 PGconf.ASIA LT gstore_fdw20171206 PGconf.ASIA LT gstore_fdw
20171206 PGconf.ASIA LT gstore_fdwKohei KaiGai
 
SCADA Strangelove: Hacking in the Name
SCADA Strangelove: Hacking in the NameSCADA Strangelove: Hacking in the Name
SCADA Strangelove: Hacking in the NamePositive Hack Days
 

Ähnlich wie Reconnaissance of Virtio: What’s new and how it’s all connected? (20)

DPDK Summit 2015 - RIFT.io - Tim Mortsolf
DPDK Summit 2015 - RIFT.io - Tim MortsolfDPDK Summit 2015 - RIFT.io - Tim Mortsolf
DPDK Summit 2015 - RIFT.io - Tim Mortsolf
 
State of the Union: Open Source Network Function Virtualization
State of the Union: Open Source Network Function VirtualizationState of the Union: Open Source Network Function Virtualization
State of the Union: Open Source Network Function Virtualization
 
Android Things Linux Day 2017
Android Things Linux Day 2017 Android Things Linux Day 2017
Android Things Linux Day 2017
 
44CON 2014 - Stupid PCIe Tricks, Joe Fitzpatrick
44CON 2014 - Stupid PCIe Tricks, Joe Fitzpatrick44CON 2014 - Stupid PCIe Tricks, Joe Fitzpatrick
44CON 2014 - Stupid PCIe Tricks, Joe Fitzpatrick
 
Reverse engineering Swisscom's Centro Grande Modem
Reverse engineering Swisscom's Centro Grande ModemReverse engineering Swisscom's Centro Grande Modem
Reverse engineering Swisscom's Centro Grande Modem
 
Vpu technology &gpgpu computing
Vpu technology &gpgpu computingVpu technology &gpgpu computing
Vpu technology &gpgpu computing
 
Osol Pgsql
Osol PgsqlOsol Pgsql
Osol Pgsql
 
Ganglia Monitoring Tool
Ganglia Monitoring ToolGanglia Monitoring Tool
Ganglia Monitoring Tool
 
Achieving the Ultimate Performance with KVM
Achieving the Ultimate Performance with KVMAchieving the Ultimate Performance with KVM
Achieving the Ultimate Performance with KVM
 
Achieving the Ultimate Performance with KVM
Achieving the Ultimate Performance with KVMAchieving the Ultimate Performance with KVM
Achieving the Ultimate Performance with KVM
 
Vpu technology &gpgpu computing
Vpu technology &gpgpu computingVpu technology &gpgpu computing
Vpu technology &gpgpu computing
 
Vpu technology &gpgpu computing
Vpu technology &gpgpu computingVpu technology &gpgpu computing
Vpu technology &gpgpu computing
 
Vpu technology &gpgpu computing
Vpu technology &gpgpu computingVpu technology &gpgpu computing
Vpu technology &gpgpu computing
 
Skydive, real-time network analyzer, container integration
Skydive, real-time network analyzer, container integrationSkydive, real-time network analyzer, container integration
Skydive, real-time network analyzer, container integration
 
Debugging Ruby
Debugging RubyDebugging Ruby
Debugging Ruby
 
Labs_BT_20221017.pptx
Labs_BT_20221017.pptxLabs_BT_20221017.pptx
Labs_BT_20221017.pptx
 
Containers with systemd-nspawn
Containers with systemd-nspawnContainers with systemd-nspawn
Containers with systemd-nspawn
 
SiteGround Tech TeamBuilding
SiteGround Tech TeamBuildingSiteGround Tech TeamBuilding
SiteGround Tech TeamBuilding
 
20171206 PGconf.ASIA LT gstore_fdw
20171206 PGconf.ASIA LT gstore_fdw20171206 PGconf.ASIA LT gstore_fdw
20171206 PGconf.ASIA LT gstore_fdw
 
SCADA Strangelove: Hacking in the Name
SCADA Strangelove: Hacking in the NameSCADA Strangelove: Hacking in the Name
SCADA Strangelove: Hacking in the Name
 

Mehr von Samsung Open Source Group

The Complex IoT Equation (and FLOSS solutions)
The Complex IoT Equation (and FLOSS solutions)The Complex IoT Equation (and FLOSS solutions)
The Complex IoT Equation (and FLOSS solutions)Samsung Open Source Group
 
Rapid SPi Device Driver Development over USB
Rapid SPi Device Driver Development over USBRapid SPi Device Driver Development over USB
Rapid SPi Device Driver Development over USBSamsung Open Source Group
 
Tizen RT: A Lightweight RTOS Platform for Low-End IoT Devices
Tizen RT: A Lightweight RTOS Platform for Low-End IoT DevicesTizen RT: A Lightweight RTOS Platform for Low-End IoT Devices
Tizen RT: A Lightweight RTOS Platform for Low-End IoT DevicesSamsung Open Source Group
 
IoTivity: Smart Home to Automotive and Beyond
IoTivity: Smart Home to Automotive and BeyondIoTivity: Smart Home to Automotive and Beyond
IoTivity: Smart Home to Automotive and BeyondSamsung Open Source Group
 
IoTivity for Automotive: meta-ocf-automotive tutorial
IoTivity for Automotive: meta-ocf-automotive tutorialIoTivity for Automotive: meta-ocf-automotive tutorial
IoTivity for Automotive: meta-ocf-automotive tutorialSamsung Open Source Group
 
Open Source Metrics to Inform Corporate Strategy
Open Source Metrics to Inform Corporate StrategyOpen Source Metrics to Inform Corporate Strategy
Open Source Metrics to Inform Corporate StrategySamsung Open Source Group
 
IoTivity for Automotive IoT Interoperability
IoTivity for Automotive IoT InteroperabilityIoTivity for Automotive IoT Interoperability
IoTivity for Automotive IoT InteroperabilitySamsung Open Source Group
 
JerryScript: An ultra-lighteweight JavaScript Engine for the Internet of Thin...
JerryScript: An ultra-lighteweight JavaScript Engine for the Internet of Thin...JerryScript: An ultra-lighteweight JavaScript Engine for the Internet of Thin...
JerryScript: An ultra-lighteweight JavaScript Engine for the Internet of Thin...Samsung Open Source Group
 
Adding IEEE 802.15.4 and 6LoWPAN to an Embedded Linux Device
Adding IEEE 802.15.4 and 6LoWPAN to an Embedded Linux DeviceAdding IEEE 802.15.4 and 6LoWPAN to an Embedded Linux Device
Adding IEEE 802.15.4 and 6LoWPAN to an Embedded Linux DeviceSamsung Open Source Group
 
IoT: From Arduino Microcontrollers to Tizen Products using IoTivity
IoT: From Arduino Microcontrollers to Tizen Products using IoTivityIoT: From Arduino Microcontrollers to Tizen Products using IoTivity
IoT: From Arduino Microcontrollers to Tizen Products using IoTivitySamsung Open Source Group
 
Practical Guide to Run an IEEE 802.15.4 Network with 6LoWPAN Under Linux
Practical Guide to Run an IEEE 802.15.4 Network with 6LoWPAN Under LinuxPractical Guide to Run an IEEE 802.15.4 Network with 6LoWPAN Under Linux
Practical Guide to Run an IEEE 802.15.4 Network with 6LoWPAN Under LinuxSamsung Open Source Group
 
IoTivity Tutorial: Prototyping IoT Devices on GNU/Linux
IoTivity Tutorial: Prototyping IoT Devices on GNU/LinuxIoTivity Tutorial: Prototyping IoT Devices on GNU/Linux
IoTivity Tutorial: Prototyping IoT Devices on GNU/LinuxSamsung Open Source Group
 
JerryScript: An ultra-lighteweight JavaScript Engine for the Internet of Things
JerryScript: An ultra-lighteweight JavaScript Engine for the Internet of ThingsJerryScript: An ultra-lighteweight JavaScript Engine for the Internet of Things
JerryScript: An ultra-lighteweight JavaScript Engine for the Internet of ThingsSamsung Open Source Group
 

Mehr von Samsung Open Source Group (20)

The Complex IoT Equation (and FLOSS solutions)
The Complex IoT Equation (and FLOSS solutions)The Complex IoT Equation (and FLOSS solutions)
The Complex IoT Equation (and FLOSS solutions)
 
Easy IoT with JavaScript
Easy IoT with JavaScriptEasy IoT with JavaScript
Easy IoT with JavaScript
 
Spawny: A New Approach to Logins
Spawny: A New Approach to LoginsSpawny: A New Approach to Logins
Spawny: A New Approach to Logins
 
Rapid SPi Device Driver Development over USB
Rapid SPi Device Driver Development over USBRapid SPi Device Driver Development over USB
Rapid SPi Device Driver Development over USB
 
Tizen RT: A Lightweight RTOS Platform for Low-End IoT Devices
Tizen RT: A Lightweight RTOS Platform for Low-End IoT DevicesTizen RT: A Lightweight RTOS Platform for Low-End IoT Devices
Tizen RT: A Lightweight RTOS Platform for Low-End IoT Devices
 
IoTivity: Smart Home to Automotive and Beyond
IoTivity: Smart Home to Automotive and BeyondIoTivity: Smart Home to Automotive and Beyond
IoTivity: Smart Home to Automotive and Beyond
 
IoTivity for Automotive: meta-ocf-automotive tutorial
IoTivity for Automotive: meta-ocf-automotive tutorialIoTivity for Automotive: meta-ocf-automotive tutorial
IoTivity for Automotive: meta-ocf-automotive tutorial
 
GENIVI + OCF Cooperation
GENIVI + OCF CooperationGENIVI + OCF Cooperation
GENIVI + OCF Cooperation
 
Framework for IoT Interoperability
Framework for IoT InteroperabilityFramework for IoT Interoperability
Framework for IoT Interoperability
 
Open Source Metrics to Inform Corporate Strategy
Open Source Metrics to Inform Corporate StrategyOpen Source Metrics to Inform Corporate Strategy
Open Source Metrics to Inform Corporate Strategy
 
IoTivity for Automotive IoT Interoperability
IoTivity for Automotive IoT InteroperabilityIoTivity for Automotive IoT Interoperability
IoTivity for Automotive IoT Interoperability
 
JerryScript: An ultra-lighteweight JavaScript Engine for the Internet of Thin...
JerryScript: An ultra-lighteweight JavaScript Engine for the Internet of Thin...JerryScript: An ultra-lighteweight JavaScript Engine for the Internet of Thin...
JerryScript: An ultra-lighteweight JavaScript Engine for the Internet of Thin...
 
Adding IEEE 802.15.4 and 6LoWPAN to an Embedded Linux Device
Adding IEEE 802.15.4 and 6LoWPAN to an Embedded Linux DeviceAdding IEEE 802.15.4 and 6LoWPAN to an Embedded Linux Device
Adding IEEE 802.15.4 and 6LoWPAN to an Embedded Linux Device
 
IoTivity: From Devices to the Cloud
IoTivity: From Devices to the CloudIoTivity: From Devices to the Cloud
IoTivity: From Devices to the Cloud
 
SOSCON 2016 JerryScript
SOSCON 2016 JerryScriptSOSCON 2016 JerryScript
SOSCON 2016 JerryScript
 
IoT: From Arduino Microcontrollers to Tizen Products using IoTivity
IoT: From Arduino Microcontrollers to Tizen Products using IoTivityIoT: From Arduino Microcontrollers to Tizen Products using IoTivity
IoT: From Arduino Microcontrollers to Tizen Products using IoTivity
 
Run Your Own 6LoWPAN Based IoT Network
Run Your Own 6LoWPAN Based IoT NetworkRun Your Own 6LoWPAN Based IoT Network
Run Your Own 6LoWPAN Based IoT Network
 
Practical Guide to Run an IEEE 802.15.4 Network with 6LoWPAN Under Linux
Practical Guide to Run an IEEE 802.15.4 Network with 6LoWPAN Under LinuxPractical Guide to Run an IEEE 802.15.4 Network with 6LoWPAN Under Linux
Practical Guide to Run an IEEE 802.15.4 Network with 6LoWPAN Under Linux
 
IoTivity Tutorial: Prototyping IoT Devices on GNU/Linux
IoTivity Tutorial: Prototyping IoT Devices on GNU/LinuxIoTivity Tutorial: Prototyping IoT Devices on GNU/Linux
IoTivity Tutorial: Prototyping IoT Devices on GNU/Linux
 
JerryScript: An ultra-lighteweight JavaScript Engine for the Internet of Things
JerryScript: An ultra-lighteweight JavaScript Engine for the Internet of ThingsJerryScript: An ultra-lighteweight JavaScript Engine for the Internet of Things
JerryScript: An ultra-lighteweight JavaScript Engine for the Internet of Things
 

Kürzlich hochgeladen

ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024The Digital Insurer
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusZilliz
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 

Kürzlich hochgeladen (20)

ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 

Reconnaissance of Virtio: What’s new and how it’s all connected?

  • 1. Reconnaissance of Virtio: What’s new and how it’s all connected? © 2013 SAMSUNG Electronics Co. Mario Smarduch Senior Virtualization Architect Open Source Group Samsung Research America (Silicon Valley) m.smarduch@samsung.comSmarduch Senior Virtualization Architect Open Source Group Samsung Research America (Silicon Valley) m.smarduch@samsung.com
  • 2. 2 © 2013 SAMSUNG Electronics Co. Agenda QEMU/Guest Machine Model IO Overview Concepts - transport/backend – recent re-factoring PCI transport and most recent virtio-mmio transport Virtio and Device Passthrough, virtio performance
  • 3. LTTPMeawaevbgomele elosry BACKEND FRONTEND WDT IDE/SCSI ………. BACKEND KVM mmio-TRANSPORT 3 © 2013 SAMSUNG Electronics Co. Machine Model Host QEMU Guest ISnPtRe rVruvirCptPtu, aUTliizmaetiro,n ISnPtRe rVruivrptCtu,P aTUliizmaetiro,n CONSOLENIC Drivers -FRONTEND TTAUPN/ LSITBDCIO ECmOuNlSaOtioLnE ENmICulation • Like host, unmodified guest expects real hardware • Machine model – combination of hw extensions, KVM, QEMU, GUest Interrupt Local and Distributor – hw virt extensions + kvm Special Purpose Register – i.e. enable/disable MMU, discover CPU features – hw virt ext + kvm Timer – hw virt extensions + kvm Memory – hw virt + kvm Drivers/Devices – (i) mmio (ii) para-virtualized (iii) dev passthrough Machine Model - defines hw – CPU, Peripherals, HW address map • Some Terms Transport – way Guest to (i) probe, discover backend – resources; (ii) configure backend Frontend – guest driver Backend – whole QEMU I/O emulation + host device
  • 4. LTTPMeawaevbgomele elosry BACKEND FRONTEND WDT IDE/SCSI ………. BACKEND 4 © 2013 SAMSUNG Electronics Co. MMIO Example QEMU Guest ISnPtRe rVruvirCptPtu, aUTliizmaetiro,n ISnPtRe rVruivrptCtu,P aTUliizmaetiro,n CONSOLENIC Drivers -FRONTEND TTAUPN/ LSITBDCIO ECmOuNlSaOtioLnE ENmICulation Host KVM mmio-TRANSPORT • Typing a charter – ‘-nographic’ Keyboard stroke – QEMU backend (IO thread) reads from stdio Finds Qemu Frontend – console emulation device passes character Console device injects interrupt via KVM, guest exit/resume Console interrupt handler – mmio read of device buffer o guest exits, decodes regs to packages addr/data size o Returns from vCPU KVM_RUN loop to QEMU o QEMU finds console device handler from addr (GPA) o Console handler returns data at address o Return to KVM, data placed in dest register o Resume guest • MMIO a lot of overhead!
  • 5. 5 © 2013 SAMSUNG Electronics Co. Vision and Practice • QEMU/Guest - Vision Portability any backend plugs into any transport – no clue about transport o Typically one transport configured o ‘- virtio_xxx_device’ option – no hint of transport – plug into first available one Guest virtio driver unaware of transport o All transports can probe, discover backend o Indirect transport interface – i.e. virtio-net does not know what transport Example QEMU Guest PCI transport virtio-vmirtmio-ionett-ransport vdiertviioc-enet- device EnumeErantuemerate virtiov-pirctiio-mmPrioobe vdirritvioer-net
  • 6. 6 © 2013 SAMSUNG Electronics Co. Vision and Practice • In Practice – PCI preferred transport Transport/backends ‘fused’ Backend plugged into PCI Prior knowledge of machine model required o Command line – specify transport o No Portability QEMU PCvdI ierttvriioac-nensept-ort virtio-net-pci Guest virtiov-pirctiio-mmPrioobe vdirritvioer-net
  • 7. 7 © 2013 SAMSUNG Electronics Co. Virtio – moving data • virtio – ring buffers accessed from several contexts • Must deal with different addresses when moving data to/from virtio device QEMU TTAUBPNA/CKENLSITBDDCIOBACKENCODNFRONNTIECND GMueemsto ry • Between Guest QEMU – QEMU view • Host mmap() address – QEMU VA – HVA • To get HVA from GPA Find memory region section Offset = GPA – MemoryRegion base Add HVA base in RAMBlock add offset • To get GPA from HVA From RAMBlock find MemoryRegion Offset = HVA address – HVA base Add to MemoryRegion base address
  • 8. 8 © 2013 SAMSUNG Electronics Co. Virtio – moving data GMueemsto ry • Between Guest QEMU or host – Guest view Guest knows nothing abut HVA Current hw supports two level page tables 2nd level page table maps GPA HPA
  • 9. VVVrrriiinnngggDDDeeesssccc===TTTxxxGGGPPPAAA++ VVVrrriiinnngggDDDeeesssccc===GGGPPPAAA++…… TTTxxxGGGPPPAAA++DDeesscc+ Avail Rx....GPA GUEST • Performance achieved through direct memory access (see Rusty Russels spec) 9 © 2013 SAMSUNG Electronics Co. Virtio – moving data IO Thread Virtqueue Virtqueue fTNdoe/tsfwerlooemrckt QEMU GUEST TxQueue VraindgdrDesRcx Queue VVrrffv…iillrnnaa.i.ggngggss__,,au_ vuiisnnaesddideGleedPxx_,Ae rl;e inlmegn[[,]] …ring VraindgdrDesc VVrrffv…iillrnnaa.i.ggngggss__,,au_ vuiisnnaesddideGleedPxx_,Ae rl;e inlmegn[[,]] …ring 1 - virtio_net_hdr (skb-cb[]) 2 – skb-data[] Scatterlist 1 – page_link = page – of virtio_net_hdr offset = offset within page length = sizeof virtio_net_hdr 2 – page_link = page – of skb-data offset = … length = skb-len Simple pkt – no fragments Vring descriptor 1 – GPA addr of virtio_net_Hdr length 2 – GPA addr of skb-data length NOTIFY
  • 10. VVVrrriiinnngggDDDeeesssccc===TTTxxxGGGPPPAAA++ VVVrrriiinnngggDDDeeesssccc===GGGPPPAAA++…… TTTxxxGGGPPPAAA++DDeesscc+ Avail Rx....GPA QEMU 10 © 2013 SAMSUNG Electronics Co. IO Thread Virtqueue Virtqueue fTNdoe/tsfwerlooemrckt QEMU GUEST TxQueue VraindgdrDesRcx Queue VVrrffv…iillrnnaa.i.ggngggss__,,au_ vuiisnnaesddideGleedPxx_,Ae rl;e inlmegn[[,]] …ring VraindgdrDesc VVrrffv…iillrnnaa.i.ggngggss__,,au_ vuiisnnaesddideGleedPxx_,Ae rl;e inlmegn[[,]] …ring VirtQueueElement 1. out_addr = GPA virtio_net_hdr out_sg.iov_len = virtio_net_hdr length 2. out_addr = GPA skb-data out_sg.iov_len = skb-len VirtQueueElement 1. out_sg.iov_base = HVA virtio_net_hdr out_sg.iov_len = virtio_net_hdr length 2. out_sg.iov_base= HVA skb-data out_sg.iov_len = skb-len qemu_sendv_packet_async (…, out_sg, out_len, … virtio_net_tx_coplete) Virtio – moving data
  • 11. 11 © 2013 SAMSUNG Electronics Co. Virtio – moving data Guest – convert GVA - HPA Host GPA - HVA, HVA - GPA Tx-GPA 1v0r[__0i__2_vrisn-_n6u_]_4.g_un41 u*_1 e6 tgr__uu__1aa6x vdv6ft c1uut6s3e ra rl=daiifning1rlla;ggs, g_;_[[ _v2fdrl iaindgg;s s1d1_u;0_] e._;_ 3_u__su_u2ns_21c4eu 6]xl1 e n eu3d12_6 el t6n=e;2i dx, tx…; eliednmx;;ring[] Tx-GPA+0x4000 TX-Vring Tx-GPA+0x5000 VRing vring; { unsinged int num=… hwaddr desc = Desc Tx-GPA hwaddr avail = Desc Tx-GPA + ofst hwaddr used = Tx-GPA + ofst } /* VRing */ Guest Vring Operations xmssggi---…t___ss…sssseegggktt---b__(bb…lopuuefa)ffgf((gsnsseecctt_aah ltt=ittn…ee kprrlla=iissgtt ep** assogggfe,,f s……et,, svkirbti-o_dnaetta_h)dr) vvvv…qqqq-.----mvvnvmrrroiiiinnntoigggfyw...ddd(vreeeiqtssse)ccc [[[–iii]]]...aafVlddaIRgddTsrr IO=== _ sG…xgxPx-A_Q leoUnfE gpUtahEg_NeOTIFY Host Vring Operations virvtiioihrt_w=qn uaevG-deti_rudhtVferqlwu_uAdaspehedo us_d-ptecrx(__q(ppg…- aaeG. )tt==_xVh _vevvAqaqqd-- , (Bvvvqearri,l nisenvgmeqg.a- .)dv+aelai slsc(t+p;_ aaovfa f–isle_itnGodfP(eVxAR+i)+ng)Avail, ring[i]) Chflawogpraensa-dt vud==rerre ntvddurr eelirtndsns cguc t_l__wdopdpu_a eapwGs+=hc_ _Vy psfvsihlAqza(ypeg-soas(()fvpd(rVaeinR)sgcin_.dgpeDas,e cis)c) * i+ offsetof(VringDesc, flags) eeCll…eeomm..n--vooeuurttt__ saGgd[d…Pr[]Ae.iole v–m_l-eno=vu rtv_irnninugmg__]d d=ees vcs_rcilen-ng(_ddaeesdscc_d_parad, tdi)or(d GesVc_Apa, i) Convert GPA – vring_desc-addr to GVA --…e.TNl.exomoti-fuyt ogBuuatec_ksstge n[–…dT].xioivn_tbearrsuep=t ccopmu_pplehtyiosnical_memory_map(elem-out_addr[…], …)
  • 12. Virtio and Device Pass-through 12 © 2013 SAMSUNG Electronics Co. Basic Operation - Backend/Guest direct access to shared Vring buffers - PIO - Switching at software level - Management Flexibility – internal SDN support ovs-vsctladd-port br0 ofctl–control flowsphys-intfc -vSwitch - IRQ bottleneck – inject Kernel –injectQ dEiMrecUt l–ycall into kvm - Direct access to hw memory regions - DMA Support - Switching at hw level – SR-IOV depends on #of Queues - Management Flexibility – external SDN capable - IRQ bottleneck – hw enhancements, posted interrupts, exitless EOI improve things – closer to native Migration - Virtio lockless - Saves device state, tracks dirty pages - QEMU sets ‘unmigratable’, or installs migration blocker - Guest can be holding a lock – deadlock, hw state, …. Scalability - Practical limitations – primarily per formance - Number of Devices limited, limits #VMs - SR-IOV - #of VF - # of queues Network Performance - Soft switching – bridge, vSwitch - Several IO HOPS - Can approach near native – 10Ge for few bridged Guest - Switching done at HW level – hw queues - Performance scales with # of Guests - DMA support - IRQ Passthrough still a problem Host Performance - PIO – takes cpu cycles - Exits – few but still - Guest pages swapable - Guest pinned – can’t swap - Fewer exits - Less PIO Cloud Environment - Cloud friendly – migration, SDN, paging - Not Cloud friendly, great for NFV/RT DPDK, run to completion
  • 13. 13 © 2013 SAMSUNG Electronics Co. Virtio PCI Architecture • virtio-net example with QEMU backend – virtio-pci Guest ISnPtRe rVruvirCptPtu, aUTliizmaetiro,n ISnPtRe rVruivrptCtu,P aTUliizmaetiro,n QEMU BACBKAECNKDEND FRONTEND TUN/TAP tvriar12Mtn..i osMPVp-CpioIrOcIrt iti oEAndOudmptvrreieaarrtnsraiasost pt-iRiomooanrnmtnsgioe RAM Addresvdsir riRtvieoarn-ngeet cvoirntifoig_p_ocip_s --VirvreetvdvIOisniiroPobtPrnCui_C,oiI sdPcI-,l randoBseesxuvyt_sid RViinrtgio Buffers • Virtio device – combination of mmio paravirt device PCI Config • Before Guest Runs …. QEMU does creates proxy that plugs into PCI Bus During instantiation of VirtIOPCIProxy its o PCIDevice vendor id, device id, class, … are set Instantiates virtio-net – bus_type = TYPE_VIRTIO_BUS o Plugs into VirtIOPCIProxy bus – TYPE_VIRTIO_BUS o Fills in PCI BAR0 type PIO o Associates virtio_pci_config_ops with B/D/F BAR0 • Guest Enumarates PCI Bus – discovers virtio-net – via mmio Loads virtio-pci, creates virtio-net device virtio-net driver loads probes virtio-net backend – via mmio
  • 14. QEMU Object Model • QEMU Class, Object view of ‘–device virtio-net-pci’ First instantiate Class – C++ Class definition Next the Object – C++ Declare Class variable Realize it– C++ constructor default or defined 14 VirtioBusState © 2013 SAMSUNG Electronics Co. TYPE_DEVICE TYPE_PCI_DEVICE TYPE_VIRTIO_PCI .init/realizefn TYPE_VIRTIO_NET_PCI .instance_init TYPE_BUS TYPE_VIRTIO_BUS VirtIONet TYPE_DEVICE TYPE_VIRTIO_DEVICE - bus_type = TYPE_VIRTIO_BUS TYPE_VIRTIO_NET PCI Bus Object View VirtIONetPCI - VirtIOPCIProxy dev - PCIDevice pdev config[] – vednor, device id, - VirtioBusState bus - VirtIONet vdev TYPE_VIRTIO_NET_PCI TYPE_VIRTIO_BUS TYPE_VIRTIO_NET Class View
  • 15. 15 © 2013 SAMSUNG Electronics Co. virtio-mmio transport • virtio-net example with QEMU backend – virtio-mmio • Discovery/Probing … like PCI • Primarily ARM – with Guest QEMU/Guest PCI support – virtio-mmio less use • Some Use cases Want your own Machine Model – don’t want PCI, have Device Tree support Lots of Embedded Devices – simplified machine model o Automotive, Edge Network, Set top Box virtio-mmio another option
  • 16. • Virtio-mmio – example similar to PCI TYPE_DEVICE ‘pvliurgtigoe-db udsy’ ncaremvaiitcreatdilol yb-DeviceState macmkeinod/virtio-mmiodevconfig12M.. TYPE_TYPE_MVMiIrMOti IoOAdO BUS Edpnreeursmast VirtioBusState VIRTIO_BUS aiRoraantnsiogne 16 © 2013 SAMSUNG Electronics Co. Virtio MMIO Architecture Guest ISnPtRe rVruvirCptPtu, aUTliizmaetiro,n ISnPtRe rVruivrptCtu,P aTUliizmaetiro,n QEMU BACBKAECNKDEND FRONTEND TUN/TAP tvriartniosp-mormtio tvriartniosp-pocrit RAM Addresvdsir riRtvieoarn-ngeet _voirptiso_memVirmtIOaiMbnu_MssIyOsPteromxy_bus 1. Instantiate multiple virtio-mmio devices – no qemuRViinartgio rBugffesrsimplicitly done TYPE_SYS_BUS_DEVICE SysBusDevice TYPE_VIRTIO_MMIO VirtIOMMIOProxy …. VirtioBustState bus .init/.realizefn 2. Associate resources with each virtio-mmio range • MMIO address range a page, interrupt # - only machine models what resources
  • 17. Virtio MMIO Architecture VirtioBusState VirtIONet 17 Guest ISnPtRe rVruvirCptPtu, aUTliizmaetiro,n ISnPtRe rVruivrptCtu,P aTUliizmaetiro,n © 2013 SAMSUNG Electronics Co. QEMU BACBKAECNKDEND FRONTEND TUN/TAP tvriartniosp-mormtio tvriartniosp-pocrit RAM Addresvdsir riRtvieoarn-ngeet _voirptiso_memVirmtvIOairiMbntui_Moss-IyOnsPteertomxy_bus virtio-mmio/virtio-mmiodevconfig12M.. MVMiIrMOti IoOAdO Edpnreeursmast aiRoraantnsiogne RViinrtgio Buffers 3. ‘-virtio-net-device’ – instantiates/plugs TYPE_VIRTIO_NET • No transport specified any backend (virtio-net, virtio-blk,…) plug into transport • Virtio-net inherits VirtIODevice which sets ‘bus_type = TYPE_VIRTIO_BUS’ • Finds matching bus VirtIOMMIOproxy-bus, plugs TYPE_VIRTIO_NET • Finds and binds to QEMU backend – f.e. –netdev type=tap …. TYPE_DEVICE TYPE_VIRTIO_DEVICE - bus_type = TYPE_VIRTIO_BUS TYPE_VIRTIO_NET TYPE_DEVICE DeviceState TYPE_SYS_BUS_DEVICE SysBusDevice TYPE_VIRTIO_MMIO VirtIOMMIOProxy …. VirtioBustState bus VirtIONet vdev .init/.realizefn TYPE_BUS TYPE_VIRTIO_BUS
  • 18. Guest virtio discovery framework – virtio-mmio view • Transparent to Guest – enable virtio and mmio • Device Tree used 18 © 2013 SAMSUNG Electronics Co. QEMU - Machine Initialization - creates virtio-mmio transports plugs into system bus - specific machine model knows resources - modifes Guest FDT with mmio addr/size, Intr QEMU - Backend Initialization - ‘-virtio-xxx-device’ specified - device instanitated - searches for ‘virtio-bus’ class here virtio-mmio plugs in Guest - virtio-mmio driver probe - OF instantiates platform_device for ‘virtio-mmio’ - virtio-mmio – driver called probes transports - sanity checks virtio-mmio transport Guest - Discover Backend - check if transport plugged? - probe device – vendor, device id - register virtio device Guest - Virtio driver probe - probe device indirectly through virtio-mmio transport - create queues, program backend - present interface to kernel - more next slide ….
  • 19. Guest virtio discovery framework – virtio-mmio view Machine Initialization TYPE_DEVICE DeviceState TYPE_SYS_BUS_DEVICE SysBusDevice TYPE_VIRTIO_MMIO VirtIOMMIOProxy of_platform_populate(…, of_device_id match[], …) DT Node virtio-mmio { addr, size, irq; } 19 platform_device { …. } © 2013 SAMSUNG Electronics Co. sysbus_create_simple(“virtio-mmio’, base, pic[irq]) …. …. …. VirtioBustState bus .init/.realizefn VirtioBusState TYPE_BUS TYPE_VIRTIO_BUS add_virtio_mmio_node(fdt, …, mmio addr, irq pin) Backend Initialization ……. QEMU option … ‘-virtio-net-device’ device_init_func(opts, ….) VirtIONet TYPE_DEVICE TYPE_VIRTIO_DEVICE - bus_type = TYPE_VIRTIO_BUS TYPE_VIRTIO_NET virtio-mmio driver probe … virtio_mmio_driver = { .probe = virtio_mmio_probe, … } virtio_mmio_probe(*pdef) - virtio_mmio_vdev *vm_dev vm_dev-base = ioremap(virtio-mmio – GPA, size) virtio_device transport interface, PCI has one too vm_dev-vdev.config = virtio_mmio_config_ops sanity check – mmio to ‘virtio_mem_ops’ handlers magic = readl(vm_dev-base + VIRTIO_MMIO_MAGIC_VALUE) version = readl (…..)
  • 20. Guest virtio discovery framework – virtio-mmio view 20 © 2013 SAMSUNG Electronics Co. Discover Backend Identify if device plugged, if yes identify device register the device ) vm_register_dev-virtio_vdev.id.device(device= vendor= readl(structvirtio_readl(….) vm_dev-devicedev=base + vm_dev-VIRTIO_vdev MMIO_DEVICE_ID) Ack device found by transport, use transport interface -dev-config-set_status( … get_stattus() | VIRTIO_CONFIG_S_ACKNOWLEDGE) find matching driver on virtio bus -b-uvsi_rftoior__edaecvh_m_dartvc(…h(.d)ev, drv) Ack driver found for device Fe---a-Gdwtueieafrvtl ek s-b uNdapcrceopikvgnoeeofrdrittg e fif-aedeta aisstotueeuntrtr e_ ev–s sdtt aate–htbvuelb-esse( e… _f- efgaeacreatheutte_ urkscerteeksays ti uf=p sb e(d)ar cef| okvVer-ImnRdcTao InOsncu_fepiCg pOf-eoNargtFtsueI Gtr–_e_fbSse_eaD_tufRerIaeVtsEu(vRrde)sevb)it set --scabea))ll elb dcdartri cvi vkefeeerrna ftdpeu arrfoteeubsar ete–u s–rv endvsoie rntvt no-seut tcps_ouppnporfopritgboe-erdt( e)fb diny a bblyiaz cedk_rfeiveneadrt u ddroeosnn(’’vttd ggeeevtt- sseefelleeacctttueerddes[]) virtio driver probe instantiate network device interface d…e.v= alloc_etherdev_mq(…, # of queues) Various performance features – primarily offload, big packets -----CVhdITBneeeaiclvtclik- kab elsianczucoedpk n peq–fnoiugsdree-t uetGsedf Fsi GnN f–edP a_Aoatvf luql aorVsnec(rds…ain t)–GegdPfar Aonb mdyin gbdvuuedefxefseevts-r icnfoetuoan tDut refeosscr r –iepastceohtr sdq, euAvev-uaeihl awb_lefe, aUtsuereds ring.
  • 21. 21 © 2013 SAMSUNG Electronics Co. Virtio Performance • When transport/backend are not ‘fused’ performance features not exported Due to way QEMU instantiates objects – properties set at TYPE_DEVICE class After device plugged – properties not set If transport/backend not fused – properties/performance features not used Created patch for virtio-mmio – applies when backend plugged o https://github.com/mjsmar/virtio_net_fix.git
  • 22. 22 © 2013 SAMSUNG Electronics Co. Virtio Performance • Performance features Red Hat multi-queue tap o tap arg – ‘queues=n’ for scalability o Creates multiple queue virtio/tap tx/rx queue pairs o vCPU scaling for tx/rx, serializes flows - TCP sessions, UDP connections tx=timer,x-txtimer=nuS o Host kicks the backend periodically – limit exits o you can adjust how often backend polls tx virtqueue – tune latency vs. CPU Offload – bigger pkts few exits, offload to host o Ring descriptors have – 1 for virtio_net_hdr other for data o probe tun/tap for vnet hdr support – for offloads - IFF_VNET_HDR o Probe tun/tap for GSO – TCP,UDP, - TSO, UFO o Options eventually make it to virtio-net net_device ‘features’ virtio_net_hdr – flags for CSUM define range check skb fragments for for GSO – set vnet_hdr_net gso_type, size
  • 23. Reconnaissance of Virtio: What’s new and how it’s all connected? © 2013 SAMSUNG Electronics Co. Q A
  • 24. Thank you. © 2013 SAMSUNG Electronics Co. Mario Smarduch Senior Virtualization Architect Open Source Group Samsung Research America (Silicon Valley) m.smarduch@samsung.com