1. 环境搭建
编译过程及环境配置参考《Ubuntu16.04 虚拟机环境下搭建DPDK教程》。
2. 问题
(1) 运行testpmd程序报错"Input/output error"
Enter hex bitmask of cores to execute testpmd app on
Example: to execute app on cores 0 to 7, enter 0xff
bitmask: 3
Launching app
EAL: Detected 4 lcore(s)
EAL: Probing VFIO support...
EAL: NUMA support not available consider that all memory is in socket_id 0
EAL: PCI device 0000:02:01.0 on NUMA socket 0
EAL: probe driver: 8086:100f net_e1000_em
EAL: PCI device 0000:02:06.0 on NUMA socket 0
EAL: probe driver: 8086:100f net_e1000_em
EAL: Error reading from file descriptor 13: Input/output error
*** Error in `/home/walnut/Project/dpdk-stable-17.11.10/i686-native-linuxapp-gcc/app/testpmd': free(): invalid pointer: 0x96bb40c0 ***
EAL: PCI device 0000:02:07.0 on NUMA socket 0
EAL: PCI device 0000:02:07.0 on NUMA socket 0
./usertools/dpdk-setup.sh: line 406: 31770 Aborted (core dumped) sudo ${RTE_TARGET}/app/testpmd -c $Bitmask $EAL_PARAMS -- -i
解决方法:修改源文件lib/librte_eal/linuxapp/igb_uio/igb_uio.c
/* falls through - to INTX */
case RTE_INTR_MODE_LEGACY:
if (pci_intx_mask_supported(udev->pdev)) {
dev_dbg(&udev->pdev->dev, "using INTX");
udev->info.irq_flags = IRQF_SHARED | IRQF_NO_THREAD;
udev->info.irq = udev->pdev->irq;
udev->mode = RTE_INTR_MODE_LEGACY;
break;
}
dev_notice(&udev->pdev->dev, "PCI INTX mask not supported\n");
修改为:
/* falls through - to INTX */
case RTE_INTR_MODE_LEGACY:
if (true)) {
dev_dbg(&udev->pdev->dev, "using INTX");
udev->info.irq_flags = IRQF_SHARED | IRQF_NO_THREAD;
udev->info.irq = udev->pdev->irq;
udev->mode = RTE_INTR_MODE_LEGACY;
break;
}
dev_notice(&udev->pdev->dev, "PCI INTX mask not supported\n");
(2)运行testpmd程序报错 "Cannot allocate memory"
Enter hex bitmask of cores to execute testpmd app on
Example: to execute app on cores 0 to 7, enter 0xff
bitmask: 3
Launching app
EAL: Detected 4 lcore(s)
EAL: Probing VFIO support...
EAL: NUMA support not available consider that all memory is in socket_id 0
EAL: PCI device 0000:02:01.0 on NUMA socket 0
EAL: probe driver: 8086:100f net_e1000_em
EAL: PCI device 0000:02:06.0 on NUMA socket 0
EAL: probe driver: 8086:100f net_e1000_em
EAL: PCI device 0000:02:07.0 on NUMA socket 0
EAL: probe driver: 8086:100f net_e1000_em
Interactive-mode selected
USER1: create a new mbuf pool <mbuf_pool_socket_0>: n=155456, size=2176, socket=0
RING: Cannot reserve memory for tailq
EAL: Error - exiting with code: 1
Cause: Creation of mbuf pool for socket 0 failed: Cannot allocate memory
解决方法:修改大页内存page数量,如由64修改为256。