emmericp / MoonGen

MoonGen is a fully scriptable high-speed packet generator built on DPDK and LuaJIT. It can saturate a 10 Gbit/s connection with 64 byte packets on a single CPU core while executing user-provided Lua scripts for each packet. Multi-core support allows for even higher rates. It also features precise and accurate timestamping and rate control.
MIT License
1.04k stars 234 forks source link

Unable to Build with Mellanox NIC #277

Closed vsag96 closed 4 years ago

vsag96 commented 4 years ago

I was able to install DPDK successfully. With testpmd I can see the ports of NIC's on my machine. https://github.com/libmoon/libmoon/blob/master/install-mlx.md, as per these instructions, It says to follow one option for installation, I am posting the build output, If you can tell me which debian files I have to install that will be helpful. I am pasting the build log from the point it threw a error.

OFED Driver Version:MLNX_OFED_LINUX-5.0-2.1.8.0 DPDK version:19.11.2

Note: I searched the DEB directory for those packages and installed them. I was able to build MoonGen. However testpmd stopped working, with the following prompt. So I have to revert back the changes. Any idea why this is happening? Any possible solutions? At this point reverting back OFED version and DPDK would be better for me. I am trying to use a library called TAS. They said their solution works with DPDK 17.11.9, 18.11.5, 19.11. Any suggestions on the ofed driver and dpdk version where this won't cause an issue with Moongen?

./testpmd: /usr/lib/libmlx5.so.1: no version information available (required by ./testpmd)
./testpmd: /usr/lib/libmlx5.so.1: no version information available (required by ./testpmd)
./testpmd: /usr/lib/libmlx5.so.1: no version information available (required by ./testpmd)
./testpmd: /usr/lib/libmlx5.so.1: no version information available (required by ./testpmd)
./testpmd: /usr/lib/libmlx5.so.1: no version information available (required by ./testpmd)
./testpmd: /usr/lib/libmlx5.so.1: no version information available (required by ./testpmd)
./testpmd: /usr/lib/libmlx5.so.1: no version information available (required by ./testpmd)
./testpmd: /usr/lib/libmlx5.so.1: no version information available (required by ./testpmd)
./testpmd: /usr/lib/libmlx5.so.1: no version information available (required by ./testpmd)
./testpmd: /usr/lib/libmlx5.so.1: no version information available (required by ./testpmd)
In file included from /home/vthape2/MoonGen/libmoon/deps/dpdk/drivers/net/mlx5/mlx5.h:69:0,
                 from /home/vthape2/MoonGen/libmoon/deps/dpdk/drivers/net/mlx5/mlx5.c:67:
/home/vthape2/MoonGen/libmoon/deps/dpdk/drivers/net/mlx5/mlx5_rxtx.h:46:10: fatal error: infiniband/mlx5_hw.h: No such file or directory
 #include <infiniband/mlx5_hw.h>
          ^~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
  CC enic_main.o
/home/vthape2/MoonGen/libmoon/deps/dpdk/mk/internal/rte.compile-pre.mk:138: recipe for target 'mlx5.o' failed
make[4]: *** [mlx5.o] Error 1
/home/vthape2/MoonGen/libmoon/deps/dpdk/mk/rte.subdir.mk:63: recipe for target 'mlx5' failed
make[3]: *** [mlx5] Error 2
make[3]: *** Waiting for unfinished jobs....
  CC e1000_82541.o
  CC null_crypto_pmd_ops.o
  CC e1000_82542.o
  CC rte_eth_bond_pmd.o
  PMDINFO ark_ethdev.o.pmd.c
  CC ark_ethdev.o.pmd.o
  CC i40e_common.o
  PMDINFO cxgbe_ethdev.o.pmd.c
  LD ark_ethdev.o
  CC cxgbe_ethdev.o.pmd.o
  PMDINFO lio_ethdev.o.pmd.c
  CC lio_ethdev.o.pmd.o
  LD cxgbe_ethdev.o
  CC ark_ethdev_rx.o
  LD lio_ethdev.o
  CC cxgbe_main.o
  CC sge.o
  CC lio_rxtx.o
  CC rte_cryptodev_scheduler.o
  CC e1000_82543.o
  CC failsafe_eal.o
  PMDINFO ena_ethdev.o.pmd.c
  CC ena_ethdev.o.pmd.o
  AR librte_pmd_null_crypto.a
  LD ena_ethdev.o
  CC ena_com.o
  INSTALL-LIB librte_pmd_null_crypto.a
  CC ena_eth_com.o
  PMDINFO rte_eth_af_packet.o.pmd.c
  CC rte_eth_af_packet.o.pmd.o
  LD rte_eth_af_packet.o
  AR librte_pmd_af_packet.a
  CC e1000_82571.o
  INSTALL-LIB librte_pmd_af_packet.a
  CC e1000_82575.o
  CC failsafe_ops.o
  CC failsafe_rxtx.o
  CC scheduler_roundrobin.o
  CC ixgbe_82598.o
  PMDINFO avp_ethdev.o.pmd.c
  CC avp_ethdev.o.pmd.o
  LD avp_ethdev.o
  SYMLINK-FILE include/rte_avp_common.h
  SYMLINK-FILE include/rte_avp_fifo.h
  CC ixgbe_82599.o
  AR librte_pmd_avp.a
  INSTALL-LIB librte_pmd_avp.a
  CC enic_rxtx.o
  CC ixgbe_x540.o
  CC e1000_i210.o
  CC failsafe_ether.o
  AR librte_pmd_ena.a
  CC ark_ethdev_tx.o
  INSTALL-LIB librte_pmd_ena.a
  CC ark_mpu.o
  CC ixgbe_x550.o
  CC ixgbe_phy.o
  CC ixgbe_api.o
  CC scheduler_pkt_size_distr.o
  CC i40e_diag.o
  CC e1000_api.o
  CC failsafe_flow.o
  CC enic_clsf.o
  CC t4_hw.o
  CC e1000_ich8lan.o
  CC e1000_mac.o
  CC lio_23xx_vf.o
  PMDINFO fm10k_ethdev.o.pmd.c
  CC fm10k_ethdev.o.pmd.o
  CC ixgbe_vf.o
  LD fm10k_ethdev.o
  CC fm10k_rxtx.o
  CC fm10k_pf.o
  CC ark_pktchkr.o
  CC scheduler_failover.o
  PMDINFO rte_eth_bond_pmd.o.pmd.c
  CC rte_eth_bond_pmd.o.pmd.o
  AR librte_pmd_failsafe.a
  LD rte_eth_bond_pmd.o
  CC scheduler_multicore.o
  INSTALL-LIB librte_pmd_failsafe.a
  CC rte_eth_bond_args.o
  CC lio_mbox.o
  CC enic_res.o
  CC enic_flow.o
  CC base/vnic_cq.o
  CC base/vnic_wq.o
  CC i40e_hmc.o
  CC i40e_lan_hmc.o
  CC ark_pktdir.o
  CC ixgbe_hv_vf.o
  CC rte_eth_bond_8023ad.o
  CC rte_eth_bond_alb.o
  SYMLINK-FILE include/rte_eth_bond.h
  SYMLINK-FILE include/rte_eth_bond_8023ad.h
  AR librte_pmd_lio.a
  CC fm10k_tlv.o
  CC fm10k_common.o
  CC fm10k_mbx.o
  CC fm10k_vf.o
  CC fm10k_api.o
  INSTALL-LIB librte_pmd_lio.a
  CC ixgbe_dcb.o
  CC ixgbe_dcb_82599.o
  CC fm10k_rxtx_vec.o
  CC ark_pktgen.o
  CC ark_rqp.o
  CC base/vnic_dev.o
  CC ark_udm.o
  CC e1000_manage.o
  CC e1000_mbx.o
  CC i40e_nvm.o
  CC i40e_dcb.o
  CC i40e_ethdev.o
  SYMLINK-FILE include/rte_cryptodev_scheduler_operations.h
  SYMLINK-FILE include/rte_cryptodev_scheduler.h
  CC ixgbe_dcb_82598.o
  CC ixgbe_mbx.o
  CC base/vnic_intr.o
  CC e1000_nvm.o
  CC e1000_osdep.o
  AR librte_pmd_crypto_scheduler.a
  CC e1000_phy.o
  INSTALL-LIB librte_pmd_crypto_scheduler.a
  CC e1000_vf.o
  CC ixgbe_rxtx.o
  CC igb_ethdev.o
  CC igb_rxtx.o
  CC ixgbe_ethdev.o
  AR librte_pmd_ark.a
  INSTALL-LIB librte_pmd_ark.a
  CC igb_pf.o
  CC igb_flow.o
  CC em_ethdev.o
  CC i40e_rxtx.o
  CC em_rxtx.o
  AR librte_pmd_fm10k.a
  INSTALL-LIB librte_pmd_fm10k.a
  CC base/vnic_rq.o
  CC base/vnic_rss.o
  CC ixgbe_fdir.o
  CC i40e_rxtx_vec_sse.o
  CC i40e_ethdev_vf.o
  CC i40e_pf.o
  PMDINFO em_ethdev.o.pmd.c
  CC em_ethdev.o.pmd.o
  LD em_ethdev.o
  CC i40e_fdir.o
  AR librte_pmd_bond.a
  INSTALL-LIB librte_pmd_bond.a
  CC i40e_flow.o
  AR librte_pmd_enic.a
  INSTALL-LIB librte_pmd_enic.a
  CC rte_pmd_i40e.o
  AR librte_pmd_cxgbe.a
  CC i40e_tm.o
  INSTALL-LIB librte_pmd_cxgbe.a
  SYMLINK-FILE include/rte_pmd_i40e.h
  CC ixgbe_pf.o
  CC ixgbe_flow.o
  CC ixgbe_rxtx_vec_sse.o
  CC rte_pmd_ixgbe.o
  CC ixgbe_tm.o
  SYMLINK-FILE include/rte_pmd_ixgbe.h
  PMDINFO i40e_ethdev_vf.o.pmd.c
  CC i40e_ethdev_vf.o.pmd.o
  LD i40e_ethdev_vf.o
  PMDINFO igb_ethdev.o.pmd.c
  CC igb_ethdev.o.pmd.o
  LD igb_ethdev.o
  AR librte_pmd_e1000.a
  INSTALL-LIB librte_pmd_e1000.a
  PMDINFO ixgbe_ethdev.o.pmd.c
  CC ixgbe_ethdev.o.pmd.o
  LD ixgbe_ethdev.o
  AR librte_pmd_ixgbe.a
  INSTALL-LIB librte_pmd_ixgbe.a
  PMDINFO i40e_ethdev.o.pmd.c
  CC i40e_ethdev.o.pmd.o
  LD i40e_ethdev.o
  AR librte_pmd_i40e.a
  INSTALL-LIB librte_pmd_i40e.a
/home/vthape2/MoonGen/libmoon/deps/dpdk/mk/rte.subdir.mk:63: recipe for target 'net' failed
make[2]: *** [net] Error 2
/home/vthape2/MoonGen/libmoon/deps/dpdk/mk/rte.sdkbuild.mk:76: recipe for target 'drivers' failed
make[1]: *** [drivers] Error 2
/home/vthape2/MoonGen/libmoon/deps/dpdk/mk/rte.sdkroot.mk:128: recipe for target 'all' failed
make: *** [all] Error 2
make -C deps/http-parser library
make[1]: Entering directory '/home/vthape2/MoonGen/libmoon/lua/lib/turbo/deps/http-parser'
gcc  -shared -Wl,-soname=libhttp_parser.so.2.1 -o libhttp_parser.so.2.1 libhttp_parser.o
make[1]: Leaving directory '/home/vthape2/MoonGen/libmoon/lua/lib/turbo/deps/http-parser'
gcc -Ideps/http-parser/ -shared -O3 -Wall -g  -fPIC deps/http-parser/libhttp_parser.o deps/turbo_ffi_wrap.c -o libtffi_wrap.so  -lcrypto -lssl
make: Nothing to be done for 'all'.
-- Building Intel TBB: /usr/bin/make -j16 tbb_build_prefix=tbb_cmake_build_subdir tbb_build_dir=/home/vthape2/MoonGen/build/libmoon/tbb_cmake_build compiler=gcc
-- Configuring done
-- Generating done
-- Build files have been written to: /home/vthape2/MoonGen/build
Scanning dependencies of target moon
[ 24%] Building C object libmoon/CMakeFiles/moon.dir/src/memory.c.o
[ 31%] Building C object libmoon/CMakeFiles/moon.dir/src/device.c.o
[ 31%] Building C object libmoon/CMakeFiles/moon.dir/src/util.c.o
[ 41%] Building C object libmoon/CMakeFiles/moon.dir/src/ring.c.o
[ 41%] Building CXX object libmoon/CMakeFiles/moon.dir/src/lifecycle.cpp.o
[ 41%] Building C object libmoon/CMakeFiles/moon.dir/src/timestamping_i40e.c.o
[ 44%] Building C object libmoon/CMakeFiles/moon.dir/src/timestamping.c.o
[ 31%] Building C object libmoon/CMakeFiles/moon.dir/src/i40e.c.o
[ 44%] Building CXX object libmoon/CMakeFiles/moon.dir/src/pcap.cpp.o
[ 44%] Building C object libmoon/CMakeFiles/moon.dir/src/timestamping_ixgbe.c.o
[ 44%] Building C object libmoon/CMakeFiles/moon.dir/src/filter.c.o
[ 44%] Building C object libmoon/CMakeFiles/moon.dir/src/kni.c.o
[ 44%] Building C object libmoon/CMakeFiles/moon.dir/src/timestamping_igb.c.o
[ 48%] Linking CXX static library libmoon.a
[ 72%] Built target moon
Scanning dependencies of target MoonGen
[ 86%] Building C object CMakeFiles/MoonGen.dir/src/software-timestamping.c.o
[ 86%] Building CXX object CMakeFiles/MoonGen.dir/src/software-rate-limiter.cpp.o
[ 86%] Building C object CMakeFiles/MoonGen.dir/src/crc-rate-limiter.c.o
[ 86%] Building CXX object CMakeFiles/MoonGen.dir/src/moonsniff.cpp.o
[ 89%] Linking CXX executable MoonGen
/usr/bin/ld: cannot find -lrte_pmd_ring
/usr/bin/ld: cannot find -lrte_pmd_virtio
/usr/bin/ld: cannot find -lrte_pmd_vmxnet3_uio
/usr/bin/ld: cannot find -lrte_pmd_bnxt
/usr/bin/ld: cannot find -lrte_pmd_nfp
/usr/bin/ld: cannot find -lrte_pmd_mlx5
collect2: error: ld returned 1 exit status
CMakeFiles/MoonGen.dir/build.make:254: recipe for target 'MoonGen' failed
make[2]: *** [MoonGen] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/MoonGen.dir/all' failed
make[1]: *** [CMakeFiles/MoonGen.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2
Trying to bind interfaces, this will fail if you are not root
Try sudo ./bind-interfaces.sh if this step fails
Binding applicable NICs to mlx5_core
modprobe: ERROR: could not insert 'uio': Operation not permitted
insmod: ERROR: could not insert module ./x86_64-native-linuxapp-gcc/kmod/igb_uio.ko: Operation not permitted
Could not find any inactive interfaces to bind to DPDK. Note that this script does not bind interfaces that are in use by the OS.
Delete IP addresses from interfaces you would like to use with libmoon and run this script again.
You can also use the script dpdk-devbind.py in deps/dpdk/usertools manually to manage interfaces used by libmoon and the OS.
eweyulu commented 3 years ago

Hi there, I am having the same issue trying to build TAS and I get this error when I test DPDK with testpmd:

./testpmd: /usr/lib/libmlx5.so.1: no version information available (required by ./testpmd)

How did you solve your problem? DPDK version:19.11.2

Thanks