【发布时间】:2026-01-05 01:40:01
【问题描述】:
我将 libdpdk 静态链接到我的应用程序,当我启动应用程序时,EAL 初始化失败。
日志:
EAL: Detected 80 lcore(s)
EAL: Detected 2 NUMA nodes
EAL: Detected static linkage of DPDK
EAL: Multi-process socket /var/run/dpdk/rte/mp_socket
EAL: Selected IOVA mode 'VA'
EAL: Probing VFIO support...
EAL: VFIO support initialized
EAL: No legacy callbacks, legacy socket not created
MBUF: error setting mempool handler
EAL: Error - exiting with code: 1
Cause: Cannot init packet mbuf pool Invalid argument
我使用以下命令在我的测试服务器中安装了 DPDK-20.11。
# meson build
#cd build
#ninja ; ninja install
我以 l2fwd Makefile 为例构建了我的应用程序 Makefile,不确定我缺少什么。
寻找建议。
[编辑-1]
int main(int argc, char **argv)
{
int ret; unsigned lcore_id;
ret = rte_eal_init(argc, argv);
if (ret < 0)
rte_panic("Cannot init EAL\n");
struct rte_mempool *mp =
rte_pktmbuf_pool_create("packet_pool", 8192, 64, 0, RTE_MBUF_DEFAULT_BUF_SIZE, rte_socket_id());
return 0;
}
如何构建
- 将 makefile 从 l2fwd 复制到自定义应用文件夹
- 执行
make static - 运行应用程序
sudo ./a.out
【问题讨论】:
-
能否请您提供以下信息
1) have you used make or make static for l2fwd examples? 2) can you perform ls -lal [dpdk root folder]/examples/l2fwd/build? 3) can you share the cmd line used? 4) can you update ticket with running --log-level=8 -
Vipin,我的意思是我的应用程序我以 l2fwd 的 makefile 为例。
-
我会谦虚地请您分享您的简单代码 sn-p 以重现错误。这是为了重现错误并隔离它是否来自 Makefile 或您的自定义应用程序。
-
Vipin ,为之前的简短回复道歉,(在我完成回复之前,我误击了输入)。我使用 make static 构建。使用日志级别 8,我看不到任何新日志
EAL: Detected 80 lcore(s) EAL: Detected 2 NUMA nodes EAL: Detected static linkage of DPDK EAL: Multi-process socket /var/run/dpdk/rte/mp_socket EAL: Selected IOVA mode 'VA' EAL: Probing VFIO support... EAL: VFIO support initialized EAL: No legacy callbacks, legacy socket not created MBUF: error setting mempool handler EAL: Error - exiting with code: 1 -
代码 sn-p ``` int main(int argc, char **argv) { int ret;无符号 lcore_id; ret = rte_eal_init(argc, argv); if (ret
标签: dpdk