我有两个系统,分别是x和y。
在系统X上:我正在运行DPDK数据包gen。
在系统y上:我正在运行DPDK l2fwd应用程序。我正在创建TAP接口以及l2fwd,如下所示:
sudo ./l2fwd -l 0-3 --vdev=net_tap0 -- -p 0x01
DPDK TAP信息为here
我能够看到该界面
dtap0 Link encap:Ethernet HWaddr 62:3d:d1:78:18:7a
inet6 addr: fe80::603d:d1ff:fe78:187a/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:14 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
eno1 Link encap:Ethernet HWaddr 8c:ec:4b:c1:e1:6b
inet addr:192.168.75.96 Bcast:192.168.75.255 Mask:255.255.254.0
inet6 addr: fe80::f2a0:3f00:9bf5:da00/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:495498 errors:4 dropped:0 overruns:0 frame:2
TX packets:45369 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:122400245 (122.4 MB) TX bytes:5661722 (5.6 MB)
Interrupt:16 Memory:a3c00000-a3c20000
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:7241 errors:0 dropped:0 overruns:0 frame:0
TX packets:7241 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:633086 (633.0 KB) TX bytes:633086 (633.0 KB)
dtap0是接口
但是当我在Wireshark中打开该接口时,没有捕获到任何数据包 而l2fwd可以接收它。可能是什么原因
明智地 1)$ sudo modeprob uio
2)$ sudo insmod igb_uio.ko
将NIC从Kernal绑定到DPDK空间
1)$ sudo ./usertool/dpdk-devbind.py --bind = igb_uio 01:00.0
2)$ sudo ./usertool/dpdk-devbind.py --bind = igb_uio 01:00.1
这是绑定后的状态
Network devices using DPDK-compatible driver
============================================
0000:01:00.0 'Ethernet Controller X710 for 10GbE SFP+ 1572' drv=igb_uio unused=i40e
0000:01:00.1 'Ethernet Controller X710 for 10GbE SFP+ 1572' drv=igb_uio unused=i40e
Network devices using kernel driver
===================================
0000:00:1f.6 'Device 15bb' if=eno1 drv=e1000e unused=igb_uio *Active*
Other Network devices
=====================
<none>
Crypto devices using DPDK-compatible driver
===========================================
<none>
Crypto devices using kernel driver
==================================
<none>
Other Crypto devices
====================
<none>
Eventdev devices using DPDK-compatible driver
=============================================
<none>
Eventdev devices using kernel driver
====================================
<none>
Other Eventdev devices
======================
<none>
Mempool devices using DPDK-compatible driver
============================================
<none>
Mempool devices using kernel driver
===================================
<none>
Other Mempool devices
=====================
<none>
这是l2fwd应用的结果
EAL: Detected 12 lcore(s)
EAL: Detected 1 NUMA nodes
EAL: Multi-process socket /var/run/dpdk/rte/mp_socket
EAL: No free hugepages reported in hugepages-1048576kB
EAL: Probing VFIO support...
EAL: PCI device 0000:00:1f.6 on NUMA socket -1
EAL: Invalid NUMA socket, default to 0
EAL: probe driver: 8086:15bb net_e1000_em
EAL: PCI device 0000:01:00.0 on NUMA socket -1
EAL: Invalid NUMA socket, default to 0
EAL: probe driver: 8086:1572 net_i40e
PMD: Global register is changed during support QinQ parser
PMD: Global register is changed during configure hash input set
PMD: Global register is changed during configure fdir mask
PMD: Global register is changed during configure hash mask
PMD: Global register is changed during support QinQ cloud filter
i40e_dcb_init_configure(): default dcb config fails. err = -53, aq_err = 3.
PMD: Global register is changed during disable FDIR flexible payload
EAL: PCI device 0000:01:00.1 on NUMA socket -1
EAL: Invalid NUMA socket, default to 0
EAL: probe driver: 8086:1572 net_i40e
PMD: Global register is changed during support QinQ parser
PMD: Global register is changed during configure hash input set
PMD: Global register is changed during configure fdir mask
PMD: Global register is changed during configure hash mask
PMD: Global register is changed during support QinQ cloud filter
i40e_dcb_init_configure(): default dcb config fails. err = -53, aq_err = 3.
PMD: Global register is changed during disable FDIR flexible payload
rte_pmd_tap_probe(): Initializing pmd_tap for net_tap0 as dtap0
MAC updating disabled
Notice: odd number of ports in portmask.
Lcore 0: RX port 0
Initializing port 0... done:
Port 0, MAC address: 64:9D:99:B1:02:58
Skipping disabled port 1
Skipping disabled port 2
Checking link status.done
Port0 Link Up. Speed 10000 Mbps - full-duplex
L2FWD: lcore 1 has nothing to do
L2FWD: lcore 2 has nothing to do
L2FWD: lcore 3 has nothing to do
L2FWD: entering main loop on lcore 0
L2FWD: -- lcoreid=0 portid=0
Port statistics ====================================
Statistics for port 0 ------------------------------
Packets sent: 148391624
Packets received: 148391624
Packets dropped: 0
Aggregate statistics ===============================
Total packets sent: 148391624
Total packets received: 148391624
Total packets dropped: 0
====================================================
答案 0 :(得分:0)
Dpdk TAP接口未拦截数据包
TAP接口不应拦截数据包。要转储数据包,请参阅DPDK pdump
:
https://doc.dpdk.org/guides/howto/packet_capture_framework.html