SlideShare a Scribd company logo
1 of 24
Download to read offline
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

More Related Content

What's hot

Static Partitioning with Xen, LinuxRT, and Zephyr: A Concrete End-to-end Exam...
Static Partitioning with Xen, LinuxRT, and Zephyr: A Concrete End-to-end Exam...Static Partitioning with Xen, LinuxRT, and Zephyr: A Concrete End-to-end Exam...
Static Partitioning with Xen, LinuxRT, and Zephyr: A Concrete End-to-end Exam...Stefano Stabellini
 
Tracing MariaDB server with bpftrace - MariaDB Server Fest 2021
Tracing MariaDB server with bpftrace - MariaDB Server Fest 2021Tracing MariaDB server with bpftrace - MariaDB Server Fest 2021
Tracing MariaDB server with bpftrace - MariaDB Server Fest 2021Valeriy Kravchuk
 
Prerequisite knowledge for shared memory concurrency
Prerequisite knowledge for shared memory concurrencyPrerequisite knowledge for shared memory concurrency
Prerequisite knowledge for shared memory concurrencyViller Hsiao
 
Virtualization Architecture & KVM
Virtualization Architecture & KVMVirtualization Architecture & KVM
Virtualization Architecture & KVMPradeep Kumar
 
Introduction to eBPF and XDP
Introduction to eBPF and XDPIntroduction to eBPF and XDP
Introduction to eBPF and XDPlcplcp1
 
Red Hat OpenStack 17 저자직강+스터디그룹_1주차
Red Hat OpenStack 17 저자직강+스터디그룹_1주차Red Hat OpenStack 17 저자직강+스터디그룹_1주차
Red Hat OpenStack 17 저자직강+스터디그룹_1주차Nalee Jang
 
Ceph: Open Source Storage Software Optimizations on Intel® Architecture for C...
Ceph: Open Source Storage Software Optimizations on Intel® Architecture for C...Ceph: Open Source Storage Software Optimizations on Intel® Architecture for C...
Ceph: Open Source Storage Software Optimizations on Intel® Architecture for C...Odinot Stanislas
 
Red Hat OpenStack 17 저자직강+스터디그룹_3주차
Red Hat OpenStack 17 저자직강+스터디그룹_3주차Red Hat OpenStack 17 저자직강+스터디그룹_3주차
Red Hat OpenStack 17 저자직강+스터디그룹_3주차Nalee Jang
 
[오픈소스컨설팅] Red Hat ReaR (relax and-recover) Quick Guide
[오픈소스컨설팅] Red Hat ReaR (relax and-recover) Quick Guide[오픈소스컨설팅] Red Hat ReaR (relax and-recover) Quick Guide
[오픈소스컨설팅] Red Hat ReaR (relax and-recover) Quick GuideJi-Woong Choi
 
Proxmox Clustering with CEPH
Proxmox Clustering with CEPHProxmox Clustering with CEPH
Proxmox Clustering with CEPHFahadIbrar5
 
Understanding the Android System Server
Understanding the Android System ServerUnderstanding the Android System Server
Understanding the Android System ServerOpersys inc.
 
eBPF - Rethinking the Linux Kernel
eBPF - Rethinking the Linux KerneleBPF - Rethinking the Linux Kernel
eBPF - Rethinking the Linux KernelThomas Graf
 
[오픈소스컨설팅] 쿠버네티스와 쿠버네티스 on 오픈스택 비교 및 구축 방법
[오픈소스컨설팅] 쿠버네티스와 쿠버네티스 on 오픈스택 비교  및 구축 방법[오픈소스컨설팅] 쿠버네티스와 쿠버네티스 on 오픈스택 비교  및 구축 방법
[오픈소스컨설팅] 쿠버네티스와 쿠버네티스 on 오픈스택 비교 및 구축 방법Open Source Consulting
 
BPF - in-kernel virtual machine
BPF - in-kernel virtual machineBPF - in-kernel virtual machine
BPF - in-kernel virtual machineAlexei Starovoitov
 
NEDIA_SNIA_CXL_講演資料.pdf
NEDIA_SNIA_CXL_講演資料.pdfNEDIA_SNIA_CXL_講演資料.pdf
NEDIA_SNIA_CXL_講演資料.pdfYasunori Goto
 
Virtualization - Kernel Virtual Machine (KVM)
Virtualization - Kernel Virtual Machine (KVM)Virtualization - Kernel Virtual Machine (KVM)
Virtualization - Kernel Virtual Machine (KVM)Wan Leung Wong
 

What's hot (20)

Static Partitioning with Xen, LinuxRT, and Zephyr: A Concrete End-to-end Exam...
Static Partitioning with Xen, LinuxRT, and Zephyr: A Concrete End-to-end Exam...Static Partitioning with Xen, LinuxRT, and Zephyr: A Concrete End-to-end Exam...
Static Partitioning with Xen, LinuxRT, and Zephyr: A Concrete End-to-end Exam...
 
Tracing MariaDB server with bpftrace - MariaDB Server Fest 2021
Tracing MariaDB server with bpftrace - MariaDB Server Fest 2021Tracing MariaDB server with bpftrace - MariaDB Server Fest 2021
Tracing MariaDB server with bpftrace - MariaDB Server Fest 2021
 
Prerequisite knowledge for shared memory concurrency
Prerequisite knowledge for shared memory concurrencyPrerequisite knowledge for shared memory concurrency
Prerequisite knowledge for shared memory concurrency
 
Virtualization Architecture & KVM
Virtualization Architecture & KVMVirtualization Architecture & KVM
Virtualization Architecture & KVM
 
SR-IOV Introduce
SR-IOV IntroduceSR-IOV Introduce
SR-IOV Introduce
 
Introduction to eBPF and XDP
Introduction to eBPF and XDPIntroduction to eBPF and XDP
Introduction to eBPF and XDP
 
Red Hat OpenStack 17 저자직강+스터디그룹_1주차
Red Hat OpenStack 17 저자직강+스터디그룹_1주차Red Hat OpenStack 17 저자직강+스터디그룹_1주차
Red Hat OpenStack 17 저자직강+스터디그룹_1주차
 
Ceph: Open Source Storage Software Optimizations on Intel® Architecture for C...
Ceph: Open Source Storage Software Optimizations on Intel® Architecture for C...Ceph: Open Source Storage Software Optimizations on Intel® Architecture for C...
Ceph: Open Source Storage Software Optimizations on Intel® Architecture for C...
 
Red Hat OpenStack 17 저자직강+스터디그룹_3주차
Red Hat OpenStack 17 저자직강+스터디그룹_3주차Red Hat OpenStack 17 저자직강+스터디그룹_3주차
Red Hat OpenStack 17 저자직강+스터디그룹_3주차
 
[오픈소스컨설팅] Red Hat ReaR (relax and-recover) Quick Guide
[오픈소스컨설팅] Red Hat ReaR (relax and-recover) Quick Guide[오픈소스컨설팅] Red Hat ReaR (relax and-recover) Quick Guide
[오픈소스컨설팅] Red Hat ReaR (relax and-recover) Quick Guide
 
Proxmox Clustering with CEPH
Proxmox Clustering with CEPHProxmox Clustering with CEPH
Proxmox Clustering with CEPH
 
Understanding the Android System Server
Understanding the Android System ServerUnderstanding the Android System Server
Understanding the Android System Server
 
Android 10
Android 10Android 10
Android 10
 
Ceph issue 해결 사례
Ceph issue 해결 사례Ceph issue 해결 사례
Ceph issue 해결 사례
 
OpenShift Introduction
OpenShift IntroductionOpenShift Introduction
OpenShift Introduction
 
eBPF - Rethinking the Linux Kernel
eBPF - Rethinking the Linux KerneleBPF - Rethinking the Linux Kernel
eBPF - Rethinking the Linux Kernel
 
[오픈소스컨설팅] 쿠버네티스와 쿠버네티스 on 오픈스택 비교 및 구축 방법
[오픈소스컨설팅] 쿠버네티스와 쿠버네티스 on 오픈스택 비교  및 구축 방법[오픈소스컨설팅] 쿠버네티스와 쿠버네티스 on 오픈스택 비교  및 구축 방법
[오픈소스컨설팅] 쿠버네티스와 쿠버네티스 on 오픈스택 비교 및 구축 방법
 
BPF - in-kernel virtual machine
BPF - in-kernel virtual machineBPF - in-kernel virtual machine
BPF - in-kernel virtual machine
 
NEDIA_SNIA_CXL_講演資料.pdf
NEDIA_SNIA_CXL_講演資料.pdfNEDIA_SNIA_CXL_講演資料.pdf
NEDIA_SNIA_CXL_講演資料.pdf
 
Virtualization - Kernel Virtual Machine (KVM)
Virtualization - Kernel Virtual Machine (KVM)Virtualization - Kernel Virtual Machine (KVM)
Virtualization - Kernel Virtual Machine (KVM)
 

Similar to 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
 

Similar to 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
 

More from 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
 

More from 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
 

Recently uploaded

Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
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
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
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
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 

Recently uploaded (20)

Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
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...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
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?
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 

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