下载dpdk 源码后:
git clone git@github.com:DPDK/dpdk.git
切到 19.11
git checkout v19.11
用usertool下的dpdk_setup.sh 选择
[38] x86_64-native-linuxapp-gcc
进行编译:
结果者是build 不过:
== Build kernel/linux/igb_uio
== Build kernel/linux/kni
CC [M] /home/test/yubo/nr_phy_cnf95/f95_nr_bphy_vDU_FDD/test/TestMac/dpdk/x86_64-native-linuxapp-gcc/build/kernel/linux/kni/kni_misc.o
In file included from /home/test/yubo/nr_phy_cnf95/f95_nr_bphy_vDU_FDD/test/TestMac/dpdk/x86_64-native-linuxapp-gcc/build/kernel/linux/kni/kni_misc.c:22:0:
/home/test/yubo/nr_phy_cnf95/f95_nr_bphy_vDU_FDD/test/TestMac/dpdk/kernel/linux/kni/kni_dev.h: In function ‘iova_to_phys’:
/home/test/yubo/nr_phy_cnf95/f95_nr_bphy_vDU_FDD/test/TestMac/dpdk/kernel/linux/kni/kni_dev.h:104:30: error: passing argument 1 of ‘get_user_pages_remote’ from incompatible pointer type [-Werror=incompatible-pointer-types]
ret = get_user_pages_remote(tsk, tsk->mm, iova, 1,
^~~
In file included from ./include/linux/bvec.h:14:0,
from ./include/linux/skbuff.h:17,
from ./include/net/net_namespace.h:39,
from ./include/linux/netdevice.h:37,
因为我只想要用共享内存, 所以在build 目录下, 把kni, igb_uio 掉了, 不编译.
可以编译通过.
然后还到example/ helloworld下:
make clean.
make.
出来后运行, 会报:
换成: [41] x86_64-native-linux-gcc 重新编译dpdk, helloworld后还是一样.
因为之前遇到过没有加core mask. 所以加上参数 -c -x0f, 或者 -l 4-7 都不行,还是一样.
从一个网站看可以不用大页启动, 如下:
可以成功, 不过这样不行.
加入调试日志看下:
然后看到了以下信息:
看上是没有权限.
用root 执行看下:
可以了:
总结这次要注意的:
1. 选择: [41] x86_64-native-linux-gcc
2. 执行是加上core mask.
3. 如果有问题, 增加日志级别进行定位.
4. 关键是执行的时候用root 权限执行.
参考文章: https://stackoverflow.com/questions/64707324/dpdk-sample-application-aborts-after-eal-couldnt-get-fd-on-hugepage-file