NIC在DPDK应用程序中不可用

发布于 2025-01-17 12:03:46 字数 1740 浏览 1 评论 0原文

我正在研究DPDK并尝试创建一个简单的应用程序,但是它看不到与DPDK绑定的NIC。

  1. 这是我在计算机上拥有的网络设备的列表,
$ dpdk-devbind.py --status-dev net

Network devices using kernel driver
===================================
0000:01:00.0 'RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller 8168' if=enp1s0 drv=r8169 unused=vfio-pci *Active*
0000:02:00.0 'RTL8822BE 802.11a/b/g/n/ac WiFi adapter b822' if=wlp2s0 drv=rtw_8822be unused=rtw88_8822be,vfio-pci *Active*
  1. 我禁用我的以太网NIC(它在活动时不能绑定到DPDK),并成功地将其绑定到VFIO-PCI驱动程序中
$ ip link set enp1s0 down
$ dpdk-devbind.py -b vfio-pci enp1s0
  1. ,现在DPDK-devbind.py显示了NIC, 但是,当我运行任何示例DPDK应用程序时,正在使用DPDK兼容的驱动程序
$ dpdk-devbind.py --status-dev net

Network devices using DPDK-compatible driver
============================================
0000:01:00.0 'RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller 8168' drv=vfio-pci unused=r8169

Network devices using kernel driver
===================================
0000:02:00.0 'RTL8822BE 802.11a/b/g/n/ac WiFi adapter b822' if=wlp2s0 drv=rtw_8822be unused=rtw88_8822be,vfio-pci *Active*
  1. ,它说没有可用的NIC端口。例如,我编写了一个简单的应用程序
int main(int argc, char *argv[])
{
    int ret;
    int total_ports, avail_ports;

    ret = rte_eal_init(argc, argv);
    if( ret < 0 )
        rte_exit(EXIT_FAILURE, "EAL initialization failed\n");

    total_ports = rte_eth_dev_count_total();
    avail_ports = rte_eth_dev_count_avail();
    printf("ETH PORTS %d %d\n", total_ports, avail_ports);

    rte_eal_cleanup();

    return 0;
}

,RTE_ETH_DEV_COUNT_TOTAL()和RTE_ETH_DEV_COUNT_AVAIL()返回0。

我在做什么错?

I'm studying DPDK and trying to create a simple application, however it can't see a NIC bound to DPDK.

  1. Here is a list of network devices I have on my machine
$ dpdk-devbind.py --status-dev net

Network devices using kernel driver
===================================
0000:01:00.0 'RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller 8168' if=enp1s0 drv=r8169 unused=vfio-pci *Active*
0000:02:00.0 'RTL8822BE 802.11a/b/g/n/ac WiFi adapter b822' if=wlp2s0 drv=rtw_8822be unused=rtw88_8822be,vfio-pci *Active*
  1. I disable my ethernet NIC (it can't be bound to DPDK while it is active) and bind it to vfio-pci driver successfully
$ ip link set enp1s0 down
$ dpdk-devbind.py -b vfio-pci enp1s0
  1. Now dpdk-devbind.py shows that the NIC is using DPDK-compatible driver
$ dpdk-devbind.py --status-dev net

Network devices using DPDK-compatible driver
============================================
0000:01:00.0 'RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller 8168' drv=vfio-pci unused=r8169

Network devices using kernel driver
===================================
0000:02:00.0 'RTL8822BE 802.11a/b/g/n/ac WiFi adapter b822' if=wlp2s0 drv=rtw_8822be unused=rtw88_8822be,vfio-pci *Active*
  1. However when I run any example DPDK application it says that there are no available NIC ports. For instance I wrote a simple application
int main(int argc, char *argv[])
{
    int ret;
    int total_ports, avail_ports;

    ret = rte_eal_init(argc, argv);
    if( ret < 0 )
        rte_exit(EXIT_FAILURE, "EAL initialization failed\n");

    total_ports = rte_eth_dev_count_total();
    avail_ports = rte_eth_dev_count_avail();
    printf("ETH PORTS %d %d\n", total_ports, avail_ports);

    rte_eal_cleanup();

    return 0;
}

and both rte_eth_dev_count_total() and rte_eth_dev_count_avail() return 0.

What am I doing wrong?

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

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

发布评论

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

评论(1

一世旳自豪 2025-01-24 12:03:46

在您的环境中未识别 DPDK 端口的主要原因是所使用的 NIC 没有受支持的供应商轮询模式驱动程序。请参考各个供应商支持的 NIC 列表,Realtek 不在其中。

解决方法:可以使用PCAP PMD 来解决该问题。请按照适合您环境的步骤进行操作,

  1. 确保您的以太网端口已链接到内核驱动程序 r8169
  2. isntall libpacp-dev,适合您的环境 (linux/bsd)
  3. 重建具有 PCAP 支持的 dpdk。
  4. 使用以下参数启动您的应用程序 --no-pci --vdev=net_pcap0,iface=enp1s0

这将使用 libpcap PMD 作为通过不支持的 NIC 进行 RX 和 TX 的包装器

The main reason why DPDK ports are not identified in your environment is because the NIC in use is not having a supported vendor Poll Mode Driver. Please refer to list of supported NIC from various vendor Realtek is not among them.

Work around: you can use PCAP PMD to solve the problem. Please follow the steps for your environment as

  1. ensure your ethernet port is linked to kernel driver r8169
  2. isntall libpacp-dev for your enviorment (linux/bsd)
  3. rebuild dpdk with PCAP support.
  4. start your application with following args --no-pci --vdev=net_pcap0,iface=enp1s0

This will use libpcap PMD as wrapper for RX and TX over non supported NIC

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