SlideShare a Scribd company logo
1 of 16
Xen SR-IOV Feature 
(I/O Virtualization) 
Lingfei Kong 
lkong@redhat.com 
Sep. 2013
Agenda 
● Background 
● SR-IOV Overview 
● How it works with Xen 
● Reference link 
● Q & A
Background 
I/O is an important part of any computing platform, including virtual machines running 
on top of a virtual machine monitor. 
● I/O Virtualization Goals 
● Provide the same device 
● Provide scalability to support the number of virtual machines(VMs) 
They should also provide near native performance for I/O operations. 
● Isolation 
● Memory 
● I/O streams 
● Interrupts 
● Control operations 
● I/O operations and errors
● I/O Virtualization Approaches 
● Software-Based Sharing 
● Device emulation 
● The split-driver model 
● Drawbacks 
● Only provide a subset of the total 
functionality provided by physical 
hardware. 
● Significant CPU overhead and this 
can reduce the maximum throughput 
on an I/O device 
Figure 1. Software-Based Sharing 
.
● Direct Assignment 
Intel virtualization technology enables a device to directly DMA to/from host 
memory 
● Drawbacks 
● Limited scalability, a physical device can only be assigned to one VM 
Figure 2. Direct Assignment
SR-IOV Overview 
● SR-IOV is a specification that allows a PCIe device to appear to be multiple separate 
PCIe devices. The SR-IOV specification was created and is maintained by the PCI SIG, with 
the idea that a standard specification will help promote inter interoperability. 
● SR-IOV works by introducing the idea of physical functions(PFs) and virtual functions(VFs) 
● Physical Functions(PFs): These are full PCIe functions that include the SR-IOV Extended 
Capability. The capability is used to configure and manage the SR-IOV functionality. 
● Virtual Functions(VFs): These are 'lightweight' PCIe functions that contain the resources 
necessary for data movement but have a carefully minimized set of configuration resources. 
● The Direct Assignment method of virtualization provides very fast I/O. However, it 
prevents the sharing of I/O devices. SR-IOV provides a mechanism by which a Single Root 
Function(For example a single Ethernet Port) can appear to be multiple separate physical 
Devices.
● The SR-IOV capable device provides a configurable number of independent Virtual 
Functions, each with its own PCI Configuration space. The Hypervisor assigns one or 
more Virtual Functions to a virtual machine by mapping the actual configuration space the 
VFs to the configuration space presented to the virtual machine by the VMM. 
Figure 3. Mapping Virtual Function Configuration
Figure 4. Intel SR-IOV Overview
How it works with Xen ● Setup 
● Enabled VT-d(for Intel machine) or AMD-V(for AMD machine) in BIOS 
● SR-IOV supported hardware. (for example: Intel 82576 and Intel 82599 NIC) 
● Check PF 
[host]#lspci | grep Etherne 
86:00.0 Ethernet controller: Intel Corporation 82576 Gigabit Network Connection 
(rev 01) 
86:00.1 Ethernet controller: Intel Corporation 82576 Gigabit Network Connection 
(rev 01) 
● Enable VF in grub.conf 
Add "iommu=no-intremap" in kernel line 
Add "pci_pt_e820_access=on" in module line 
Reboot the host. 
After reboot, please check if these lines exist in `xm dmesg` output(mainly the first 
line): 
(XEN) [VT-D]iommu.c:1720: Interrupt Remapping hardware not found 
(XEN) [VT-D]iommu.c:1722: Device assignment will be disabled for security reasons 
(CVE-2011-1898). 
(XEN) [VT-D]iommu.c:1724: Use iommu=no-intremap to override.
If exist, change `iommu=1` to `iommu=no-intremap` and reboot again. 
Enable VF in driver 
[host]#echo 'options igb max_vfs=7' >> /etc/modprobe.conf 
Then, restart system. VFs will be enabled automatically when host start. 
Another way to enable VF(after reboot): 
[host]# modprobe -r igb 
[host]# modprobe igb max_vfs=7
● Check VF 
[root@unused ~]# lspci|grep Ethernet 
04:00.0 Ethernet controller: Broadcom Corporation NetXtreme II BCM5709 Gigabit 
Ethernet (rev 20) 
04:00.1 Ethernet controller: Broadcom Corporation NetXtreme II BCM5709 Gigabit 
Ethernet (rev 20) 
86:00.0 Ethernet controller: Intel Corporation 82576 Gigabit Network Connection (rev 01) 
86:00.1 Ethernet controller: Intel Corporation 82576 Gigabit Network Connection (rev 01) 
86:10.0 Ethernet controller: Intel Corporation 82576 Virtual Function (rev 01) 
86:10.1 Ethernet controller: Intel Corporation 82576 Virtual Function (rev 01) 
86:10.2 Ethernet controller: Intel Corporation 82576 Virtual Function (rev 01) 
86:10.3 Ethernet controller: Intel Corporation 82576 Virtual Function (rev 01) 
86:10.4 Ethernet controller: Intel Corporation 82576 Virtual Function (rev 01) 
86:10.5 Ethernet controller: Intel Corporation 82576 Virtual Function (rev 01) 
86:10.6 Ethernet controller: Intel Corporation 82576 Virtual Function (rev 01) 
86:10.7 Ethernet controller: Intel Corporation 82576 Virtual Function (rev 01) 
86:11.0 Ethernet controller: Intel Corporation 82576 Virtual Function (rev 01) 
86:11.1 Ethernet controller: Intel Corporation 82576 Virtual Function (rev 01) 
86:11.2 Ethernet controller: Intel Corporation 82576 Virtual Function (rev 01) 
86:11.3 Ethernet controller: Intel Corporation 82576 Virtual Function (rev 01) 
86:11.4 Ethernet controller: Intel Corporation 82576 Virtual Function (rev 01) 
86:11.5 Ethernet controller: Intel Corporation 82576 Virtual Function (rev 01)
● Load pciback driver 
[host]#modprobe pciback 
[host]#lsmod |grep pciback 
pciback 65617 0 
● Get device ID of Vfs 
[host]# lspci -D | grep "82576 Virtual Function" 
0000:86:10.0 Ethernet controller: Intel Corporation 82576 Virtual Function (rev 01) 
0000:86:10.1 Ethernet controller: Intel Corporation 82576 Virtual Function (rev 01) 
…. 
● Unbind device from host kernel driver 
[host]#echo 0000:86:10.0 > /sys/bus/pci/drivers/igbvf/unbind 
● Bind PCI device to pciback driver 
[host]#echo 0000:86:10.0 > /sys/bus/pci/drivers/pciback/new_slot 
[host]#echo 0000:86:10.0 > /sys/bus/pci/drivers/pciback/bind 
Make sure the vifs get ip addresss?
● Make sure the VFs has been hidden from Dom0 already 
[host]#xm pci-list-assignable-devices 
0000:86:10.0 
● Create the guest with VF devices' ID as parameter 
xm create pv-6.4-64.cfg pci='0000:86:10.0'
Reference link 
● Xen Technical Papers -> SR-IOV 
https://docspace.corp.redhat.com/docs/DOC-133989 
● PCI-SIG SR-IOV Primer 
https://docspace.corp.redhat.com/servlet/JiveServlet/downloadBody/155072-102-1- 
755489/PCI-SIGSR-IOVPrimer.pdf 
● SR-IOV support in Xen 
https://mirrorglass.englab.nay.redhat.com/XWiki/bin/download/Main/SR%2DIOV/ 
Xen%2DSR%2DIOV.pdf 
● Overview of SR-IOV Driver Implementation 
https://mirrorglass.englab.nay.redhat.com/XWiki/bin/download/Main/SR 
%2DIOV/Intel82576SRIOV.pdf
● Xen PCI Passthrough 
http://wiki.xensource.com/wiki/XenPCIpassthrough 
● Technical Paper (from KVM section) 
https://mirrorglass.englab.nay.redhat.com/XWiki/bin/download/Main/SR%2DIOV/SR 
%2DIOVTechPaper.pdf
Q&A

More Related Content

What's hot

Yocto Project Open Source Build System and Collaboration Initiative
Yocto Project Open Source Build System and Collaboration InitiativeYocto Project Open Source Build System and Collaboration Initiative
Yocto Project Open Source Build System and Collaboration InitiativeMarcelo Sanz
 
Library Operating System for Linux #netdev01
Library Operating System for Linux #netdev01Library Operating System for Linux #netdev01
Library Operating System for Linux #netdev01Hajime Tazaki
 
Linux Internals - Kernel/Core
Linux Internals - Kernel/CoreLinux Internals - Kernel/Core
Linux Internals - Kernel/CoreShay Cohen
 
Project ACRN expose and pass through platform hidden PCIe devices to SOS
Project ACRN expose and pass through platform hidden PCIe devices to SOSProject ACRN expose and pass through platform hidden PCIe devices to SOS
Project ACRN expose and pass through platform hidden PCIe devices to SOSProject ACRN
 
The Linux Block Layer - Built for Fast Storage
The Linux Block Layer - Built for Fast StorageThe Linux Block Layer - Built for Fast Storage
The Linux Block Layer - Built for Fast StorageKernel TLV
 
Boosting I/O Performance with KVM io_uring
Boosting I/O Performance with KVM io_uringBoosting I/O Performance with KVM io_uring
Boosting I/O Performance with KVM io_uringShapeBlue
 
malloc & vmalloc in Linux
malloc & vmalloc in Linuxmalloc & vmalloc in Linux
malloc & vmalloc in LinuxAdrian Huang
 
Understanding of linux kernel memory model
Understanding of linux kernel memory modelUnderstanding of linux kernel memory model
Understanding of linux kernel memory modelSeongJae Park
 
BPF Hardware Offload Deep Dive
BPF Hardware Offload Deep DiveBPF Hardware Offload Deep Dive
BPF Hardware Offload Deep DiveNetronome
 
Pushing Packets - How do the ML2 Mechanism Drivers Stack Up
Pushing Packets - How do the ML2 Mechanism Drivers Stack UpPushing Packets - How do the ML2 Mechanism Drivers Stack Up
Pushing Packets - How do the ML2 Mechanism Drivers Stack UpJames Denton
 
The TCP/IP Stack in the Linux Kernel
The TCP/IP Stack in the Linux KernelThe TCP/IP Stack in the Linux Kernel
The TCP/IP Stack in the Linux KernelDivye Kapoor
 
Project ACRN hypervisor introduction
Project ACRN hypervisor introduction Project ACRN hypervisor introduction
Project ACRN hypervisor introduction Project ACRN
 
ACRN vMeet-Up EU 2021 - shared memory based inter-vm communication introduction
ACRN vMeet-Up EU 2021 - shared memory based inter-vm communication introductionACRN vMeet-Up EU 2021 - shared memory based inter-vm communication introduction
ACRN vMeet-Up EU 2021 - shared memory based inter-vm communication introductionProject ACRN
 
Linux internal
Linux internalLinux internal
Linux internalmcganesh
 
20111015 勉強会 (PCIe / SR-IOV)
20111015 勉強会 (PCIe / SR-IOV)20111015 勉強会 (PCIe / SR-IOV)
20111015 勉強会 (PCIe / SR-IOV)Kentaro Ebisawa
 
Reconnaissance of Virtio: What’s new and how it’s all connected?
Reconnaissance of Virtio: What’s new and how it’s all connected?Reconnaissance of Virtio: What’s new and how it’s all connected?
Reconnaissance of Virtio: What’s new and how it’s all connected?Samsung Open Source Group
 
3. CPU virtualization and scheduling
3. CPU virtualization and scheduling3. CPU virtualization and scheduling
3. CPU virtualization and schedulingHwanju Kim
 

What's hot (20)

Yocto Project Open Source Build System and Collaboration Initiative
Yocto Project Open Source Build System and Collaboration InitiativeYocto Project Open Source Build System and Collaboration Initiative
Yocto Project Open Source Build System and Collaboration Initiative
 
Library Operating System for Linux #netdev01
Library Operating System for Linux #netdev01Library Operating System for Linux #netdev01
Library Operating System for Linux #netdev01
 
Qemu Pcie
Qemu PcieQemu Pcie
Qemu Pcie
 
Linux Network Stack
Linux Network StackLinux Network Stack
Linux Network Stack
 
Linux Internals - Kernel/Core
Linux Internals - Kernel/CoreLinux Internals - Kernel/Core
Linux Internals - Kernel/Core
 
Project ACRN expose and pass through platform hidden PCIe devices to SOS
Project ACRN expose and pass through platform hidden PCIe devices to SOSProject ACRN expose and pass through platform hidden PCIe devices to SOS
Project ACRN expose and pass through platform hidden PCIe devices to SOS
 
The Linux Block Layer - Built for Fast Storage
The Linux Block Layer - Built for Fast StorageThe Linux Block Layer - Built for Fast Storage
The Linux Block Layer - Built for Fast Storage
 
Boosting I/O Performance with KVM io_uring
Boosting I/O Performance with KVM io_uringBoosting I/O Performance with KVM io_uring
Boosting I/O Performance with KVM io_uring
 
malloc & vmalloc in Linux
malloc & vmalloc in Linuxmalloc & vmalloc in Linux
malloc & vmalloc in Linux
 
Understanding of linux kernel memory model
Understanding of linux kernel memory modelUnderstanding of linux kernel memory model
Understanding of linux kernel memory model
 
BPF Hardware Offload Deep Dive
BPF Hardware Offload Deep DiveBPF Hardware Offload Deep Dive
BPF Hardware Offload Deep Dive
 
Pushing Packets - How do the ML2 Mechanism Drivers Stack Up
Pushing Packets - How do the ML2 Mechanism Drivers Stack UpPushing Packets - How do the ML2 Mechanism Drivers Stack Up
Pushing Packets - How do the ML2 Mechanism Drivers Stack Up
 
The TCP/IP Stack in the Linux Kernel
The TCP/IP Stack in the Linux KernelThe TCP/IP Stack in the Linux Kernel
The TCP/IP Stack in the Linux Kernel
 
Project ACRN hypervisor introduction
Project ACRN hypervisor introduction Project ACRN hypervisor introduction
Project ACRN hypervisor introduction
 
ACRN vMeet-Up EU 2021 - shared memory based inter-vm communication introduction
ACRN vMeet-Up EU 2021 - shared memory based inter-vm communication introductionACRN vMeet-Up EU 2021 - shared memory based inter-vm communication introduction
ACRN vMeet-Up EU 2021 - shared memory based inter-vm communication introduction
 
Linux internal
Linux internalLinux internal
Linux internal
 
Embedded Hypervisor for ARM
Embedded Hypervisor for ARMEmbedded Hypervisor for ARM
Embedded Hypervisor for ARM
 
20111015 勉強会 (PCIe / SR-IOV)
20111015 勉強会 (PCIe / SR-IOV)20111015 勉強会 (PCIe / SR-IOV)
20111015 勉強会 (PCIe / SR-IOV)
 
Reconnaissance of Virtio: What’s new and how it’s all connected?
Reconnaissance of Virtio: What’s new and how it’s all connected?Reconnaissance of Virtio: What’s new and how it’s all connected?
Reconnaissance of Virtio: What’s new and how it’s all connected?
 
3. CPU virtualization and scheduling
3. CPU virtualization and scheduling3. CPU virtualization and scheduling
3. CPU virtualization and scheduling
 

Similar to SR-IOV Introduce

Armboot process zeelogic
Armboot process zeelogicArmboot process zeelogic
Armboot process zeelogicAleem Shariff
 
Known basic of NFV Features
Known basic of NFV FeaturesKnown basic of NFV Features
Known basic of NFV FeaturesRaul Leite
 
SR-IOV, KVM and Emulex OneConnect 10Gbps cards on Debian/Stable
SR-IOV, KVM and Emulex OneConnect 10Gbps cards on Debian/StableSR-IOV, KVM and Emulex OneConnect 10Gbps cards on Debian/Stable
SR-IOV, KVM and Emulex OneConnect 10Gbps cards on Debian/Stablejuet-y
 
Intermediate Intel® Distribution of OpenVINO™ toolkit for Computer Vision Ap...
 Intermediate Intel® Distribution of OpenVINO™ toolkit for Computer Vision Ap... Intermediate Intel® Distribution of OpenVINO™ toolkit for Computer Vision Ap...
Intermediate Intel® Distribution of OpenVINO™ toolkit for Computer Vision Ap...kkaralek
 
How to Self-Provision over WLAN with Intel(R) vPro(TM) Technology
How to Self-Provision over WLAN with Intel(R) vPro(TM) TechnologyHow to Self-Provision over WLAN with Intel(R) vPro(TM) Technology
How to Self-Provision over WLAN with Intel(R) vPro(TM) TechnologyIntel IT Center
 
How to Self-Provision over WLAN with Intel(R) vPro(TM) Technology
How to Self-Provision over WLAN with Intel(R) vPro(TM) TechnologyHow to Self-Provision over WLAN with Intel(R) vPro(TM) Technology
How to Self-Provision over WLAN with Intel(R) vPro(TM) TechnologyIT@Intel
 
Device virtualization and management in xen
Device virtualization and management in xenDevice virtualization and management in xen
Device virtualization and management in xenLingfei Kong
 
XS Boston 2008 Networking Direct Assignment
XS Boston 2008 Networking Direct AssignmentXS Boston 2008 Networking Direct Assignment
XS Boston 2008 Networking Direct AssignmentThe Linux Foundation
 
OSMC 2014: Server Hardware Monitoring done right | Werner Fischer
OSMC 2014: Server Hardware Monitoring done right | Werner FischerOSMC 2014: Server Hardware Monitoring done right | Werner Fischer
OSMC 2014: Server Hardware Monitoring done right | Werner FischerNETWAYS
 
the NML project
the NML projectthe NML project
the NML projectLei Yang
 
SR-IOV, KVM and Intel X520 10Gbps cards on Debian/Stable
SR-IOV, KVM and Intel X520 10Gbps cards on Debian/StableSR-IOV, KVM and Intel X520 10Gbps cards on Debian/Stable
SR-IOV, KVM and Intel X520 10Gbps cards on Debian/Stablejuet-y
 
VMworld 2013: ESXi Native Networking Driver Model - Delivering on Simplicity ...
VMworld 2013: ESXi Native Networking Driver Model - Delivering on Simplicity ...VMworld 2013: ESXi Native Networking Driver Model - Delivering on Simplicity ...
VMworld 2013: ESXi Native Networking Driver Model - Delivering on Simplicity ...VMworld
 
Windows内核技术介绍
Windows内核技术介绍Windows内核技术介绍
Windows内核技术介绍jeffz
 
SR-IOV ixgbe Driver Limitations and Improvement
SR-IOV ixgbe Driver Limitations and ImprovementSR-IOV ixgbe Driver Limitations and Improvement
SR-IOV ixgbe Driver Limitations and ImprovementLF Events
 
SESI 7 RouterTroubleshooting.pptx
SESI 7 RouterTroubleshooting.pptxSESI 7 RouterTroubleshooting.pptx
SESI 7 RouterTroubleshooting.pptxFirmanAFauzi1
 
A Comprehensive Implementation and Evaluation of Direct Interrupt Delivery
A Comprehensive Implementation and Evaluation of Direct Interrupt DeliveryA Comprehensive Implementation and Evaluation of Direct Interrupt Delivery
A Comprehensive Implementation and Evaluation of Direct Interrupt DeliveryCheng-Chun William Tu
 
Virtualization Support in ARMv8+
Virtualization Support in ARMv8+Virtualization Support in ARMv8+
Virtualization Support in ARMv8+Aananth C N
 
Embree Ray Tracing Kernels | Overview and New Features | SIGGRAPH 2018 Tech S...
Embree Ray Tracing Kernels | Overview and New Features | SIGGRAPH 2018 Tech S...Embree Ray Tracing Kernels | Overview and New Features | SIGGRAPH 2018 Tech S...
Embree Ray Tracing Kernels | Overview and New Features | SIGGRAPH 2018 Tech S...Intel® Software
 

Similar to SR-IOV Introduce (20)

Armboot process zeelogic
Armboot process zeelogicArmboot process zeelogic
Armboot process zeelogic
 
Known basic of NFV Features
Known basic of NFV FeaturesKnown basic of NFV Features
Known basic of NFV Features
 
SR-IOV, KVM and Emulex OneConnect 10Gbps cards on Debian/Stable
SR-IOV, KVM and Emulex OneConnect 10Gbps cards on Debian/StableSR-IOV, KVM and Emulex OneConnect 10Gbps cards on Debian/Stable
SR-IOV, KVM and Emulex OneConnect 10Gbps cards on Debian/Stable
 
UNIT-III ES.ppt
UNIT-III ES.pptUNIT-III ES.ppt
UNIT-III ES.ppt
 
Intermediate Intel® Distribution of OpenVINO™ toolkit for Computer Vision Ap...
 Intermediate Intel® Distribution of OpenVINO™ toolkit for Computer Vision Ap... Intermediate Intel® Distribution of OpenVINO™ toolkit for Computer Vision Ap...
Intermediate Intel® Distribution of OpenVINO™ toolkit for Computer Vision Ap...
 
How to Self-Provision over WLAN with Intel(R) vPro(TM) Technology
How to Self-Provision over WLAN with Intel(R) vPro(TM) TechnologyHow to Self-Provision over WLAN with Intel(R) vPro(TM) Technology
How to Self-Provision over WLAN with Intel(R) vPro(TM) Technology
 
How to Self-Provision over WLAN with Intel(R) vPro(TM) Technology
How to Self-Provision over WLAN with Intel(R) vPro(TM) TechnologyHow to Self-Provision over WLAN with Intel(R) vPro(TM) Technology
How to Self-Provision over WLAN with Intel(R) vPro(TM) Technology
 
Device virtualization and management in xen
Device virtualization and management in xenDevice virtualization and management in xen
Device virtualization and management in xen
 
C C N A Day2
C C N A  Day2C C N A  Day2
C C N A Day2
 
XS Boston 2008 Networking Direct Assignment
XS Boston 2008 Networking Direct AssignmentXS Boston 2008 Networking Direct Assignment
XS Boston 2008 Networking Direct Assignment
 
OSMC 2014: Server Hardware Monitoring done right | Werner Fischer
OSMC 2014: Server Hardware Monitoring done right | Werner FischerOSMC 2014: Server Hardware Monitoring done right | Werner Fischer
OSMC 2014: Server Hardware Monitoring done right | Werner Fischer
 
the NML project
the NML projectthe NML project
the NML project
 
SR-IOV, KVM and Intel X520 10Gbps cards on Debian/Stable
SR-IOV, KVM and Intel X520 10Gbps cards on Debian/StableSR-IOV, KVM and Intel X520 10Gbps cards on Debian/Stable
SR-IOV, KVM and Intel X520 10Gbps cards on Debian/Stable
 
VMworld 2013: ESXi Native Networking Driver Model - Delivering on Simplicity ...
VMworld 2013: ESXi Native Networking Driver Model - Delivering on Simplicity ...VMworld 2013: ESXi Native Networking Driver Model - Delivering on Simplicity ...
VMworld 2013: ESXi Native Networking Driver Model - Delivering on Simplicity ...
 
Windows内核技术介绍
Windows内核技术介绍Windows内核技术介绍
Windows内核技术介绍
 
SR-IOV ixgbe Driver Limitations and Improvement
SR-IOV ixgbe Driver Limitations and ImprovementSR-IOV ixgbe Driver Limitations and Improvement
SR-IOV ixgbe Driver Limitations and Improvement
 
SESI 7 RouterTroubleshooting.pptx
SESI 7 RouterTroubleshooting.pptxSESI 7 RouterTroubleshooting.pptx
SESI 7 RouterTroubleshooting.pptx
 
A Comprehensive Implementation and Evaluation of Direct Interrupt Delivery
A Comprehensive Implementation and Evaluation of Direct Interrupt DeliveryA Comprehensive Implementation and Evaluation of Direct Interrupt Delivery
A Comprehensive Implementation and Evaluation of Direct Interrupt Delivery
 
Virtualization Support in ARMv8+
Virtualization Support in ARMv8+Virtualization Support in ARMv8+
Virtualization Support in ARMv8+
 
Embree Ray Tracing Kernels | Overview and New Features | SIGGRAPH 2018 Tech S...
Embree Ray Tracing Kernels | Overview and New Features | SIGGRAPH 2018 Tech S...Embree Ray Tracing Kernels | Overview and New Features | SIGGRAPH 2018 Tech S...
Embree Ray Tracing Kernels | Overview and New Features | SIGGRAPH 2018 Tech S...
 

More from Lingfei Kong

Emacs presentation
Emacs presentationEmacs presentation
Emacs presentationLingfei Kong
 
It经典图书(附免费下载地址)
It经典图书(附免费下载地址)It经典图书(附免费下载地址)
It经典图书(附免费下载地址)Lingfei Kong
 
Shell实现的windows回收站功能的脚本
Shell实现的windows回收站功能的脚本Shell实现的windows回收站功能的脚本
Shell实现的windows回收站功能的脚本Lingfei Kong
 
Python学习笔记
Python学习笔记Python学习笔记
Python学习笔记Lingfei Kong
 
Congfigure python as_ide
Congfigure python as_ideCongfigure python as_ide
Congfigure python as_ideLingfei Kong
 

More from Lingfei Kong (7)

Emacs presentation
Emacs presentationEmacs presentation
Emacs presentation
 
It经典图书(附免费下载地址)
It经典图书(附免费下载地址)It经典图书(附免费下载地址)
It经典图书(附免费下载地址)
 
Shell实现的windows回收站功能的脚本
Shell实现的windows回收站功能的脚本Shell实现的windows回收站功能的脚本
Shell实现的windows回收站功能的脚本
 
Python学习笔记
Python学习笔记Python学习笔记
Python学习笔记
 
Kdump
KdumpKdump
Kdump
 
Congfigure python as_ide
Congfigure python as_ideCongfigure python as_ide
Congfigure python as_ide
 
Emacs tutorial
Emacs tutorialEmacs tutorial
Emacs tutorial
 

Recently uploaded

Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
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
 
"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
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamUiPathCommunity
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfOrbitshub
 
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
 
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
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...apidays
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
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
 
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
 
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
 
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
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 

Recently uploaded (20)

Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
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
 
"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 ...
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
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
 
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
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
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
 
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...
 
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
 
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
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 

SR-IOV Introduce

  • 1. Xen SR-IOV Feature (I/O Virtualization) Lingfei Kong lkong@redhat.com Sep. 2013
  • 2. Agenda ● Background ● SR-IOV Overview ● How it works with Xen ● Reference link ● Q & A
  • 3. Background I/O is an important part of any computing platform, including virtual machines running on top of a virtual machine monitor. ● I/O Virtualization Goals ● Provide the same device ● Provide scalability to support the number of virtual machines(VMs) They should also provide near native performance for I/O operations. ● Isolation ● Memory ● I/O streams ● Interrupts ● Control operations ● I/O operations and errors
  • 4. ● I/O Virtualization Approaches ● Software-Based Sharing ● Device emulation ● The split-driver model ● Drawbacks ● Only provide a subset of the total functionality provided by physical hardware. ● Significant CPU overhead and this can reduce the maximum throughput on an I/O device Figure 1. Software-Based Sharing .
  • 5. ● Direct Assignment Intel virtualization technology enables a device to directly DMA to/from host memory ● Drawbacks ● Limited scalability, a physical device can only be assigned to one VM Figure 2. Direct Assignment
  • 6. SR-IOV Overview ● SR-IOV is a specification that allows a PCIe device to appear to be multiple separate PCIe devices. The SR-IOV specification was created and is maintained by the PCI SIG, with the idea that a standard specification will help promote inter interoperability. ● SR-IOV works by introducing the idea of physical functions(PFs) and virtual functions(VFs) ● Physical Functions(PFs): These are full PCIe functions that include the SR-IOV Extended Capability. The capability is used to configure and manage the SR-IOV functionality. ● Virtual Functions(VFs): These are 'lightweight' PCIe functions that contain the resources necessary for data movement but have a carefully minimized set of configuration resources. ● The Direct Assignment method of virtualization provides very fast I/O. However, it prevents the sharing of I/O devices. SR-IOV provides a mechanism by which a Single Root Function(For example a single Ethernet Port) can appear to be multiple separate physical Devices.
  • 7. ● The SR-IOV capable device provides a configurable number of independent Virtual Functions, each with its own PCI Configuration space. The Hypervisor assigns one or more Virtual Functions to a virtual machine by mapping the actual configuration space the VFs to the configuration space presented to the virtual machine by the VMM. Figure 3. Mapping Virtual Function Configuration
  • 8. Figure 4. Intel SR-IOV Overview
  • 9. How it works with Xen ● Setup ● Enabled VT-d(for Intel machine) or AMD-V(for AMD machine) in BIOS ● SR-IOV supported hardware. (for example: Intel 82576 and Intel 82599 NIC) ● Check PF [host]#lspci | grep Etherne 86:00.0 Ethernet controller: Intel Corporation 82576 Gigabit Network Connection (rev 01) 86:00.1 Ethernet controller: Intel Corporation 82576 Gigabit Network Connection (rev 01) ● Enable VF in grub.conf Add "iommu=no-intremap" in kernel line Add "pci_pt_e820_access=on" in module line Reboot the host. After reboot, please check if these lines exist in `xm dmesg` output(mainly the first line): (XEN) [VT-D]iommu.c:1720: Interrupt Remapping hardware not found (XEN) [VT-D]iommu.c:1722: Device assignment will be disabled for security reasons (CVE-2011-1898). (XEN) [VT-D]iommu.c:1724: Use iommu=no-intremap to override.
  • 10. If exist, change `iommu=1` to `iommu=no-intremap` and reboot again. Enable VF in driver [host]#echo 'options igb max_vfs=7' >> /etc/modprobe.conf Then, restart system. VFs will be enabled automatically when host start. Another way to enable VF(after reboot): [host]# modprobe -r igb [host]# modprobe igb max_vfs=7
  • 11. ● Check VF [root@unused ~]# lspci|grep Ethernet 04:00.0 Ethernet controller: Broadcom Corporation NetXtreme II BCM5709 Gigabit Ethernet (rev 20) 04:00.1 Ethernet controller: Broadcom Corporation NetXtreme II BCM5709 Gigabit Ethernet (rev 20) 86:00.0 Ethernet controller: Intel Corporation 82576 Gigabit Network Connection (rev 01) 86:00.1 Ethernet controller: Intel Corporation 82576 Gigabit Network Connection (rev 01) 86:10.0 Ethernet controller: Intel Corporation 82576 Virtual Function (rev 01) 86:10.1 Ethernet controller: Intel Corporation 82576 Virtual Function (rev 01) 86:10.2 Ethernet controller: Intel Corporation 82576 Virtual Function (rev 01) 86:10.3 Ethernet controller: Intel Corporation 82576 Virtual Function (rev 01) 86:10.4 Ethernet controller: Intel Corporation 82576 Virtual Function (rev 01) 86:10.5 Ethernet controller: Intel Corporation 82576 Virtual Function (rev 01) 86:10.6 Ethernet controller: Intel Corporation 82576 Virtual Function (rev 01) 86:10.7 Ethernet controller: Intel Corporation 82576 Virtual Function (rev 01) 86:11.0 Ethernet controller: Intel Corporation 82576 Virtual Function (rev 01) 86:11.1 Ethernet controller: Intel Corporation 82576 Virtual Function (rev 01) 86:11.2 Ethernet controller: Intel Corporation 82576 Virtual Function (rev 01) 86:11.3 Ethernet controller: Intel Corporation 82576 Virtual Function (rev 01) 86:11.4 Ethernet controller: Intel Corporation 82576 Virtual Function (rev 01) 86:11.5 Ethernet controller: Intel Corporation 82576 Virtual Function (rev 01)
  • 12. ● Load pciback driver [host]#modprobe pciback [host]#lsmod |grep pciback pciback 65617 0 ● Get device ID of Vfs [host]# lspci -D | grep "82576 Virtual Function" 0000:86:10.0 Ethernet controller: Intel Corporation 82576 Virtual Function (rev 01) 0000:86:10.1 Ethernet controller: Intel Corporation 82576 Virtual Function (rev 01) …. ● Unbind device from host kernel driver [host]#echo 0000:86:10.0 > /sys/bus/pci/drivers/igbvf/unbind ● Bind PCI device to pciback driver [host]#echo 0000:86:10.0 > /sys/bus/pci/drivers/pciback/new_slot [host]#echo 0000:86:10.0 > /sys/bus/pci/drivers/pciback/bind Make sure the vifs get ip addresss?
  • 13. ● Make sure the VFs has been hidden from Dom0 already [host]#xm pci-list-assignable-devices 0000:86:10.0 ● Create the guest with VF devices' ID as parameter xm create pv-6.4-64.cfg pci='0000:86:10.0'
  • 14. Reference link ● Xen Technical Papers -> SR-IOV https://docspace.corp.redhat.com/docs/DOC-133989 ● PCI-SIG SR-IOV Primer https://docspace.corp.redhat.com/servlet/JiveServlet/downloadBody/155072-102-1- 755489/PCI-SIGSR-IOVPrimer.pdf ● SR-IOV support in Xen https://mirrorglass.englab.nay.redhat.com/XWiki/bin/download/Main/SR%2DIOV/ Xen%2DSR%2DIOV.pdf ● Overview of SR-IOV Driver Implementation https://mirrorglass.englab.nay.redhat.com/XWiki/bin/download/Main/SR %2DIOV/Intel82576SRIOV.pdf
  • 15. ● Xen PCI Passthrough http://wiki.xensource.com/wiki/XenPCIpassthrough ● Technical Paper (from KVM section) https://mirrorglass.englab.nay.redhat.com/XWiki/bin/download/Main/SR%2DIOV/SR %2DIOVTechPaper.pdf
  • 16. Q&A