sdnfv / openNetVM

A high performance container-based NFV platform from GW and UCR.
http://sdnfv.github.io/onvm/
Other
263 stars 136 forks source link

Error while running DPDK HelloWorld Application #162

Closed Chenwh93 closed 4 years ago

Chenwh93 commented 4 years ago

Hi, I was trying to install OpenNetVM on my Ubuntu server (Ubuntu version: Ubuntu server 18.04, Linux kernel version: 4.15.0-64-generic).

After I configured and compiled DPDK according to the steps in openNetVM Installation, I try to run the DPDK HelloWorld Application in "/dpdk/examples/helloworld"

The command is "sudo ./build/helloworld -l 0,1 -n 1", then there is a problem, details are shown as following:

EAL: Detected 12 lcore(s) EAL: Detected 2 NUMA nodes EAL: Multi-process socket /var/run/dpdk/rte/mp_socket EAL: No free hugepages reported in hugepages-1048576kB EAL: Probing VFIO support... set_mempolicy: Invalid argument set_mempolicy: Invalid argument EAL: PCI device 0000:04:00.0 on NUMA socket 0 EAL: probe driver: 8086:10fb net_ixgbe set_mempolicy: Invalid argument set_mempolicy: Invalid argument set_mempolicy: Invalid argument set_mempolicy: Invalid argument PANIC in rte_eth_dev_shared_data_prepare(): Cannot allocate ethdev shared data 13: [./build/helloworld(_start+0x2a) [0x5555555ee9aa]] 12: [/lib/x86_64-linux-gnu/libc.so.6(libc_start_main+0xe7) [0x7ffff6e31b97]] 11: [./build/helloworld(main+0xb) [0x5555555e52fb]] 10: [./build/helloworld(rte_eal_init+0x1437) [0x5555556d3f57]] 9: [./build/helloworld(rte_bus_probe+0x4a) [0x5555556e91ca]] 8: [./build/helloworld(rte_pci_probe+0x10c) [0x55555571324c]] 7: [./build/helloworld(+0x1bf0b5) [0x5555557130b5]] 6: [./build/helloworld(+0x3dc49d) [0x55555593049d]] 5: [./build/helloworld(rte_eth_dev_create+0x42) [0x5555556a2d12]] 4: [./build/helloworld(rte_eth_dev_allocate+0x12) [0x555555696992]] 3: [./build/helloworld(+0x141540) [0x555555695540]] 2: [./build/helloworld(rte_panic+0xc5) [0x5555555d59b9]] 1: [./build/helloworld(rte_dump_stack+0x2e) [0x5555556e066e]] Aborted

It would be great if anyone could help me with the problem. Thanks!

twood02 commented 4 years ago

It looks like the root of your issue is EAL: No free hugepages reported in hugepages-1048576kB This means you don't have huge pages setup correctly. Be sure that you have run the scripts/setup_environment.sh script (you need to do this after each reboot) and verify that the message Huge pages successfully configured shows up.

That setup script calls into this file which does the reservation, so you might look at the debug output there to track down any issues.

Chenwh93 commented 4 years ago

Thanks for your advice! I have tried to run scripts/setup_environment.sh, and the log shows:

Setting up hugepages Removing currently reserved hugepages .echo_tmp: 2: .echo_tmp: cannot create /sys/devices/system/node/node0/hugepages/hugepages-2048kB/nr_hugepages: Directory nonexistent Unmounting /mnt/huge and removing directory Reserving hugepages .echo_tmp: 2: .echo_tmp: cannot create /sys/devices/system/node/node0/hugepages/hugepages-2048kB/nr_hugepages: Directory nonexistent Creating /mnt/huge and mounting as hugetlbfs Huge pages successfully configured

But DPDK helloworld application still not work, it shows the same bug log:

EAL: Detected 12 lcore(s) EAL: Detected 2 NUMA nodes EAL: Multi-process socket /var/run/dpdk/rte/mp_socket EAL: No free hugepages reported in hugepages-1048576kB EAL: Probing VFIO support... set_mempolicy: Invalid argument set_mempolicy: Invalid argument EAL: PCI device 0000:04:00.0 on NUMA socket 0 EAL: probe driver: 8086:10fb net_ixgbe set_mempolicy: Invalid argument set_mempolicy: Invalid argument set_mempolicy: Invalid argument set_mempolicy: Invalid argument PANIC in rte_eth_dev_shared_data_prepare(): Cannot allocate ethdev shared data 13: [./build/helloworld(_start+0x2a) [0x5555555ee9aa]] 12: [/lib/x86_64-linux-gnu/libc.so.6(libc_start_main+0xe7) [0x7ffff6e31b97]] 11: [./build/helloworld(main+0xb) [0x5555555e52fb]] 10: [./build/helloworld(rte_eal_init+0x1437) [0x5555556d3f57]] 9: [./build/helloworld(rte_bus_probe+0x4a) [0x5555556e91ca]] 8: [./build/helloworld(rte_pci_probe+0x10c) [0x55555571324c]] 7: [./build/helloworld(+0x1bf0b5) [0x5555557130b5]] 6: [./build/helloworld(+0x3dc49d) [0x55555593049d]] 5: [./build/helloworld(rte_eth_dev_create+0x42) [0x5555556a2d12]] 4: [./build/helloworld(rte_eth_dev_allocate+0x12) [0x555555696992]] 3: [./build/helloworld(+0x141540) [0x555555695540]] 2: [./build/helloworld(rte_panic+0xc5) [0x5555555d59b9]] 1: [./build/helloworld(rte_dump_stack+0x2e) [0x5555556e066e]] Aborted

Then I check the file you mentioned, I find the command will traverse /sys/devices/system/node . I check these folders on my system, there is no hugepage folder in node0, but in node1 , there are two hugepage folders.

root@ubuntu:/sys/devices/system/node# cd node0 root@ubuntu:/sys/devices/system/node/node0# ls compact cpu0 cpu10 cpu12 cpu14 cpu16 cpu18 cpu2 cpu20 cpu22 cpu4 cpu6 cpu8 cpulist cpumap distance meminfo numastat power subsystem uevent vmstat root@ubuntu:/sys/devices/system/node/node1# cd hugepages/ root@ubuntu:/sys/devices/system/node/node1/hugepages# ls hugepages-1048576kB hugepages-2048kB

I think hugepages-1048576kB leads to the problem,because there is no free hugepage in it. Actually, I don‘t want to use it (hugepages-2048kB should be used), but I can't remove it (Operation not permitted). And about there is no hugepage folder in /sys/devices/system/node/node0, I'm not sure it is normal.

I will try to handle the problem about /sys/devices/system/node/node0, hope you can give me some other advice. Thanks!

twood02 commented 4 years ago

If you want to force a particular size you could try hard coding in the value here: https://github.com/sdnfv/openNetVM/blob/master/scripts/dpdk_helper_scripts.sh#L3

It seems your system has multiple sizes configured and that is confusing our script.

Chenwh93 commented 4 years ago

I think I have solved the problem. It could be caused by a misconfiguration in /sys/devices/system/node/node0 (because it has no hugepage configuration).

After I reinstall the ubuntu system, there are only node1 in /sys/devices/system/node, and it has hugepage configuration folder. This time, the DPDK Helloworld Application can run correctly.

Thanks a lot for your help! :)