Please note that we removed support for Offloaded Traffic Sniffer feature, but we can suggest using the docker-container solution to use RDMA devices, in order to capture and analyze RDMA packets using tcpdump.
I got this errs when capture RoCE packets by docker:
root@test:/# tcpdump --version
tcpdump version 4.99.1
libpcap version 1.10.1 (with TPACKET_V3)
OpenSSL 3.0.2 15 Mar 2022
root@test:/# tcpdump -i mlx5_0
tcpdump: mlx5_0: No such device exists
(SIOCGIFHWADDR: No such device)
How can i solove this problem?
Depending on the type of RDMA card you have installed mlx5_0 may or may not be the correct device. Running “tcpdump -D” will show you the list of available interfaces to use with tcpdump. Look for those listed as “RDMA Sniffer”
If there are no interfaces with RDMA support and you do have an RDMA enabled card installed, then most likely the libpcap version you are using was not built with RDMA support.
For example libpcap version 1.10.1 installed with Ubuntu 22.04 does not enable RDMA support by default. If this is the case then recompiling libpcap using the --enable-rdma flag or finding a newer version that was compiled correctly should resolve the issue.