虚拟机使用脚本安装测试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_exception
OSError: [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: f
Launching app
EAL: Detected 2 lcore(s)
EAL: lcore 2 unavailable
EAL: invalid coremask
Usage: 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 help
EAL 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 hugetlbfs
EAL: FATAL: Invalid 'command line' arguments.
EAL: Invalid 'command line' arguments.
PANIC in main():
Cannot init EAL
5: [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]]
3、测试时Run testpmd application in interactive mode ($RTE_TARGET/app/testpmd)报错:
Interactive-mode selected
Warning: 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=0
EAL: 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
内存设置小了,将内存设置大一些,问题解决