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

Capture packet DPDK

0 投票

 

I use dpdk to capture packet:

$RTE_TARGET/app/testpmd -c '0xf' -n 4 --vdev 'eth_pcap0,rx_iface=eth0,tx_pcap=/path/to/file_tx.pcap' -- --port-topology=chained

eth0: using kernel driver. I don't known stream of packet.

NICs--->Linux kernel---> Application 

or

NICs--->DPDK library---> Application
最新提问 7月 27, 2015 分类:DPDK初学入门 | 用户: nghiepnv01 (240 分)

1个回答

0 投票
 
已采纳

to use dpdk to capture packets, you should bind eth0 to igb_uio.ko first:

./tools/dpdk_nic_bind.py -b igb_uio eth0

 

please refer to section 5 and 6 of http://sysight.com/index.php?qa=4&qa_1=dpdk%E5%9C%A8virtualbox%E4%B8%AD%E5%AE%89%E8%A3%85%E6%B5%8B%E8%AF%95

 

最新回答 7月 27, 2015 用户: sysight (9,620 分)
采纳于 7月 27, 2015 用户:nghiepnv01
if bind eth0 to igb_uio, then i will not using application  testpmd to capture packet because after bind this to dpdk driver i don't see eth0 when run "ifconfig". What example to capture packet /? or i must to write a example to do this.
that's right, if you bind eth0 to igb_uio, it will disappear from "ifconfig", but it can be read by dpdk application(e.g. testpmd).
the option "-c" specifies the port(s).
for example:
(1) if you only bind eth0, then the option should be "-c 0x1"
(2) if you bind eth0 and eth1, then the option could be "-c 0x3"
(3) if you bind eth0, eth1 and eth2, then the option could be "-c 0x7"

the example "testpmd" is ok for testing. but you may need 2 ports at least.
I see, but it not run, Eg:
$RTE_TARGET/app/testpmd -c '0xf' -n 4 --vdev 'eth_pcap0,rx_iface=enp0s8,tx_pcap=/path/to/file_tx.pcap' -- --port-topology=chained
I use Fedora, enp0s8: bind to igb_uio.
When i run it, i have a erro: PMD: couldn't open interface enp0s8
i have Nics: enp0s8, enp0s9, enp0s10 to bind igb_uio driver.
Did you modify "CONFIG_RTE_LIBRTE_PMD_PCAP=n" to "CONFIG_RTE_LIBRTE_PMD_PCAP=y" in the config file "config/common_linuxapp" when you compiled dpdk?
yes, i did. I changed file config before compile it. It had to change to using pcap.
if enp0s8 using kernel driver, then i will capture packet. But i don't known  stream of packet.

NICs--->Linux kernel---> Application
or

NICs--->DPDK library---> Application
I didn't test this way, but as the document(doc/guides/nics/pcap_ring.rst) said, it should be:
NICs--->Linux kernel---> Application
do you have any IM account for a realtime commutication, such as WeChat, QQ, Skype, etc.
Do you use Hangout (addon of google)? My email is " nghiep.sdbg@gmail.com ". I want capture packet by DPDK. Any program e.g: wireshark, tcpdump... stream of packet: Nics->bus-....- 7 layer OSI--> app. I want use dpdk (Packet: Nics->library dpdk-> app) but i don't success. Do you have any idea ? Tks
I have contracted you at Hangouts.
I think you can try some easier examples such as skeleton,l2fwd, l3fwd.
I didn't try testpmd as you mentioned above, and I'm a little busy these days,
but maybe I can try testpmd in that way after a few days.
Keep in touch. :)
...