testpmd 无法 运行 因为缺少 librte_pmd_bond.so

testpmd fails to run because librte_pmd_bond.so is missing

我已经使用 x86_64-native-linuxapp-gcc 和选项:

在 Centos 7 上构建并安装了 DPDK v.18.11.9
CONFIG_RTE_BUILD_SHARED_LIB=y

我们想 运行 测试 pmd 但加载失败:

$ ./x86_64-native-linuxapp-gcc/app/testpmd

./x86_64-native-linuxapp-gcc/app/testpmd: error while loading shared
libraries: librte_pmd_bond.so.2.1: cannot open shared object file: No such file or directory

这是预期的,因为 lib/ 不包含 librte_pmd_bond.so。

我应该使用什么构建选项来构建这个库?

此致 大卫

当忘记为应用程序精灵指定库路径时,这是一个常见错误。当 DPDK 库使用共享模式构建时,必须通过 LD_LIBRARY_PATH 指定 dpdk 共享对象的路径。如果不这样做,我们得到

# ldd app/testpmd
        linux-vdso.so.1 (0x00007fff3eeb2000)
        librte_pmd_bond.so.2.1 => not found
        librte_pmd_dpaa.so.1.1 => not found
        librte_pmd_ixgbe.so.2.1 => not found
        librte_pmd_i40e.so.2.1 => not found
        librte_pmd_bnxt.so.2.1 => not found
        librte_pmd_softnic.so.1.1 => not found
        librte_pdump.so.2.1 => not found
        librte_metrics.so.1.1 => not found
        librte_bitratestats.so.2.1 => not found
        librte_latencystats.so.1.1 => not found
        librte_bpf.so.1.1 => not found
        librte_gro.so.1.1 => not found
        librte_gso.so.1.1 => not found
        librte_mbuf.so.4.1 => not found
        librte_net.so.1.1 => not found
        librte_ethdev.so.11.1 => not found
        librte_mempool.so.5.1 => not found
        librte_ring.so.2.1 => not found
        librte_eal.so.9.1 => not found
        librte_cmdline.so.2.1 => not found
        libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f1474089000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f1473c98000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f14745cf000)

从而运行我们得到的申请

 # ./app/testpmd
./app/testpmd: error while loading shared libraries: librte_pmd_bond.so.2.1: cannot open shared object file: No such file or directory

要修复错误,如上所述使用

export LD_LIBRARY_PATH=[path to dpdk shared libraries]

这解决了依赖关系和应用程序运行。