linux 网卡绑定dpdk,DPDK网卡绑定 - osc_6pcuizwz的个人空间 - OSCHINA - 中文开源技术交流社区...

进入DPDK目录编译环境

# cd ~/DPDK/usertools

# ./dpdk-setup.py

注意,setup脚本需要在root权限下运行,并且每次重启电脑,都需要重新插入模块和绑定网卡。

在step1中选取合适的选项编译DPDK环境:[14] x86_64-native-linuxapp-gcc

----------------------------------------------------------

Step 1: Select the DPDK environment to build

----------------------------------------------------------

[1] arm64-armv8a-linuxapp-clang

[2] arm64-armv8a-linuxapp-gcc

[3] arm64-dpaa2-linuxapp-gcc

[4] arm64-dpaa-linuxapp-gcc

[5] arm64-thunderx-linuxapp-gcc

[6] arm64-xgene1-linuxapp-gcc

[7] arm-armv7a-linuxapp-gcc

[8] i686-native-linuxapp-gcc

[9] i686-native-linuxapp-icc

[10] ppc_64-power8-linuxapp-gcc

[11] x86_64-native-bsdapp-clang

[12] x86_64-native-bsdapp-gcc

[13] x86_64-native-linuxapp-clang

[14] x86_64-native-linuxapp-gcc

[15] x86_64-native-linuxapp-icc

[16] x86_x32-native-linuxapp-gcc

在step2中选取合适的用户空间I/O模块:[17] Insert IGB UIO module

运行任何DPDK的应用都需要在内核加载合适的用户空间I/O模块(UIO module)

----------------------------------------------------------

Step 2: Setup linuxapp environment

----------------------------------------------------------

[17] Insert IGB UIO module

[18] Insert VFIO module

[19] Insert KNI module

[20] Setup hugepage mappings for non-NUMA systems

[21] Setup hugepage mappings for NUMA systems

[22] Display current Ethernet/Crypto device settings

[23] Bind Ethernet/Crypto device to IGB UIO module

[24] Bind Ethernet/Crypto device to VFIO module

[25] Setup VFIO permissions

点选[22] Display current Ethernet/Crypto device settings 会显示机子的网卡情况

Network devices using DPDK-compatible driver

============================================

0000:01:00.0 'Ethernet Controller 10-Gigabit X540-AT2 1528' drv=igb_uio unused=ixgbe,vfio-pci

Network devices using kernel driver

===================================

0000:01:00.1 'Ethernet Controller 10-Gigabit X540-AT2 1528' if=enp1s0f1 drv=ixgbe unused=igb_uio,vfio-pci *Active*

Other Network devices

=====================

0000:03:00.0 'AR8151 v2.0 Gigabit Ethernet 1083' unused=atl1c,igb_uio,vfio-pci

目前的情况是第一张网卡绑定了DPDK,第二张是使用 Linux Kernel 的网卡,第三张还没有进行绑定。现在我们要绑定第三张网卡到DPDK。

选择[23] Bind Ethernet/Crypto device to IGB UIO module,输入对应的PCI号(0000:后的):

Enter PCI address of device to bind to IGB UIO driver: 03:00.0

OK

再次查看网卡情况,可以看到网卡绑定成功:

Option: 22

Network devices using DPDK-compatible driver

============================================

0000:01:00.0 'Ethernet Controller 10-Gigabit X540-AT2 1528' drv=igb_uio unused=ixgbe,vfio-pci

0000:03:00.0 'AR8151 v2.0 Gigabit Ethernet 1083' drv=igb_uio unused=atl1c,vfio-pci

Network devices using kernel driver

===================================

0000:01:00.1 'Ethernet Controller 10-Gigabit X540-AT2 1528' if=enp1s0f1 drv=ixgbe unused=igb_uio,vfio-pci *Active*

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值