Dpdk suricata get an error: no such device

Hi:
I want to install suricata with dpdk on a machine other than my compiling environment. I am using dpdk-21.11.5.tar.xz and suricata-7.0.2.tar.gz.
It runs well in my compiling environment, an then I made a tar.gz, and install it on another machine, and I get an error:

E: dpdk: Interface “0000:02:02.0”: No such device

dpdk-testpmd can run well:

[root@bogon bin]# ./dpdk-testpmd – --forward-mode=rxonly -i
EAL: Detected CPU lcores: 2
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: No available 1048576 kB hugepages reported
EAL: Probe PCI driver: net_e1000_em (8086:100f) device: 0000:02:02.0 (socket 0)
EAL: Error reading from file descriptor 19: Input/output error
Set rxonly packet forwarding mode
Interactive-mode selected
testpmd: create a new mbuf pool <mb_pool_0>: n=155456, size=2176, socket=0
testpmd: preferred mempool ops selected: ring_mp_mc

Warning! port-topology=paired and odd forward ports number, the last port will pair with itself.

Configuring Port 0 (socket 0)
EAL: Error enabling interrupts for fd 19 (Input/output error)
Port 0: 00:0C:29:CE:18:C5
Checking link statuses…
Done
testpmd> start
rxonly packet forwarding - ports=1 - cores=1 - streams=1 - NUMA support enabled, MP allocation mode: native
Logical Core 1 (socket 0) forwards packets on 1 streams:
RX P=0/Q=0 (socket 0) → TX P=0/Q=0 (socket 0) peer=02:00:00:00:00:00

I build dpdk using:

meson -Dprefix=/usr/local/dpdk -Dexamples=all -Dplatform=generic build

and configure suricata using:

./configure --enable-dpdk --enable-pfring --enable-lua

ldd suricata is as follow:

[root@bogon bin]# ldd suricata
linux-vdso.so.1 (0x00007ffec8ca1000)
libhtp.so.2 => /root/suricata-install//lib/libhtp.so.2 (0x00007f1ce3a00000)
liblz4.so.1 => /lib64/liblz4.so.1 (0x00007f1ce3600000)
libmagic.so.1 => /lib64/libmagic.so.1 (0x00007f1ce3200000)
libunwind.so.8 => /root/suricata-install//lib/libunwind.so.8 (0x00007f1ce2e00000)
libcap-ng.so.0 => /lib64/libcap-ng.so.0 (0x00007f1ce2a00000)
libpfring.so.8 => /root/suricata-install//lib/libpfring.so.8 (0x00007f1ce2600000)
libnet.so.1 => /root/suricata-install//lib/libnet.so.1 (0x00007f1ce2200000)
libjansson.so.4 => /lib64/libjansson.so.4 (0x00007f1ce1e00000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f1ce1a00000)
libyaml-0.so.2 => /root/suricata-install//lib/libyaml-0.so.2 (0x00007f1ce1600000)
libpcre2-8.so.0 => /lib64/libpcre2-8.so.0 (0x00007f1ce1200000)
libz.so.1 => /lib64/libz.so.1 (0x00007f1ce0e00000)
libpcap.so.1 => /lib64/libpcap.so.1 (0x00007f1ce0a00000)
libnuma.so.1 => /lib64/libnuma.so.1 (0x00007f1ce0600000)
librte_ethdev.so.22 => /root/suricata-install//dpdk/lib64/librte_ethdev.so.22 (0x00007f1ce0200000)
librte_mbuf.so.22 => /root/suricata-install//dpdk/lib64/librte_mbuf.so.22 (0x00007f1cdfe00000)
librte_mempool.so.22 => /root/suricata-install//dpdk/lib64/librte_mempool.so.22 (0x00007f1cdfa00000)
librte_eal.so.22 => /root/suricata-install//dpdk/lib64/librte_eal.so.22 (0x00007f1cdf600000)
liblua-5.3.so => /lib64/liblua-5.3.so (0x00007f1cdf200000)
libm.so.6 => /lib64/libm.so.6 (0x00007f1cdee00000)
libdl.so.2 => /lib64/libdl.so.2 (0x00007f1cdea00000)
libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007f1cde600000)
libc.so.6 => /lib64/libc.so.6 (0x00007f1cde200000)
/lib64/ld-linux-x86-64.so.2 (0x00007f1ce3c63000)
librt.so.1 => /lib64/librt.so.1 (0x00007f1cdde00000)
libibverbs.so.1 => /lib64/libibverbs.so.1 (0x00007f1cdda00000)
librte_kvargs.so.22 => /root/suricata-install//dpdk/lib64/librte_kvargs.so.22 (0x00007f1cdd600000)
librte_telemetry.so.22 => /root/suricata-install//dpdk/lib64/librte_telemetry.so.22 (0x00007f1cdd200000)
librte_net.so.22 => /root/suricata-install//dpdk/lib64/librte_net.so.22 (0x00007f1cdce00000)
librte_ring.so.22 => /root/suricata-install//dpdk/lib64/librte_ring.so.22 (0x00007f1cdca00000)
librte_meter.so.22 => /root/suricata-install//dpdk/lib64/librte_meter.so.22 (0x00007f1cdc600000)
libnl-route-3.so.200 => /lib64/libnl-route-3.so.200 (0x00007f1cdc200000)
libnl-3.so.200 => /lib64/libnl-3.so.200 (0x00007f1cdbe00000)

I have no idea what is wrong with it.

Can anyone help me? Thanks very much.

If I put the dpdk directory to /usr/local, which is the directory that meson build used:

meson -Dprefix=/usr/local/dpdk -Dexamples=all -Dplatform=generic build

meanwhile change the LD_LIBRARY_PATH to /usr/local/dpdk/lib64, it will run well.

But I want to put the whole things to my own directory, not /usr/local/dpdk.

Hi there,

I believe you’ve pasted ldd output of the machine where you compiled Suricata. Try that on your target machine as well.

Maybe LD_PRELOAD / LD_LIBRARY_PATH bash environment variables could help. You need to be sure that Suricata finds those dynamic libraries.
To do it without these variables you need to configure your system to ensure that it searches the directory where you installed your DPDK.

Possibly something like this:

echo "/home/local/user/dpdk/usr/lib" | sudo tee /etc/ld.so.conf.d/custom_dpdk.conf
sudo ldconfig

Lukas

Thank you for your help.
I am sure it is the ldd result of my installed machine. The librte_** libraries are in /root/suricata-install//dpdk/lib64 directory, which is my installed path.

The follow if the ldd result of my compiling machine:

[root@localhost bin]# ldd suricata
linux-vdso.so.1 (0x00007ffd2cb7b000)
libhtp.so.2 => /usr/local/lib/libhtp.so.2 (0x00007f0f34a00000)
liblz4.so.1 => /lib64/liblz4.so.1 (0x00007f0f34600000)
libmagic.so.1 => /lib64/libmagic.so.1 (0x00007f0f34200000)
libunwind.so.8 => /usr/local/lib/libunwind.so.8 (0x00007f0f33e00000)
libcap-ng.so.0 => /lib64/libcap-ng.so.0 (0x00007f0f33a00000)
libpfring.so.8 => /usr/local/lib/libpfring.so.8 (0x00007f0f33600000)
libnet.so.1 => /lib64/libnet.so.1 (0x00007f0f33200000)
libjansson.so.4 => /lib64/libjansson.so.4 (0x00007f0f32e00000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f0f32a00000)
libyaml-0.so.2 => /lib64/libyaml-0.so.2 (0x00007f0f32600000)
libpcre2-8.so.0 => /lib64/libpcre2-8.so.0 (0x00007f0f32200000)
libz.so.1 => /lib64/libz.so.1 (0x00007f0f31e00000)
libpcap.so.1 => /lib64/libpcap.so.1 (0x00007f0f31a00000)
libnuma.so.1 => /lib64/libnuma.so.1 (0x00007f0f31600000)
librte_ethdev.so.22 => /usr/local/dpdk/lib64/librte_ethdev.so.22 (0x00007f0f31200000)
librte_mbuf.so.22 => /usr/local/dpdk/lib64/librte_mbuf.so.22 (0x00007f0f30e00000)
librte_mempool.so.22 => /usr/local/dpdk/lib64/librte_mempool.so.22 (0x00007f0f30a00000)
librte_eal.so.22 => /usr/local/dpdk/lib64/librte_eal.so.22 (0x00007f0f30600000)
liblua-5.3.so => /lib64/liblua-5.3.so (0x00007f0f30200000)
libm.so.6 => /lib64/libm.so.6 (0x00007f0f2fe00000)
libdl.so.2 => /lib64/libdl.so.2 (0x00007f0f2fa00000)
libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007f0f2f600000)
libc.so.6 => /lib64/libc.so.6 (0x00007f0f2f200000)
/lib64/ld-linux-x86-64.so.2 (0x00007f0f34ccb000)
librt.so.1 => /lib64/librt.so.1 (0x00007f0f2ee00000)
libibverbs.so.1 => /lib64/libibverbs.so.1 (0x00007f0f2ea00000)
librte_kvargs.so.22 => /usr/local/dpdk/lib64/librte_kvargs.so.22 (0x00007f0f2e600000)
librte_telemetry.so.22 => /usr/local/dpdk/lib64/librte_telemetry.so.22 (0x00007f0f2e200000)
librte_net.so.22 => /usr/local/dpdk/lib64/librte_net.so.22 (0x00007f0f2de00000)
librte_ring.so.22 => /usr/local/dpdk/lib64/librte_ring.so.22 (0x00007f0f2da00000)
librte_meter.so.22 => /usr/local/dpdk/lib64/librte_meter.so.22 (0x00007f0f2d600000)
libnl-route-3.so.200 => /lib64/libnl-route-3.so.200 (0x00007f0f2d200000)
libnl-3.so.200 => /lib64/libnl-3.so.200 (0x00007f0f2ce00000)
in my compiling machine, the librte_** libraries are in /usr/local/dpdk/lib64/, which is meson build used.

I have configured LD_LIBRARY_PATH on my installed machine, and I am sure suricata can find the dpdk libraries.
But, it just can’t work.

I see this as a Suricata-independent problem.
Is it possible that you are running Suricata as a different user than what you are running ldd command with?

I am using root as the only user. In suricata.yaml, I do not configure “run-as”,so suricata is running as root.