tbarbette / fastclick

FastClick - A faster version of the Click Modular Router featuring batching, advanced multi-processing and improved Netmap and DPDK support (ANCS'15). Check the metron branch for Metron specificities (NSDI'18). PacketMill modifications (ASPLOS'21) as well as MiddleClick(ToN, 2021) are merged in main.
Other
279 stars 81 forks source link

Illegal instruction (core dumped) when using ToDPDKDevice() #358

Closed hyoukaLaw closed 2 months ago

hyoukaLaw commented 2 years ago

I try to run the following .click FromDPDKDevice(0) -> CheckIPHeader(OFFSET 14) -> Print(in) -> ToDPDKDevice(1); with the following command sudo bin/click --dpdk -c 0xf -n 4 -- example.click

It can run successfully, however, as soon as a packet is received and processed, it meets core dump: `EAL: Detected 12 lcore(s)

EAL: Detected 1 NUMA nodes

EAL: Multi-process socket /var/run/dpdk/rte/mp_socket

EAL: Selected IOVA mode 'PA'

EAL: No available hugepages reported in hugepages-1048576kB

EAL: Probing VFIO support...

EAL: PCI device 0000:03:00.0 on NUMA socket 0

EAL: probe driver: 15b3:1007 net_mlx4

EAL: PCI device 0000:06:00.0 on NUMA socket -1

EAL: Invalid NUMA socket, default to 0

EAL: probe driver: 8086:1521 net_e1000_igb

EAL: PCI device 0000:06:00.1 on NUMA socket -1

EAL: Invalid NUMA socket, default to 0

EAL: probe driver: 8086:1521 net_e1000_igb

Initializing DPDK

in: 57 | e41d2d71 1421d4ae 52aa3c68 08004500 002b0001 00004006

Illegal instruction (core dumped)`

I run click on Ubuntu 16.04, and the version of DPDK is 19.08 Anyone can help? Thanks.

tbarbette commented 2 years ago

Hi! This means the CPU tried to execute an instruction it does not know about. Probably, DPDK (and/or) fastclick were compiled on a different machine that has a newer instruction set? By default DPDK will use -march=native, and this will be propagated to fastclick. The easiest is to re-compile both on the machine where it will be used. Else, check how to force a specific target with DPDK, and configure Click with --enable-portable-binary :)

hyoukaLaw commented 2 years ago

Hi! This means the CPU tried to execute an instruction it does not know about. Probably, DPDK (and/or) fastclick were compiled on a different machine that has a newer instruction set? By default DPDK will use -march=native, and this will be propagated to fastclick. The easiest is to re-compile both on the machine where it will be used. Else, check how to force a specific target with DPDK, and configure Click with --enable-portable-binary :)

Thanks for your reply! In fact the machine I compile fastclick is the same as the machine I use fastclick. I try configuring fastclick with --enable-portable-binary. But the problem still exists. I debug the .click conf file, and find that the problem only exists when the packet is sent to ToDPDKDevice element. The click can work when I use ToDevice element. So strange.

tbarbette commented 2 months ago

I'm closing this as it was probably due to a DPDK version built above the current target. Else please reopen witha GDB stacktrace and with Click built using "CXXFLAGS=-Og -g" in /configure