DPDK无法检测到以太网端口

发布于 2025-02-04 10:22:00 字数 4856 浏览 4 评论 0原文

我已经安装了F-stack的DPDK(v20.11.0),并将NIC绑定到IGB_UIO驱动程序。 dpdk-devbind.py的输出可以帮助验证它:

Network devices using DPDK-compatible driver
============================================
0000:04:00.0 'I210 Gigabit Network Connection 1533' drv=igb_uio unused=igb,vfio-pci,uio_pci_generic
0000:05:00.0 'I210 Gigabit Network Connection 1533' drv=igb_uio unused=igb,vfio-pci,uio_pci_generic
0000:af:00.0 'Ethernet Controller X710/X557-AT 10GBASE-T 1589' drv=igb_uio unused=i40e,vfio-pci,uio_pci_generic

Network devices using kernel driver
===================================
0000:1a:00.0 'Ethernet Connection X722 for 10GBASE-T 37d2' if=enp26s0f0 drv=i40e unused=igb_uio,vfio-pci,uio_pci_generic *Active*
0000:1a:00.1 'Ethernet Connection X722 for 10GBASE-T 37d2' if=enp26s0f1 drv=i40e unused=igb_uio,vfio-pci,uio_pci_generic *Active*
0000:af:00.1 'Ethernet Controller X710/X557-AT 10GBASE-T 1589' if=enp175s0f1 drv=i40e unused=igb_uio,vfio-pci,uio_pci_generic *Active*
0000:af:00.2 'Ethernet Controller X710/X557-AT 10GBASE-T 1589' if=enp175s0f2 drv=i40e unused=igb_uio,vfio-pci,uio_pci_generic *Active*
0000:af:00.3 'Ethernet Controller X710/X557-AT 10GBASE-T 1589' if=enp175s0f3 drv=i40e unused=igb_uio,vfio-pci,uio_pci_generic *Active*

但是,当我从该DPDK目录进行一些测试时,例如basicffwd,它会返回一个错误,说必须是port <>甚至。然后,我检查了RTE_ETH_DEV_COUNT_AVAIL的返回值,并且是0。

$ sudo ./basicfwd -l 1 -n 4
EAL: Detected 72 lcore(s)
EAL: Detected 2 NUMA nodes
EAL: Multi-process socket /var/run/dpdk/rte/mp_socket
EAL: Selected IOVA mode 'PA'
EAL: No available hugepages reported in hugepages-1048576kB
EAL: Probing VFIO support...
EAL: VFIO support initialized
EAL: No legacy callbacks, legacy socket not created
EAL: Error - exiting with code: 1
  Cause: Error: number of ports must be even

这甚至很奇怪,即测试-PMD的输出似乎可以检测到我的NICS?

EAL: Detected 72 lcore(s)
EAL: Detected 2 NUMA nodes
EAL: Multi-process socket /var/run/dpdk/rte/mp_socket
EAL: Selected IOVA mode 'PA'
EAL: No available hugepages reported in hugepages-1048576kB
EAL: Probing VFIO support...
EAL: VFIO support initialized
EAL: Probe PCI driver: net_e1000_igb (8086:1533) device: 0000:04:00.0 (socket 0)
EAL: Probe PCI driver: net_e1000_igb (8086:1533) device: 0000:05:00.0 (socket 0)
EAL: Probe PCI driver: net_i40e (8086:1589) device: 0000:af:00.0 (socket 1)
EAL: No legacy callbacks, legacy socket not created
testpmd: create a new mbuf pool <mb_pool_0>: n=715456, size=2176, socket=0
testpmd: preferred mempool ops selected: ring_mp_mc
testpmd: create a new mbuf pool <mb_pool_1>: n=715456, size=2176, socket=1
testpmd: preferred mempool ops selected: ring_mp_mc

Warning! port-topology=paired and odd forward ports number, the last port will pair with itself.

Configuring Port 0 (socket 0)
Port 0: 74:FE:48:4D:99:E8
Configuring Port 1 (socket 0)
Port 1: 74:FE:48:4D:99:E9
Configuring Port 2 (socket 1)
Port 2: 3C:FD:FE:83:4A:18
Checking link statuses...
Done
No commandline core given, start packet forwarding
io packet forwarding - ports=3 - cores=1 - streams=3 - NUMA support enabled, MP allocation mode: native
Logical Core 1 (socket 0) forwards packets on 3 streams:
  RX P=0/Q=0 (socket 0) -> TX P=1/Q=0 (socket 0) peer=02:00:00:00:00:01
  RX P=1/Q=0 (socket 0) -> TX P=0/Q=0 (socket 0) peer=02:00:00:00:00:00
  RX P=2/Q=0 (socket 1) -> TX P=2/Q=0 (socket 1) peer=02:00:00:00:00:02

  io packet forwarding packets/burst=32
  nb forwarding cores=1 - nb forwarding ports=3
  port 0: RX queue number: 1 Tx queue number: 1
    Rx offloads=0x0 Tx offloads=0x0
    RX queue: 0
      RX desc=512 - RX free threshold=32
      RX threshold registers: pthresh=0 hthresh=0  wthresh=0
      RX Offloads=0x0
    TX queue: 0
      TX desc=512 - TX free threshold=0
      TX threshold registers: pthresh=8 hthresh=1  wthresh=16
      TX offloads=0x0 - TX RS bit threshold=0
  port 1: RX queue number: 1 Tx queue number: 1
    Rx offloads=0x0 Tx offloads=0x0
    RX queue: 0
      RX desc=512 - RX free threshold=32
      RX threshold registers: pthresh=0 hthresh=0  wthresh=0
      RX Offloads=0x0
    TX queue: 0
      TX desc=512 - TX free threshold=0
      TX threshold registers: pthresh=8 hthresh=1  wthresh=16
      TX offloads=0x0 - TX RS bit threshold=0
  port 2: RX queue number: 1 Tx queue number: 1
    Rx offloads=0x0 Tx offloads=0x10000
    RX queue: 0
      RX desc=256 - RX free threshold=32
      RX threshold registers: pthresh=0 hthresh=0  wthresh=0
      RX Offloads=0x0
    TX queue: 0
      TX desc=256 - TX free threshold=32
      TX threshold registers: pthresh=32 hthresh=0  wthresh=0
      TX offloads=0x10000 - TX RS bit threshold=32
Press enter to exit

我怀疑这可能是F-stack的问题,因为如果我尝试使用最新版本的DPDK,它可以检测到我的NIC。

谁能帮助找到我的环境中可能出了什么问题?任何帮助将不胜感激。

I have installed DPDK (v20.11.0) shipped by F-stack correctly and have bonded the NICs to the igb_uio driver. The output of dpdk-devbind.py can help to verify it:

Network devices using DPDK-compatible driver
============================================
0000:04:00.0 'I210 Gigabit Network Connection 1533' drv=igb_uio unused=igb,vfio-pci,uio_pci_generic
0000:05:00.0 'I210 Gigabit Network Connection 1533' drv=igb_uio unused=igb,vfio-pci,uio_pci_generic
0000:af:00.0 'Ethernet Controller X710/X557-AT 10GBASE-T 1589' drv=igb_uio unused=i40e,vfio-pci,uio_pci_generic

Network devices using kernel driver
===================================
0000:1a:00.0 'Ethernet Connection X722 for 10GBASE-T 37d2' if=enp26s0f0 drv=i40e unused=igb_uio,vfio-pci,uio_pci_generic *Active*
0000:1a:00.1 'Ethernet Connection X722 for 10GBASE-T 37d2' if=enp26s0f1 drv=i40e unused=igb_uio,vfio-pci,uio_pci_generic *Active*
0000:af:00.1 'Ethernet Controller X710/X557-AT 10GBASE-T 1589' if=enp175s0f1 drv=i40e unused=igb_uio,vfio-pci,uio_pci_generic *Active*
0000:af:00.2 'Ethernet Controller X710/X557-AT 10GBASE-T 1589' if=enp175s0f2 drv=i40e unused=igb_uio,vfio-pci,uio_pci_generic *Active*
0000:af:00.3 'Ethernet Controller X710/X557-AT 10GBASE-T 1589' if=enp175s0f3 drv=i40e unused=igb_uio,vfio-pci,uio_pci_generic *Active*

However, when I ran some tests from this DPDK directory, such as basicfwd, it returns an error saying number of ports must be even. I then checked the return value of rte_eth_dev_count_avail and it's 0.

$ sudo ./basicfwd -l 1 -n 4
EAL: Detected 72 lcore(s)
EAL: Detected 2 NUMA nodes
EAL: Multi-process socket /var/run/dpdk/rte/mp_socket
EAL: Selected IOVA mode 'PA'
EAL: No available hugepages reported in hugepages-1048576kB
EAL: Probing VFIO support...
EAL: VFIO support initialized
EAL: No legacy callbacks, legacy socket not created
EAL: Error - exiting with code: 1
  Cause: Error: number of ports must be even

Which is even weird is that the output of test-pmd seems like my NICs CAN be detected?

EAL: Detected 72 lcore(s)
EAL: Detected 2 NUMA nodes
EAL: Multi-process socket /var/run/dpdk/rte/mp_socket
EAL: Selected IOVA mode 'PA'
EAL: No available hugepages reported in hugepages-1048576kB
EAL: Probing VFIO support...
EAL: VFIO support initialized
EAL: Probe PCI driver: net_e1000_igb (8086:1533) device: 0000:04:00.0 (socket 0)
EAL: Probe PCI driver: net_e1000_igb (8086:1533) device: 0000:05:00.0 (socket 0)
EAL: Probe PCI driver: net_i40e (8086:1589) device: 0000:af:00.0 (socket 1)
EAL: No legacy callbacks, legacy socket not created
testpmd: create a new mbuf pool <mb_pool_0>: n=715456, size=2176, socket=0
testpmd: preferred mempool ops selected: ring_mp_mc
testpmd: create a new mbuf pool <mb_pool_1>: n=715456, size=2176, socket=1
testpmd: preferred mempool ops selected: ring_mp_mc

Warning! port-topology=paired and odd forward ports number, the last port will pair with itself.

Configuring Port 0 (socket 0)
Port 0: 74:FE:48:4D:99:E8
Configuring Port 1 (socket 0)
Port 1: 74:FE:48:4D:99:E9
Configuring Port 2 (socket 1)
Port 2: 3C:FD:FE:83:4A:18
Checking link statuses...
Done
No commandline core given, start packet forwarding
io packet forwarding - ports=3 - cores=1 - streams=3 - NUMA support enabled, MP allocation mode: native
Logical Core 1 (socket 0) forwards packets on 3 streams:
  RX P=0/Q=0 (socket 0) -> TX P=1/Q=0 (socket 0) peer=02:00:00:00:00:01
  RX P=1/Q=0 (socket 0) -> TX P=0/Q=0 (socket 0) peer=02:00:00:00:00:00
  RX P=2/Q=0 (socket 1) -> TX P=2/Q=0 (socket 1) peer=02:00:00:00:00:02

  io packet forwarding packets/burst=32
  nb forwarding cores=1 - nb forwarding ports=3
  port 0: RX queue number: 1 Tx queue number: 1
    Rx offloads=0x0 Tx offloads=0x0
    RX queue: 0
      RX desc=512 - RX free threshold=32
      RX threshold registers: pthresh=0 hthresh=0  wthresh=0
      RX Offloads=0x0
    TX queue: 0
      TX desc=512 - TX free threshold=0
      TX threshold registers: pthresh=8 hthresh=1  wthresh=16
      TX offloads=0x0 - TX RS bit threshold=0
  port 1: RX queue number: 1 Tx queue number: 1
    Rx offloads=0x0 Tx offloads=0x0
    RX queue: 0
      RX desc=512 - RX free threshold=32
      RX threshold registers: pthresh=0 hthresh=0  wthresh=0
      RX Offloads=0x0
    TX queue: 0
      TX desc=512 - TX free threshold=0
      TX threshold registers: pthresh=8 hthresh=1  wthresh=16
      TX offloads=0x0 - TX RS bit threshold=0
  port 2: RX queue number: 1 Tx queue number: 1
    Rx offloads=0x0 Tx offloads=0x10000
    RX queue: 0
      RX desc=256 - RX free threshold=32
      RX threshold registers: pthresh=0 hthresh=0  wthresh=0
      RX Offloads=0x0
    TX queue: 0
      TX desc=256 - TX free threshold=32
      TX threshold registers: pthresh=32 hthresh=0  wthresh=0
      TX offloads=0x10000 - TX RS bit threshold=32
Press enter to exit

I suspect it might be the problem of F-stack, because if I try with the latest version of DPDK, it can detect my NICs.

Could anyone help find what could be wrong in my setting? Any help would be greatly appreciated.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

人心善变 2025-02-11 10:22:00

根据DPDK-DEVBIND共享的日志,您在DPDK中标识了3个NIC端口,例如

Network devices using DPDK-compatible driver
============================================
0000:04:00.0 'I210 Gigabit Network Connection 1533' drv=igb_uio unused=igb,vfio-pci,uio_pci_generic
0000:05:00.0 'I210 Gigabit Network Connection 1533' drv=igb_uio unused=igb,vfio-pci,uio_pci_generic
0000:af:00.0 'Ethernet Controller X710/X557-AT 10GBASE-T 1589' drv=igb_uio unused=i40e,vfio-pci,uio_pci_generic

DPDK示例骨架,它可以在2、4、6、8、8,...的一对端口上工作。因此,运行时 则将有2个结果(带有实际选项-d未传递)

  1. 应用程序sudo ./basicfwd -l 1 -l 1 -n 4如果使用make clean state static static static static, ;使静态应用程序看到3个端口。
  2. 如果与共享的构建使清洁;制作应用程序将看到0个端口,

因此要解决问题,您有3个选项

  1. 添加1个额外的NIC或虚拟(-vdev = net_tap0)
  2. 或通过-B 0000: AF:00.0或通过从dev-bind中删除
  3. 或通过-A 0000:04:00.0.0 -a 0000:05:00.0:00.0

注意:如果您有共享库的构建,则模式,您还需要传递适当的PMD驱动程序,以便为basicfwd而成功。您可以轻松识别这一点,因为在日志(-log-level = pmd,8)中根本有PCI设备探针

Based on the logs shared from dpdk-devbind you have 3 NIC ports identified under DPDK such as

Network devices using DPDK-compatible driver
============================================
0000:04:00.0 'I210 Gigabit Network Connection 1533' drv=igb_uio unused=igb,vfio-pci,uio_pci_generic
0000:05:00.0 'I210 Gigabit Network Connection 1533' drv=igb_uio unused=igb,vfio-pci,uio_pci_generic
0000:af:00.0 'Ethernet Controller X710/X557-AT 10GBASE-T 1589' drv=igb_uio unused=i40e,vfio-pci,uio_pci_generic

With respect DPDK example skeleton, it works on pair of ports that is 2, 4, 6, 8, ... etc. Hence when you run the application sudo ./basicfwd -l 1 -n 4 there would be 2 outcomes (with real option -d not passed)

  1. If build static with make clean; make static the application sees 3 ports.
  2. If the build shared with make clean; make the application will see 0 ports

So to resolve the problem you have 3 options

  1. Add 1 additional nic either physical or virtual (--vdev=net_tap0)
  2. or add 1 nic to block list by -b 0000:af:00.0 or by removing from dev-bind
  3. or pass 2 nic exclusively by -a 0000:04:00.0 -a 0000:05:00.0

Note: if you have build with shared library mode, you will also need to pass the appropriate PMD driver for probing to be successful for basicfwd. You can easily identify this since there is pci device probe at all in the logs (--log-level=pmd,8).

习ぎ惯性依靠 2025-02-11 10:22:00

根据dpdk-devbind输出,有三个 nics绑定到与DPDK兼容的驱动程序。当一个人(使用-a eal参数)未明确指定哪个nics时,EAL会发现所有上述NIC 甚至

为了解决有关的问题,请考虑运行basicfwd,如下:

sudo ./basicfwd -l 1 -n 4 -a 0000:04:00.0 -a 0000:05:00.0

According to dpdk-devbind output, there are three NICs bound to a DPDK-compatible driver. When one does not specify explicitly (using the -a EAL argument) which NICs to pick, EAL discovers all of the said NICs, but basicfwd demands that the number of ports be even.

In order to solve the problem in question, consider running basicfwd as follows:

sudo ./basicfwd -l 1 -n 4 -a 0000:04:00.0 -a 0000:05:00.0
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文