appneta / tcpreplay

Pcap editing and replay tools for *NIX and Windows - Users please download source from
http://tcpreplay.appneta.com/wiki/installation.html#downloads
1.15k stars 268 forks source link

[Bug] Failed to use netmap, `nm_do_ioctl: No such file or directory` #810

Open duskmoon314 opened 1 year ago

duskmoon314 commented 1 year ago

Describe the bug

I'm trying to use tcpreplay with netmap enabled on a Ubuntu 22.04 machine with Intel 82599ES. After building netmap (master with ixgbe:5.18.11) and tcpreplay 4.4.4, I failed to switch the network driver to netmap bypass mode because of the nm_do_ioctl: No such file or directory

It seems I cannot build netmap on Ubuntu 22.04 successfully with an older version (v11, v13) so I use the master branch. The version of ixgbe is the latest one in netmap/LINUX/final-patches that I can build successfully.

To Reproduce` Steps to reproduce the behavior:

  1. Clone netmap to ~/Documents/netmap; Clone tcpreplay to ~/Documents/tcpreplay
  2. Build netmap with: ./configure --no-drivers=virtio_net.c --driver-suffix=-netmap --select-version=ixgbe:5.18.11 && make -j && sudo make install
  3. Build tcpreplay with: ./configure --with-netmap=~/Documents/netmap && make -j && sudo make install
  4. sudo tcpreplay -i enp1s0f1 --netmap dataset/202006101400.pcap
  5. Get the error:
    Switching network driver for enp1s0f1 to netmap bypass mode... failed!
    Switching network driver for enp1s0f1 to normal mode... 
    Fatal Error: failed to open device enp1s0f1: nm_do_ioctl: No such file or directory

Expected behavior I want to use tcpreplay with netmap to send packets as in normal mode (without --netmap).

Screenshots

image

System (please complete the following information):

Additional context ~I haven't figured out how to let tcpreplay show more information about the failure.~ Please give me some advice to find out how to provide more information and solve this problem.

I rebuild tcpreplay with debug output enabled. And the output is:

> sudo tcpreplay -i enp1s0f1 --netmap -d 1 dataset/202006101400.pcap 
DEBUG1 in netmap.c:sendpacket_open_netmap() line 192: sendpacket_open_netmap: using netmap
DEBUG1 in netmap.c:get_netmap_version() line 56: netmap detected API version 14 which matches compiled version

Switching network driver for enp1s0f1 to netmap bypass mode... DEBUG1 in netmap.c:sendpacket_open_netmap() line 369: sendpacket_open_netmap: mapping 334980 Kbytes queues=4
DEBUG1 in netmap.c:sendpacket_open_netmap() line 411: enp1s0f1 tx first=0 last=0  num=4
DEBUG1 in netmap.c:sendpacket_open_netmap() line 414: TX0 0x0x7fca2928e000 head=0 cur=0 tail=511
DEBUG1 in netmap.c:sendpacket_open_netmap() line 414: TX1 0x0x7fca29297000 head=0 cur=0 tail=511
DEBUG1 in netmap.c:sendpacket_open_netmap() line 414: TX2 0x0x7fca292a0000 head=0 cur=0 tail=511
DEBUG1 in netmap.c:sendpacket_open_netmap() line 414: TX3 0x0x7fca292a9000 head=0 cur=0 tail=511
DEBUG1 in netmap.c:sendpacket_open_netmap() line 414: TX4 0x0x7fca29251000 head=0 cur=4 tail=4
DEBUG1 in netmap.c:nm_do_ioctl() line 130: SIOCGIFFLAGS flags are 0x11431143
failed!
 Switching network driver for enp1s0f1 to normal mode... 
Fatal Error in sendpacket.c:sendpacket_open() line 551:
 failed to open device enp1s0f1: nm_do_ioctl: No such file or directory
duskmoon314 commented 1 year ago

I downgrade to v4.4.2, and it works fine. Maybe some changes between these two versions cause the problem.