SR-IOV(Single Root I/O Virtualization):将PCIe共享给虚拟机的标准
目录
SR-IOV要求
SR-IOV vs PCI path-through
架构上的比较(以网卡为例)
Virtio 和 Pass-Through 的详细比较
SR-IOV vs DPDK
SR-IOV使用示例
优缺点
参考
SR-IOV
(Single Root I/O Virtualization
)是一个将PCIe
共享给虚拟机的标准,通过为虚拟机提供独立的内存空间、中断、DMA
流,来绕过VMM
实现数据访问。SR-IOV基于两种PCIe functions
:
PF
(Physical Function
): 包含完整的PCIe
功能,包括SR-IOV
的扩张能力,该功能用于SR-IOV
的配置和管理。FV
(Virtual Function
): 包含轻量级的PCIe
功能。每一个VF
有它自己独享的PCI
配置区域,并且可能与其他VF
共享着同一个物理资源
SR-IOV要求
CPU
必须支持IOMMU
(比如英特尔的VT-d
或者AMD
的AMD-Vi
,Power8
处理器默认支持IOMMU
)- 固件
Firmware
必须支持IOMMU
CPU
根桥必须支持ACS
或者ACS
等价特性PCIe
设备必须支持ACS
或者ACS
等价特性- 建议根桥和
PCIe
设备中间的所有PCIe
交换设备都支持ACS,如果某个PCIe
交换设备不支持ACS
,其后的所有PCIe
设备只能共享某个IOMMU
组,所以只能分配给1台虚机。
SR-IOV vs PCI path-through
架构上的比较(以网卡为例)
Virtio 和 Pass-Through 的详细比较
图片来源slideshare - Kvm performance optimization for ubuntu、KVM 介绍(4):I/O 设备直接分配和 SR-IOV [KVM PCI/PCIe Pass-Through SR-IOV]
SR-IOV vs DPDK
SR-IOV使用示例
开启VF
:
modprobe -r igb
modprobe igb max_vfs=7
echo "options igb max_vfs=7" >>/etc/modprobe.d/igb.conf
查找Virtual Function
:
# lspci | grep 82576
0b:00.0 Ethernet controller: Intel Corporation 82576 Gigabit Network Connection (rev 01)
0b:00.1 Ethernet controller: Intel Corporation 82576 Gigabit Network Connection(rev 01)
0b:10.0 Ethernet controller: Intel Corporation 82576 Virtual Function (rev 01)
0b:10.1 Ethernet controller: Intel Corporation 82576 Virtual Function (rev 01)
0b:10.2 Ethernet controller: Intel Corporation 82576 Virtual Function (rev 01)
0b:10.3 Ethernet controller: Intel Corporation 82576 Virtual Function (rev 01)
0b:10.4 Ethernet controller: Intel Corporation 82576 Virtual Function (rev 01)
0b:10.5 Ethernet controller: Intel Corporation 82576 Virtual Function (rev 01)
0b:10.6 Ethernet controller: Intel Corporation 82576 Virtual Function (rev 01)
0b:10.7 Ethernet controller: Intel Corporation 82576 Virtual Function (rev 01)
0b:11.0 Ethernet controller: Intel Corporation 82576 Virtual Function (rev 01)
0b:11.1 Ethernet controller: Intel Corporation 82576 Virtual Function (rev 01)
0b:11.2 Ethernet controller: Intel Corporation 82576 Virtual Function (rev 01)
0b:11.3 Ethernet controller: Intel Corporation 82576 Virtual Function (rev 01)
0b:11.4 Ethernet controller: Intel Corporation 82576 Virtual Function (rev 01)
0b:11.5 Ethernet controller: Intel Corporation 82576 Virtual Function (rev 01)# virsh nodedev-list | grep 0b
pci_0000_0b_00_0
pci_0000_0b_00_1
pci_0000_0b_10_0
pci_0000_0b_10_1
pci_0000_0b_10_2
pci_0000_0b_10_3
pci_0000_0b_10_4
pci_0000_0b_10_5
pci_0000_0b_10_6
pci_0000_0b_11_7
pci_0000_0b_11_1
pci_0000_0b_11_2
pci_0000_0b_11_3
pci_0000_0b_11_4
pci_0000_0b_11_5
$ virsh nodedev-dumpxml pci_0000_0b_00_0
<device><name>pci_0000_0b_00_0</name><parent>pci_0000_00_01_0</parent><driver><name>igb</name></driver><capability type='pci'><domain>0</domain><bus>11</bus><slot>0</slot><function>0</function><product id='0x10c9'>82576 Gigabit Network Connection</product><vendor id='0x8086'>Intel Corporation</vendor></capability>
</device>
通过libvirt绑定到虚拟机
$ cat >/tmp/interface.xml <<EOF
<interface type='hostdev' managed='yes'><source><address type='pci' domain='0' bus='11' slot='16' function='0'/></source>
</interface>
EOF
$ virsh attach-device MyGuest /tmp/interface. xml --live --config
当然也可以给网卡配置MAC
地址和VLAN
:
<interface type='hostdev' managed='yes'><source><address type='pci' domain='0' bus='11' slot='16' function='0'/></source><mac address='52:54:00:6d:90:02'><vlan><tag id='42'/></vlan><virtualport type='802.1Qbh'><parameters profileid='finance'/></virtualport></interface>
通过Qemu绑定到虚拟机
/usr/bin/qemu-kvm -name vdisk -enable-kvm -m 512 -smp 2 \
-hda /mnt/nfs/vdisk.img \
-monitor stdio \
-vnc 0.0.0.0:0 \
-device pci-assign,host=0b:00.0
优缺点
Pros
:
- More Scalable than Direct Assign
- Security through IOMMU and function isolation
- Control Plane separation through PF/VF notion
- High packet rate, Low CPU, Low latency thanks to Direct Pass through
Cons
:
- Rigid: Composability issues
- Control plane is pass through, puts pressure on Hardware resources
- Parts of the PCIe config space are direct map from Hardware
- Limited scalability (16 bit)
- SR-IOV NIC forces switching features into the HW
- All the Switching Features in the Hardware or nothing
参考
- Intel SR-IOV Configuration Guide
- OpenStack SR-IOV Passthrough for Networking
- Redhat OpenStack SR-IOV Configure
- SDN Fundamentails for NFV, Openstack and Containers
- I/O设备直接分配和SRIOV
- Libvirt PCI passthrough of host network devices
- Story of Network Virtualization and its future in Software and Hardware
SR-IOV(Single Root I/O Virtualization):将PCIe共享给虚拟机的标准相关推荐
- PCIe规范的扩展:SR-IOV(Single Root I/O virtual)网卡直通技术
目录 Single Root I/O虚拟化(SR-IOV)概述 SR-IOV架构 Hyper-V可扩展交换机简介 SR-IOV物理功能(PF) 编写SR-IOV PF微型端口驱动程序概述 SR-IOV ...
- 嵌入式开发专业术语概念汇总
专业术语概念 SDK 概念:软件开发工具包(SDK,全称:Software Development Kit) SDK是Software Development Kit的缩写,中文意思是"软件 ...
- Intel Scalable IOV介绍及应用实例
IO设备虚拟化技术背景介绍 随着云计算技术的发展,IO设备虚拟化经历了从全虚拟化(full-virtualization)到半虚拟化(para-virtualization),到设备直通的变革.Int ...
- kvm虚拟机设置万兆网卡_SR-IOV 10Gb 万兆网卡支持
SR SR- - IOV 单根数据 I/O 虚拟化 虚拟化, , 提升虚拟主机效率 主机虚拟化已几乎被安装于各种大小规模的环境,来降低成本及用做数据中心资源的优化.要了解 这一点,最近有一项对于大量北 ...
- CNA, FCoE, TOE, RDMA, iWARP, iSCSI等概念及 Chelsio T5 产品介绍
鉴于研究所的需求,最近开始研究Chelsio T5(终结者5),本篇博文对相关技术的基础概念做了罗列,并给了一些扩展学习链接.后续自己将针对RDMA技术做进一步学习和研究! 核心基础概念 FCoE:以 ...
- 查看当前设备是否启用SR-IOV
参考: 在 Windows Server 上為 Hyper-V 虛擬機配置 SR-IOV - HeyAdvice.net 虚拟化中的SR-IOV - 爱码网 Windows 使用PowerShell ...
- 【PCIe 5.0 - 100】SR-IOV【1】
本文将从PCIe角度讲SR-IOV. PCIe 系列SR-IOV导航: [PCIe 5.0 - 100]SR-IOV[1] [PCIe 5.0 - 101]SR-IOV[2] [PCIe 5.0 - ...
- 2021年二月下旬文章导读与开源项目仓库 | scatter-gather DMA,SR-IOV,ARP欺骗,中断,Lockdep,virtio,vhost
目录 文章目录 开源项目仓库 [转]浅谈scatter-gather DMA SR-IOV:网卡直通技术 [黑客入门] 连接公共WIFI有多危险(ARP欺骗) DPDK ACL算法介绍 文章目录 Li ...
- 深入理解SR-IOV和IO虚拟化
一.背景 SR-IOV(Single Root I/O Virtualization)是由PCI-SIG组织定义的PCIe规范的扩展规范<Single Root I/O Virtualizati ...
最新文章
- CUDA运行时 Runtime(二)
- delphi listview动态添加图片_网站图片如何优化适合收录
- python 基础学习 正则表达式1(规则)
- BZOJ 4244 邮戳拉力赛 (DP)
- 常考数据结构与算法:容器盛水问题
- python3 sorted排序代码示例
- 【数据结构与算法】之深入解析“最小栈”的求解思路与算法示例
- python3爬虫(9)分布式爬虫与对等分布式爬虫
- DOM-7 【兼容】事件处理函数、冒泡捕获、阻止冒泡默认事件
- ARM MOV和 LDR指令关系
- 【HM】第2课:JavaScript基础
- Java题目筛选器_【024期】JavaWeb面试题(五):Filter和Listener
- 计算hashCode的常见方法
- 几款实用Chrome插件
- 微信测试账户申请以及测试
- Linux中将4块10T新硬盘合并成一个,挂载到Resource目录下
- [附源码]计算机毕业设计Python+uniapp智能公交查询APP59sm2(程序+lw+APP+远程部署)
- 海大计算机考研经验,关于考研中国海洋大学的一些小经验
- 433lora手持机|手持数据采集终端|lora模块手持PDA
- GitChat · 前端 | Webpack 工程的 PWA 实战
热门文章
- android viewpager fragment 生命周期,ViewPager中Fragment的生命周期
- English trip -- MC(情景课)3 C Do you have a sister?
- js定时器让动画隔秒运动
- PostCSS深入学习: PostCSS和Sass、Stylus或LESS一起使用
- IAR 的精确延时程序(转)
- poj3258二分法
- C/C++程序设计注意事项 (二)
- photoshop制作gif去掉杂色
- 逻辑盘下的所有目录完全共享_Python File I/O之读取路径下所有目录和文件
- python怎么换行继续写脚本_python怎么换行继续写脚本