zoukankan      html  css  js  c++  java
  • DPDK中使用VFIO的配置

    VFIO

    • VFIO是一个可以安全地把设备I/O、中断、DMA等暴露到用户空间(userspace),从而可以在用户空间完成设备驱动的框架。用户空间直接设备访问,虚拟机设备分配可以获得更高的IO性能。
    • 依赖于IOMMU. vfio-pci.
    • 相比于UIO,VFIO更为强健和安全

    要求

    • 本机使用版本为ubuntu18.04

    内核版本

    • Linix kernel version>=3.6.0
    $ uname -r
    

    支持VT-x、VT-d

    • 需要主板、内核、BIOS支持VT-x、VT-d。

    主板支持Intel® VT-x、VT-d。

    • 显示是否支持VT-d或VT-d是否成功打开
    $ dmesg | grep -e DMAR -e IOMMU
    

    内核支持Intel® VT-x、VT-d。

    • 检查 VT-d 在kernel中是否enabled, 运行:
    $ cat /proc/cmdline | grep iommu=pt
    $ cat /proc/cmdline | grep intel_iommu=on
    

    如果没有显示,需要进行如下配置:

    • 此步修改系统文件,容易误操作导致系统错误,修改前注意备份!
    • 进入配置文件:
    nano /etc/default/grub
    
    • 添加配置信息:添加iommu=pt intel_iommu=on到文件中的GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"行
    GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"//原文件的配置信息
    GRUB_CMDLINE_LINUX_DEFAULT="quiet splash iommu=pt intel_iommu=on"//添加配置信息
    
    • 更新配置信息并重启
    
    sudo grub-mkconfig -o /boot/grub/grub.cfg 
    sudo reboot 
    
    

    加载模块以及绑定网卡

    脚本配置

    • 使用dpdk/usertools/dpdk-setup.sh配置
    • Insert VFIO module
    • 配置hugepages
    • Bind NIC to VFIO

    命令配置

    • 配置大页
    • 插入模块以及绑定NIC
    $ modprobe vfio-pci
    $ /usr/bin/chmod a+x /dev/vfio
    $ /usr/bin/chmod 0666 /dev/vfio/*
    $ $DPDK_DIR/usertools/dpdk-devbind.py --bind=vfio-pci eth1
    $ $DPDK_DIR/usertools/dpdk-devbind.py --status
    
  • 相关阅读:
    MySQL的sql_mode合理设置
    Redis
    启动Jupyter Notebook提示ImportError: DLL load failed: 找不到指定的模块。
    Linux目录结构
    修改mysql密码报错: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '
    springmvc运行原理
    博客园美化
    数据搜索
    git
    window
  • 原文地址:https://www.cnblogs.com/vancasola/p/9378970.html
Copyright © 2011-2022 走看看