Интерфейс Dpdk TAP не перехватывает пакеты - PullRequest
0 голосов
/ 10 июля 2019

У меня есть две системы, скажем, х и у.

в системе X: я использую пакет DPDK gen.

в системе y: я запускаю приложение DPDK l2fwd. Я создаю интерфейс TAP вместе с l2fwd примерно так:

sudo ./l2fwd -l 0-3 --vdev=net_tap0 -- -p 0x01

Информация о DPDK TAP здесь

Я вижу этот интерфейс

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

Связывание сетевых карт от 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
====================================================

1 Ответ

0 голосов
/ 11 июля 2019

Интерфейс TAP Dpdk не перехватывает пакеты

Интерфейс TAP не должен перехватывать пакеты.Для вывода пакетов см. DPDK pdump:

https://doc.dpdk.org/guides/howto/packet_capture_framework.html

...