dpdk配置问题总结

1.使用meson build的时候报错

ERROR: Neither source directory ‘build’ nor build directory None contain a build file meson.build.
WARNING: Running the setup command as `meson [options]` instead of `meson setup [options]` is ambiguous and deprecated.

原因:当前目录下没有meson.build文件

解决方法:
1.找到 meson.build 文件所在的父目录 ,再运行meson build
2.直接建文件夹 , 用命令 sudo meson -D examples=all build

2.运行./dpdk-helloworld时报错

EAL: Detected CPU lcores: 8
EAL: Detected NUMA nodes: 1
EAL: Detected static linkage of DPDK
EAL: Multi-process socket /run/user/1000/dpdk/rte/mp_socket
EAL: Selected IOVA mode ‘VA’
EAL: VFIO support initialized
EAL: get_seg_fd(): open ‘/dev/hugepages/rtemap_0’ failed: Permission denied
EAL: Couldn’t get fd on hugepage file
EAL: error allocating rte services array
EAL: FATAL: rte_service_init() failed
EAL: rte_service_init() failed
PANIC in main():
Cannot init EAL
0: ./dpdk-helloworld (rte_dump_stack+0x42) [55d585ff9872]
1: ./dpdk-helloworld (__rte_panic+0xcd) [55d5853c28f2]
2: ./dpdk-helloworld (55d5851e3000+0x1c238c) [55d5853a538c]
3: /lib/x86_64-linux-gnu/libc.so.6 (__libc_start_main+0xf3) [7ff97f0bb083]
4: ./dpdk-helloworld (_start+0x2e) [55d585dfeb1e]
已放弃 (核心已转储)

解决方法:
1.使用 --no-huge 选项运行它
./dpdk-helloworld --no-huge
运行结果:
EAL: Detected CPU lcores: 8
EAL: Detected NUMA nodes: 1
EAL: Static memory layout is selected, amount of reserved memory can be adjusted with -m or --socket-mem
EAL: Detected static linkage of DPDK
EAL: Multi-process socket /run/user/1000/dpdk/rte/mp_socket
EAL: Selected IOVA mode ‘VA’
EAL: VFIO support initialized
TELEMETRY: No legacy callbacks, legacy socket not created
hello from core 1
hello from core 2
hello from core 3
hello from core 4
hello from core 5
hello from core 6
hello from core 7
hello from core 0
运行成功

2.使用root权限运行(但是参考文档没说明)
sudo ./dpdk-helloworld
运行结果:
EAL: Detected CPU lcores: 8
EAL: Detected NUMA nodes: 1
EAL: Detected static linkage of DPDK
EAL: Multi-process socket /var/run/dpdk/rte/mp_socket
EAL: Selected IOVA mode ‘PA’
EAL: VFIO support initialized
TELEMETRY: No legacy callbacks, legacy socket not created
hello from core 1
hello from core 2
hello from core 3
hello from core 4
hello from core 5
hello from core 6
hello from core 7
hello from core 0
运行成功

3.查看dpdk版本

pkg-config --modversion libdpdk即可直接查看

你可能感兴趣的:(dpdk,c++)