虚拟机使用脚本安装测试DPDK

来源:互联网 发布:c js混淆工具 编辑:程序博客网 时间:2024/06/05 07:12

虚拟机使用脚本安装测试DPDK

安装及测试详细过程请见大神的帖子:http://www.cnblogs.com/zzqcn/p/4024205.html。这里我只记录我遇到坑。

1、Display current Ethernet/Crypto device settings 显示网卡设置时报错

Traceback (most recent call last):  File "/home/clzfile/dpdk/usertools/dpdk-devbind.py", line 709, in <module>    main()  File "/home/clzfile/dpdk/usertools/dpdk-devbind.py", line 702, in main    get_device_details(network_devices)  File "/home/clzfile/dpdk/usertools/dpdk-devbind.py", line 274, in get_device_details    dev_lines = check_output(["lspci", "-Dvmmnnk"]).splitlines()  File "/home/clzfile/dpdk/usertools/dpdk-devbind.py", line 149, in check_output    stderr=stderr).communicate()[0]  File "/usr/lib64/python2.7/subprocess.py", line 711, in __init__    errread, errwrite)  File "/usr/lib64/python2.7/subprocess.py", line 1327, in _execute_child    raise child_exceptionOSError: [Errno 2] No such file or directory

感谢dpdk社区的大神:http://sysight.com/index.php?qa=347&qa_1=dpdk%E5%AE%89%E8%A3%85%E9%97%AE%E9%A2%98%EF%BC%8C%E6%9C%89%E5%85%B3-dpdk_nic_bind-py-status&show=347#q347
这是由于CentOS7中没有lspci的原因,安装一下就可以解决:yum install pciutils -y。

2、测试时Run testpmd application in interactive mode ($RTE_TARGET/app/testpmd)报错:

bitmask: fLaunching appEAL: Detected 2 lcore(s)EAL: lcore 2 unavailableEAL: invalid coremaskUsage: x86_64-native-linuxapp-gcc/app/testpmd [options]EAL common options:  -c COREMASK         Hexadecimal bitmask of cores to run on  -l CORELIST         List of cores to run on                      The argument format is <c1>[-c2][,c3[-c4],...]                      where c1, c2, etc are core indexes between 0 and 128  --lcores COREMAP    Map lcore set to physical cpu set                      The argument format is                            '<lcores[@cpus]>[<,lcores[@cpus]>...]'                      lcores and cpus list are grouped by '(' and ')'                      Within the group, '-' is used for range separator,                      ',' is used for single number separator.                      '( )' can be omitted for single element group,                      '@' can be omitted if cpus and lcores have the same value  --master-lcore ID   Core ID that is used as master  -n CHANNELS         Number of memory channels  -m MB               Memory to allocate (see also --socket-mem)  -r RANKS            Force number of memory ranks (don't detect)  -b, --pci-blacklist Add a PCI device in black list.                      Prevent EAL from using this PCI device. The argument                      format is <domain:bus:devid.func>.  -w, --pci-whitelist Add a PCI device in white list.                      Only use the specified PCI devices. The argument format                      is <[domain:]bus:devid.func>. This option can be present                      several times (once per device).                      [NOTE: PCI whitelist cannot be used with -b option]  --vdev              Add a virtual device.                      The argument format is <driver><id>[,key=val,...]                      (ex: --vdev=net_pcap0,iface=eth2).  -d LIB.so|DIR       Add a driver or driver directory                      (can be used multiple times)  --vmware-tsc-map    Use VMware TSC map instead of native RDTSC  --proc-type         Type of this process (primary|secondary|auto)  --syslog            Set syslog facility  --log-level=<int>   Set global log level  --log-level=<type-regexp>,<int>                      Set specific log level  -v                  Display version information on startup  -h, --help          This helpEAL options for DEBUG use only:  --huge-unlink       Unlink hugepage files after init  --no-huge           Use malloc instead of hugetlbfs  --no-pci            Disable PCI  --no-hpet           Disable HPET  --no-shconf         No shared config (mmap'd files)EAL Linux options:  --socket-mem        Memory to allocate on sockets (comma separated values)  --huge-dir          Directory where hugetlbfs is mounted  --file-prefix       Prefix for hugepage filenames  --base-virtaddr     Base virtual address  --create-uio-dev    Create /dev/uioX (usually done by hotplug)  --vfio-intr         Interrupt mode for VFIO (legacy|msi|msix)  --xen-dom0          Support running on Xen dom0 without hugetlbfsEAL: FATAL: Invalid 'command line' arguments.EAL: Invalid 'command line' arguments.PANIC in main():Cannot init EAL5: [x86_64-native-linuxapp-gcc/app/testpmd() [0x4552e1]]4: [/lib64/libc.so.6(__libc_start_main+0xf5) [0x7f3e7f5a6b15]]3: [x86_64-native-linuxapp-gcc/app/testpmd(main+0x5e9) [0x451469]]2: [x86_64-native-linuxapp-gcc/app/testpmd(__rte_panic+0xb0) [0x44a0d2]]1: [x86_64-native-linuxapp-gcc/app/testpmd(rte_dump_stack+0x1a) [0x4b9f3a]]

感谢大神解答:http://sysight.com/index.php?qa=510&qa_1=centos7-0%E7%B3%BB%E7%BB%9F%E4%BD%BF%E7%94%A8%E8%84%9A%E6%9C%AC%E8%BF%9B%E8%A1%8C%E5%AE%89%E8%A3%85%E6%B5%8B%E8%AF%95%EF%BC%8C%E4%BD%BF%E7%94%A8%E4%BA%A4%E4%BA%92%E6%A8%A1%E5%BC%8F%E8%BF%90%E8%A1%8C%E6%B5%8B%E8%AF%95%E7%A8%8B%E5%BA%8F%EF%BC%8C%E6%8A%A5%E9%94%99lcore-unavailable
只有两个CPU,掩码应该用3.

3、测试时Run testpmd application in interactive mode ($RTE_TARGET/app/testpmd)报错:

Interactive-mode selectedWarning: NUMA should be configured manually by using --port-numa-config and --ring-numa-config parameters along with --numa.USER1: create a new mbuf pool <mbuf_pool_socket_0>: n=155456, size=2176, socket=0EAL: Error - exiting with code: 1  Cause: Creation of mbuf pool for socket 0 failed: Cannot allocate memory

在社区中找到了解决方法:http://sysight.com/index.php?qa=39&qa_1=vmware%E6%90%AD%E5%BB%BAdpdk%E7%8E%AF%E5%A2%83%EF%BC%8C%E6%89%A7%E8%A1%8C-application-interactive-%24rte_target&show=39#q39
内存设置小了,将内存设置大一些,问题解决。

    本人dpdk新手,问题的解决主要依靠dpdk交流社区和其他大神的博客,在此引用,为他人也为自己留一个记录。如有侵权,请联系删除帖。

原创粉丝点击