欢迎来到 DPDK交流社区 ,有什么问题可以尽管在这里提问,您将会收到社区其他成员的回答;也可以将您的总结写在这里,为社区其他成员提供帮助。 (QQ交流群:127163755)

虚拟机运行l3fwd出错!

+1 投票
虚拟机下l2fwd课成功运行。但是l3fwd却运行不了,试了好多机子,这是一个共性的问题,运行配置是参考dpdk官网上面的。
最新提问 8月 20, 2015 分类:DPDK sample解惑 | 用户: 风继续吹 (130 分)

3 个回答

0 投票
报错信息及你如何运行程序的请贴一下
最新回答 8月 21, 2015 用户: oops (2,160 分)
报错信息:
EAL: Detected lcore 0 as core 0 on socket 0
EAL: Detected lcore 1 as core 1 on socket 0
EAL: Detected lcore 2 as core 2 on socket 0
EAL: Detected lcore 3 as core 3 on socket 0
EAL: Detected lcore 4 as core 0 on socket 0
EAL: Detected lcore 5 as core 1 on socket 0
EAL: Detected lcore 6 as core 2 on socket 0
EAL: Detected lcore 7 as core 3 on socket 0
EAL: Support maximum 128 logical core(s) by configuration.
EAL: Detected 8 lcore(s)
EAL: VFIO modules not all loaded, skip VFIO support...
EAL: Setting up physically contiguous memory...
EAL: Ask a virtual area of 0x200000 bytes
EAL: Virtual area found at 0x7fd02a400000 (size = 0x200000)
EAL: Ask a virtual area of 0x1c800000 bytes
EAL: Virtual area found at 0x7fd00da00000 (size = 0x1c800000)
EAL: Ask a virtual area of 0x46c00000 bytes
EAL: Virtual area found at 0x7fcfc6c00000 (size = 0x46c00000)
EAL: Ask a virtual area of 0x200000 bytes
EAL: Virtual area found at 0x7fcfc6800000 (size = 0x200000)
EAL: Ask a virtual area of 0x200000 bytes
EAL: Virtual area found at 0x7fcfc6400000 (size = 0x200000)
EAL: Ask a virtual area of 0x1c400000 bytes
EAL: Virtual area found at 0x7fcfa9e00000 (size = 0x1c400000)
EAL: Ask a virtual area of 0x200000 bytes
EAL: Virtual area found at 0x7fcfa9a00000 (size = 0x200000)
EAL: Requesting 1024 pages of size 2MB from socket 0
EAL: TSC frequency is ~3392201 KHz
EAL: Master lcore 0 is ready (tid=2c5c6940;cpuset=[0])
EAL: lcore 6 is ready (tid=a71fa700;cpuset=[6])
EAL: lcore 7 is ready (tid=a69f9700;cpuset=[7])
EAL: lcore 4 is ready (tid=a81fc700;cpuset=[4])
EAL: lcore 1 is ready (tid=a99ff700;cpuset=[1])
EAL: lcore 5 is ready (tid=a79fb700;cpuset=[5])
EAL: lcore 2 is ready (tid=a91fe700;cpuset=[2])
EAL: lcore 3 is ready (tid=a89fd700;cpuset=[3])
EAL: PCI device 0000:02:01.0 on NUMA socket -1
EAL:   probe driver: 8086:100f rte_em_pmd
EAL:   PCI memory mapped at 0x7fd02a600000
EAL:   PCI memory mapped at 0x7fd02a620000
PMD: eth_em_dev_init(): port_id 0 vendorID=0x8086 deviceID=0x100f
EAL: PCI device 0000:02:05.0 on NUMA socket -1
EAL:   probe driver: 8086:100f rte_em_pmd
EAL:   PCI memory mapped at 0x7fd02a630000
EAL:   PCI memory mapped at 0x7fd02a650000
PMD: eth_em_dev_init(): port_id 1 vendorID=0x8086 deviceID=0x100f
EAL: PCI device 0000:02:06.0 on NUMA socket -1
EAL:   probe driver: 8086:100f rte_em_pmd
EAL:   Not managed by a supported kernel driver, skipped
EAL: PCI device 0000:02:07.0 on NUMA socket -1
EAL:   probe driver: 8086:100f rte_em_pmd
EAL:   Not managed by a supported kernel driver, skipped
Promiscuous mode selected
Initializing port 0 ... Creating queues: nb_rxq=1 nb_txq=8... EAL: Error - exiting with code: 1
  Cause: Cannot configure device: err=-22, port=0

我试了好多虚拟机下都不能运行,但是硬盘下可以。请问你有遇到过这种情况么?
注:l2fwd是可以正常运行的
./l3fwd -c 0xf -n 4 -- -p 3 --config '(0,0,0),(1,0,1)'
我的环境是82599 双口万兆,e3-1231 4核CPU,你试试这样看看
不知道楼主是否解决了这个问题?
在群里问大神,说是网卡不支持多队列,基于此有两种解决方法:一、虚拟机下换v-box听说可以;二、直接装硬盘上双系统
+1 投票
Which virtual machine test l3fwd ?. I have a note for you: In the virtualbox, Nics intel is e1000, it have only  1 queue per port while l3fwd need > 1 queue to done.
最新回答 9月 19, 2015 用户: nghiepnv01 (240 分)
Yes, but I didn't know vmware support queue, so I just choose virtualbox, it is said that it supports multiple queue, I haven't tried, now under the virtual machine run l3fwd now that I'm in the hard disk
0 投票
请问楼主最后是怎么解决这个问题的?可否分享一下。
最新回答 9月 2, 2016 用户: sdu_zy (180 分)
据说virtualbox 虚拟机下是可以的,不过我后来都是在硬盘上跑的DPDK,网卡是英特尔的多队列网卡跑起来没有任何问题
这个问题在虚拟机里里面我也遇到了,通过看代码发现只支持一个tx_ring 所以我测试的时候就指定 -c 1 --config=“(0,0,0),(1,0,0)”
按您的方法确实可以解决这个问题了,但您接下来有没有遇到过这个问题:
port 0 cannot parse packet type, please add --parse-ptype
没有遇到这个问题,能定位到哪一行呢?
main.c文件中的832行,应该是check_ptype()函数返回值为0导致的,但通过这个函数继续找原因就有些复杂了,我没能看下去
    if (l3fwd_lkp.check_ptype(portid))
        return 1;

    printf("port %d cannot parse packet type, please add --%s\n",
           portid, CMD_LINE_OPT_PARSE_PTYPE);
    return 0;
你可以自己gdb跟踪一下, 增加这个,重新编译,就能gdb调试

export EXTRA_CFLAGS="-O0 -g"
好多,多谢指点!
大神,难得遇见个同道中人,冒昧多聊几句 :)
您对DPDK学习多久了,大概掌握到什么程度了呀?我接触这个快一个月了,感觉自学过程中比较艰难,勉强能看懂example里的示例但自己还编写不了。遇到问题经常在网上找不到答案,没有系统的学习方法。您作为过来人,能再给我一些指点吗?
...