《PVE使用INTEL82576网卡开启IOMMO和SRIOV.docx》由会员分享,可在线阅读,更多相关《PVE使用INTEL82576网卡开启IOMMO和SRIOV.docx(6页珍藏版)》请在优知文库上搜索。
1、PVE使用INTEL82576网卡开启IOWO和SRIOV1 .建议先安装基本的软件aptupdateapt-getinstallnet-toolsvimethtool-y2 .打开IoMMUS/etc/default/grub文件里,GRUB_CMDLINE_LINUX_DEFAULT行添加以下内容如果intelCPUt则inteUommU=Onpcie_acs_override=downstream0sed-i7GRUB_CMDLINE_LINUX_DEFAULT/cGRUB_CMDUNEJJNUX_DEFAULT=modprobe.blacklist=nouveauinteLiommU二
2、Orretcdefaultgrub如果AMDCPU,则amdjommu=opcie_acs_override=downstream0sed-i7GRUB_CMDLINE_LINUX_DEFAULT/cGRUB_CMDLINE_LINUX_DEFAULT=modprobe.blacklist=nouveauamd_iommu=onetcdefaultgrub# 更新grubupdate-grub#S/etc/modules文件里添加IOMMUvfioetcmodulesvfiojommu_typeletcmodulesvfio_pcietcmodulesvfio_virqfdetcmodules
3、# 更新并重启update-initramfs-u-kallreboot# 检查IOMMO功能是否开启dmesggrep-eDMAR-eIOMMU-eAMD-Vifindsyskereliommu-groups/-typeIIspci-WIIspci-vvgrepEth如果没有开启,则在etcmodprobe.d的任意一个.conf下增加不安全中断:optionsvfio_iommu_typelaIlow_usafe_interrupts=13.启用SRIOVIspci-nngrepEth最前面的数字是设备的BDF号Ispci-SBDF号-VWgrepCapabilities查看是否支持SR-
4、IoV#查看网口最大支持的VF网口数量catsysbuspcidevices0000:BDFsriov-totalvfs返回结果就是最大支持的VF网口数量echoVF网口数量sysdassnetenplsfdeviceSriOVJumvfs#添加VF网口成功显示lspcigrepEth首先确定你的intel网卡支持SR-IOV,如果支持,那么继续rootpve#echooptionsigbmax-vfs=616,6,6,6,6etcmodprobe.digb.confrootpve:#depmod-arootpve#update-initramfs-urootpve#reboot解释一下,ma
5、x_vfs=6,6,6,6,6,6:这条语句说明最大的虚拟网卡是6个,也就是虚拟6个echooptionsigbmax_vfs=6,6,6,6,6,6etcmodprobe.digb.confdepmod-aupdate-initramfs-ureboot解释一下,max_vfs=6,6,6,6,6,6:这条语句说明最大的虚拟网卡是6个,也就是1个物理网卡虚拟6个3.4检查虚拟网卡rootpve#dmesggrep82576Function Function Function Function Function Function Function Function Function Funct
6、ion Function Function2.527369igbvf0000:07:10,1:InteI(R)82576Virtua2.532109igbvf0000:07:10,3:InteI(R)82576Virtua2.535583igbvf0000:07:10,5:InteI(R)82576Virtua2,539074igbvf0000:07:10,7:InteI(R)82576Virtua2.542565igbvf0000:07:11,1:InteI(R)82576Virtua2.546055igbvf0000:07:11,3:InteI(R)82576Virtua2.768637i
7、gbvf0000:07:10.0:InteI(R)82576Virtua2.771872igbvf0000:07:10,2:InteI(R)82576Virtua2.775080igbvf0000:07:10.4:InteI(R)82576Virtua2.778273igbvf0000:07:10.6:InteI(R)82576Virtua2.781481igbvf0000:07:11,0:InteI(R)82576Virtua2.784682igbvf0000:07:11,2:InteI(R)82576Virtua2.920650igbvf0000:05:10,03.128489igbvf0
8、000:05:10,23.412422igbvf0000:05:10,43.540328igbvf0000:05:10,63.580426igbvf0000:05:11,03.608433igbvf0000:05:11,23.940652igbvf0000:05:10,13.960418igbvf0000:05:10,33.976422igbvf0000:05:10,53.992427igbvf0000:05:10,74.008435igbvf0000:05:11,14.024426igbvf0000:05:11,34.359456igbvf0000:04:10,04.380383igbvf0
9、000:04:10,24.400395igbvf0000:04:10,44.424404igbvf0000:04:10,64.440398igbvf0000:04:11,04.464396igbvf0000:04:11,24.795365igbvf0000:04:10,14.820409igbvf0000:04:10,34.836453igbvf0000:04:10,54.856446igbvf0000:04:10,74.872448igbvf0000:04:11,14.888444igbvf0000:04:11,3InteI(R) 82576 VirtuaInteI(R) 82576 Vir
10、tuaInteI(R) 82576 VirtuaInteI(R) 82576 VirtuaInteI(R) 82576 VirtuaInteI(R) 82576 VirtuaInteI(R) 82576 VirtuaInteI(R) 82576 VirtuaInteI(R) 82576 VirtuaInteI(R) 82576 VirtuaInteI(R) 82576 VirtuaInteI(R) 82576 VirtuaInteI(R) 82576 VirtuaInteI(R) 82576 VirtuaInteI(R) 82576 VirtuaInteI(R) 82576 VirtuaInt
11、eI(R) 82576 VirtuaInteI(R) 82576 VirtuaInteI(R) 82576 VirtuaInteI(R) 82576 VirtuaInteI(R) 82576 VirtuaInteI(R) 82576 VirtuaInteI(R) 82576 VirtuaInteI(R) 82576 VirtuaFunction Function Function Function Function Function Function Function Function Function Function Function Function Function Function
12、Function Function Function Function Function Function Function Function Function出现VF代表成功了,那么在你的ProXmOXVE控制面板上,网络一栏就会出现很多网卡注意把原来网卡标记一下,否则会乱的二、测试SR-Ic)V网卡生成可以先进行测试譬如在enp2sf网卡上开4个VFecho4syscIass/net/enp2s0f0device/sriov_numvfs成功不会有任何反馈,回到PVE节点网络查看网络列表是否有VF网卡出现,也可以使用Ispci查看pci设备中是否有vf网卡三、注册系统服务首先创建启动脚本c
13、detcsystemd/systemvisriov.service示例是在i350-T4(系统名称enp2s)的0号和1号口上分别开5个Vf网卡、固化MAC地址防止重启MAC随机变动并且设置所有PF和VF为UP状态UnitDescription=ScripttoenableSR-IOVonbootServiceType=SimpIe#startSR-IOVExecStartPre=usrbinbash-c7usrbinecho5sysclassnetenp2s0f0devicesriov-numvfs,ExecStartPre=usrbinbash-c7usrbinecho5sysclassn
14、etenp2s0fldevicesriov-numvfs#setVFMACExecStartPre=usrbinbash-c,usrbiniplinksetdevenp2sfvfOmac00:54:00:00:00:00ExecStartPre=usrbinbash-c7usrbiniplinksetdevenp2sfvf1mac00:54:00:00:00:01ExecStartPre=usrbinbash-c,usrbiniplinksetdevenp2sfvf2mac00:54:00:00:00:02ExecStartPre=usrbinbash-c7usrbiniplinksetdevenp2sfvf3mac00:54:00:00:00:03ExecStartPre=usrbinbash-c,usrbiniplinksetdevenp2sfvf4mac00:54:00:00:00:04ExecStartPre=usrbinbash-c7usrbiniplinksetdevenp2sflvf0mac00:54:00:00:01:00ExecStartPre=usrbinbash-c,