DPDK Compilation Error When Building igb_uio

巧了我就是萌 提交于 2020-03-21 20:03:12

问题


I am trying to test out the DPDK sample applications in a CentOS 6.4 VM running under KVM, but I can't get DPDK to compile.

When trying to run

make install T=x86_64-default-linuxapp-gcc -n

from DPDK-2.0.0, I get the following output:

[...]    
make S=lib/librte_eal/linuxapp -f /home/dpdk-1.6.0r2/lib/librte_eal/linuxapp/Makefile -C /home/dpdk-1.6.0r2/x86_64-default-linuxapp-gcc/build/lib/librte_eal/linuxapp all
[ -d /home/dpdk-1.6.0r2/x86_64-default-linuxapp-gcc/build/lib/librte_eal/linuxapp/igb_uio ] || mkdir -p /home/dpdk-1.6.0r2/x86_64-default-linuxapp-gcc/build/lib/librte_eal/linuxapp/igb_uio
echo "== Build lib/librte_eal/linuxapp/igb_uio"
make S=lib/librte_eal/linuxapp/igb_uio -f /home/dpdk-1.6.0r2/lib/librte_eal/linuxapp/igb_uio/Makefile -C /home/dpdk-1.6.0r2/x86_64-default-linuxapp-gcc/build/lib/librte_eal/linuxapp/igb_uio all
if [ ! -f igb_uio.c ]; then ln -nfs /home/dpdk-1.6.0r2/lib/librte_eal/linuxapp/igb_uio/igb_uio.c . ; fi
if [ ! -f Makefile ]; then ln -nfs /home/dpdk-1.6.0r2/lib/librte_eal/linuxapp/igb_uio/Makefile . ; fi
make -C /lib/modules/2.6.32-358.el6.x86_64/build M=/home/dpdk-1.6.0r2/x86_64-default-linuxapp-gcc/build/lib/librte_eal/linuxapp/igb_uio O=/lib/modules/2.6.32-358.el6.x86_64/build \
CROSS_COMPILE=
make: *** /lib/modules/2.6.32-358.el6.x86_64/build: No such file or directory.  Stop.
make[7]: *** [igb_uio.ko] Error 2
make[6]: *** [igb_uio] Error 2
make[5]: *** [linuxapp] Error 2
make[4]: *** [librte_eal] Error 2
make[3]: *** [lib] Error 2
make[2]: *** [all] Error 2
make[1]: *** [x86_64-native-linuxapp-gcc_install] Error 2
make: *** [install] Error 2

I've installed all the required packages specified here:

http://dpdk.org/doc/guides/linux_gsg/sys_reqs.html

and I've seen and attempted the solution here:

Intel DPDK Compilation Error

The issue appears for both DPDK2-0.0 and 1.6.0.

Also, just to make sure; running

ls /lib/modules/2.6.32-358.el6.x86_64/build

returns output:

/lib/modules/2.6.32-358.el6.x86_64/build

so the directory definitely exists..

I've managed to compile DPDK in a CentOS 6.6 KVM on the same host without issue, but this time around I keep getting this error.

Also it does need to be CentOS 6.4, sadly.

Update:

Added verbose output above ^


回答1:


Just solved it:

I was using kernel version 2.6.32-358.el6.x86_64, and I had to update to version 2.6.32-504.23.4.el6.x86_64 to get rid of this error.

Additionally, I ran into another error after this which included the line

previous definition of ‘skb_set_hash’ was here

This happened because of an issue with the DPDK version I was using (1.6) Trying 2.0 fixed this.

Then I got the following error when running any of the module-related options of the setup.sh script:

Traceback (most recent call last):
  File "tools/dpdk_nic_bind.py", line 536, in <module>
    main()
  File "tools/dpdk_nic_bind.py", line 532, in main
    get_nic_details()
  File "tools/dpdk_nic_bind.py", line 225, in get_nic_details
    dev_lines = check_output(["lspci", "-Dvmmn"]).splitlines()
  File "tools/dpdk_nic_bind.py", line 120, in check_output
    stderr=stderr).communicate()[0]
  File "/usr/lib64/python2.6/subprocess.py", line 642, in __init__
    errread, errwrite)
  File "/usr/lib64/python2.6/subprocess.py", line 1234, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory

THIS error was because I didn't have pciutils installed and the script couldn't find lspci.

Hope this helps anyone else with the same issues.




回答2:


When compiling the DPDK, you suppose to have dependency packages and besides that you must have kernel headers of the same kernel version. If you don't install kernel headers then "/lib/modules/your-kernel-version/build" folder is invalid otherwise it is valid.



来源:https://stackoverflow.com/questions/31271227/dpdk-compilation-error-when-building-igb-uio

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!