DPDK -20.5遇到的一些问题总结

源码下载及编译

dpdk 最新代码下载,可以再码云平台创建clone一个dpdk的项目,从码云平台上下载代码速度比较块,能达到2Mbps,直接从github上下载不是一个数量级。

git clone https://gitee.com/jinshaohui/dpdk.git

编译可以直接参照dpdk上的文档,目前是使用meson & ninja来进行源码编译,旧的编译方式也适用。
首先需要安装工具meson,环境是是centos 7.5版本,需要更新成阿里源才能安装成功。

[root@localhost dpdk]# uname -a
Linux localhost.localdomain 3.10.0-862.el7.x86_64 #1 SMP Fri Apr 20 16:44:24 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
#更新成阿里源
cd /etc/yum.repos.d
sudo mv CentOS-Base.repo CentOS-Base.repo.bak
sudo wget -O CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
sudo wget -P /etc/yum.repos.d/ http://mirrors.aliyun.com/repo/epel-7.repo #这个也需要,下载epel源包含更多的软件库
yum clean all
yum makecache
#安装官网的步骤进行编译,没有发现什么问题。
meson build
ninja -C build

官方默认不会编译uio驱动,需要手动修改meson配置。

#配置选项文件meson_options.txt中的打开enable_kmods,再重新编译即可。
-option('enable_kmods', type: 'boolean', value: false,
+option('enable_kmods', type: 'boolean', value: true,
        description: 'build kernel modules')

遇到的问题

1、报驱动kernel header文件找不到。

#查询是否存在kernel-headers包,
[root@localhost dpdk]# rpm -qa| grep kernel
kernel-tools-3.10.0-862.el7.x86_64
kernel-tools-libs-3.10.0-862.el7.x86_64
kernel-headers-3.10.0-862.el7.centos.x86_64 #应该是缺少这个文件,当前环境已经安装上。
kernel-devel-3.10.0-862.el7.centos.x86_64
kernel-3.10.0-862.el7.x86_64
#可以官网路径找对应的版本的安装库,也可以再安装系统的时候指定安装。
wget https://buildlogs.centos.org/c7.1804.00.x86_64/kernel/20180410150127/3.10.0-862.el7.x86_64/kernel-headers-3.10.0-862.el7.centos.x86_64.rpm
#安装后,再次编译还是不行。我们去查询的,build目录是一个软连接指定的文件是不存在的。而我们安装的
#软件显示是3.10.0-862.el7.centos.x86_64,很明显不对应,最好是将目录名修改成3.10.0-862.el7.x86_64解决。
[root@localhost dpdk]# ls /lib/modules/`uname -r`/ -l | grep build
lrwxrwxrwx.  1 root root     38 Jul 24 01:57 build -> /usr/src/kernels/3.10.0-862.el7.x86_64
lrwxrwxrwx.  1 root root      5 Jul 24 01:57 source -> build

安装UIO驱动报错 Required key not available

报错如下,网上搜索到相关的解决方案,具体参见:

insmod: ERROR: could not insert module /root/dpdk/build/kernel/linux/igb_uio/igb_uio.ko: Required key not available
#环境执行后显示下面内容,说明打开了UEFI Secure Boot,再BIOS 菜单Boot中关闭可以解决。
keyctl list %:.system_keyring
6 keys in keyring:
...asymmetric: Red Hat Enterprise Linux Driver Update Program (key 3): bf57f3e87...
...asymmetric: Red Hat Secure Boot (CA key 1): 4016841644ce3a810408050766e8f8a29...
...asymmetric: Microsoft Corporation UEFI CA 2011: 13adbf4309bd82709c8cd54f316ed...
...asymmetric: Microsoft Windows Production PCA 2011: a92902398e16c49778cd90f99e...
...asymmetric: Red Hat Enterprise Linux kernel signing key: 4249689eefc77e95880b...
...asymmetric: Red Hat Enterprise Linux kpatch signing key: 4d38fd864ebe18c5f0b7...

标题

你可能感兴趣的:(VPP+DPDK)