DPDK:testpmd 收发包为0
[20210726_01:45:57]testpmd> start
[20210726_01:45:57] io packet forwarding - CRC stripping disabled - packets/burst=32
[20210726_01:45:57] nb forwarding cores=1 - nb forwarding ports=0
[20210726_01:45:57] RX queues=1 - RX desc=128 - RX free threshold=0
[20210726_01:45:57] RX threshold registers: pthresh=0 hthresh=0 wthresh=0
[20210726_01:45:57] TX queues=1 - TX desc=512 - TX free threshold=0
[20210726_01:45:57] TX threshold registers: pthresh=0 hthresh=0 wthresh=0
[20210726_01:45:57] TX RS bit threshold=0 - TXQ flags=0x0
[20210726_01:46:23]testpmd> stop
[20210726_01:46:23]Telling cores to stop...
[20210726_01:46:23]Waiting for lcores to finish...
[20210726_01:46:23]
[20210726_01:46:23] +++++++++++++++ Accumulated forward statistics for all ports+++++++++++++++
[20210726_01:46:23] RX-packets: 0 RX-dropped: 0 RX-total: 0
[20210726_01:46:23] TX-packets: 0 TX-dropped: 0 TX-total: 0
[20210726_01:46:23] ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
原因是可以在前面初始化log找到:
[20210726_01:42:36]EAL: PCI device 0000:02:01.0 on NUMA socket -1
[20210726_01:42:36]EAL: probe driver: 8086:100f rte_em_pmd
[20210726_01:42:36]EAL: Not managed by a supported kernel driver, skipped
[20210726_01:42:36]EAL: PCI device 0000:02:04.0 on NUMA socket -1
[20210726_01:42:36]EAL: probe driver: 8086:100f rte_em_pmd
[20210726_01:42:36]EAL: Not managed by a supported kernel driver, skipped
[20210726_01:42:36]EAL: PCI device 0000:02:05.0 on NUMA socket -1
[20210726_01:42:36]EAL: probe driver: 8086:100f rte_em_pmd
[20210726_01:42:36]EAL: Not managed by a supported kernel driver, skipped
[20210726_01:42:36]EAL: No probed ethernet devices
没有可用设备,当然不会有收发包。网卡在配置时失败了,没有bind到igb_uio上。日志上可以看到uio网卡在Other network devices里面。
[20210726_01:35:15]Option: 22
[20210726_01:35:15]
[20210726_01:35:15]
[20210726_01:35:15]Network devices using DPDK-compatible driver
[20210726_01:35:15]============================================
[20210726_01:35:15]<none>
[20210726_01:35:15]
[20210726_01:35:15]Network devices using kernel driver
[20210726_01:35:15]===================================
[20210726_01:35:15]0000:02:01.0 '82545EM Gigabit Ethernet Controller (Copper)' if=ens33 drv=e1000 unused=igb_uio *Active*
[20210726_01:35:15]
[20210726_01:35:15]Other network devices
[20210726_01:35:15]=====================
[20210726_01:35:15]0000:02:04.0 '82545EM Gigabit Ethernet Controller (Copper)' unused=e1000,igb_uio
[20210726_01:35:15]0000:02:05.0 '82545EM Gigabit Ethernet Controller (Copper)' unused=e1000,igb_uio
将这两个网卡重新bind igb_uio。
[20210726_01:33:47]Option: 22
[20210726_01:33:47]
[20210726_01:33:47]
[20210726_01:33:47]Network devices using DPDK-compatible driver
[20210726_01:33:47]============================================
[20210726_01:33:47]0000:02:04.0 '82545EM Gigabit Ethernet Controller (Copper)' drv=igb_uio unused=e1000
[20210726_01:33:47]0000:02:05.0 '82545EM Gigabit Ethernet Controller (Copper)' drv=igb_uio unused=e1000
然后再用testpmd测试。初始化日志可以看到,只有PCI device 0000:02:01.0因为没bind igb_uio所以才打印Not managed by a supported kernel driver, skipped。已经bind的两块网卡,多了很多信息。
[20210726_02:23:21]EAL: PCI device 0000:02:01.0 on NUMA socket -1
[20210726_02:23:21]EAL: probe driver: 8086:100f rte_em_pmd
[20210726_02:23:21]EAL: Not managed by a supported kernel driver, skipped
[20210726_02:23:21]EAL: PCI device 0000:02:04.0 on NUMA socket -1
[20210726_02:23:21]EAL: probe driver: 8086:100f rte_em_pmd
[20210726_02:23:21]EAL: PCI memory mapped at 0x7fefe3800000
[20210726_02:23:21]EAL: PCI memory mapped at 0x7fefe3820000
[20210726_02:23:21]PMD: eth_em_dev_init(): port_id 0 vendorID=0x8086 deviceID=0x100f
[20210726_02:23:21]EAL: PCI device 0000:02:05.0 on NUMA socket -1
[20210726_02:23:21]EAL: probe driver: 8086:100f rte_em_pmd
[20210726_02:23:21]EAL: PCI memory mapped at 0x7fefe3830000
[20210726_02:23:21]EAL: PCI memory mapped at 0x7fefe3850000
[20210726_02:23:22]PMD: eth_em_dev_init(): port_id 1 vendorID=0x8086 deviceID=0x100f
[20210726_02:23:22]Interactive-mode selected
[20210726_02:23:22]Configuring Port 0 (socket 0)
[20210726_02:23:22]PMD: eth_em_tx_queue_setup(): sw_ring=0x7fefb4dedb00 hw_ring=0x7fefb4defc00 dma_addr=0xaa5efc00
[20210726_02:23:22]PMD: eth_em_rx_queue_setup(): sw_ring=0x7fefb4ddd5c0 hw_ring=0x7fefb4dddac0 dma_addr=0xaa5ddac0
[20210726_02:23:22]PMD: eth_em_start(): <<
[20210726_02:23:22]Port 0: 00:0C:29:6A:FE:B1
[20210726_02:23:22]Configuring Port 1 (socket 0)
[20210726_02:23:22]PMD: eth_em_tx_queue_setup(): sw_ring=0x7fefb4dcb380 hw_ring=0x7fefb4dcd480 dma_addr=0xaa5cd480
[20210726_02:23:22]PMD: eth_em_rx_queue_setup(): sw_ring=0x7fefb4dbae40 hw_ring=0x7fefb4dbb340 dma_addr=0xaa5bb340
[20210726_02:23:22]PMD: eth_em_start(): <<
[20210726_02:23:22]Port 1: 00:0C:29:6A:FE:BB
[20210726_02:23:22]Checking link statuses...
[20210726_02:23:22]Port 0 Link Up - speed 1000 Mbps - full-duplex
[20210726_02:23:22]Port 1 Link Up - speed 1000 Mbps - full-duplex
[20210726_02:23:22]Done
开始打流测试。
[20210726_02:23:42]testpmd> start
[20210726_02:23:42] io packet forwarding - CRC stripping disabled - packets/burst=32
[20210726_02:23:42] nb forwarding cores=1 - nb forwarding ports=2
[20210726_02:23:42] RX queues=1 - RX desc=128 - RX free threshold=0
[20210726_02:23:42] RX threshold registers: pthresh=0 hthresh=0 wthresh=0
[20210726_02:23:42] TX queues=1 - TX desc=512 - TX free threshold=0
[20210726_02:23:42] TX threshold registers: pthresh=0 hthresh=0 wthresh=0
[20210726_02:23:42] TX RS bit threshold=0 - TXQ flags=0x0
[20210726_02:23:43]testpmd> stop
[20210726_02:23:43]Telling cores to stop...
[20210726_02:23:43]Waiting for lcores to finish...
[20210726_02:23:43]
[20210726_02:23:43] ---------------------- Forward statistics for port 0 ----------------------
[20210726_02:23:43] RX-packets: 157723 RX-dropped: 0 RX-total: 157723
[20210726_02:23:43] TX-packets: 157696 TX-dropped: 0 TX-total: 157696
[20210726_02:23:43] ----------------------------------------------------------------------------
[20210726_02:23:43]
[20210726_02:23:43] ---------------------- Forward statistics for port 1 ----------------------
[20210726_02:23:43] RX-packets: 157721 RX-dropped: 0 RX-total: 157721
[20210726_02:23:43] TX-packets: 157696 TX-dropped: 0 TX-total: 157696
[20210726_02:23:43] ----------------------------------------------------------------------------
[20210726_02:23:43]
[20210726_02:23:43] +++++++++++++++ Accumulated forward statistics for all ports+++++++++++++++
[20210726_02:23:43] RX-packets: 315444 RX-dropped: 0 RX-total: 315444
[20210726_02:23:43] TX-packets: 315392 TX-dropped: 0 TX-total: 315392
[20210726_02:23:43] ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
[20210726_02:23:43]
[20210726_02:23:43]Done.
有报文计数了。