记录一个dpdk 19.11 hello world 跑不起来问题(编译和权限)

下载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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值