DPDK无法使用err no:-22,tx_queues配置ETH设备,大于一个(ethdev port_id = 0 nb_tx_queues = 2> 1)

发布于 2025-02-07 17:03:19 字数 554 浏览 1 评论 0原文

我有一个将DPDK用于快速路径的应用程序。在DPDK初始化期间,我正在尝试为端口配置两个TX队列,但未能配置ETH设备。

我在裸露的金属设置上使用英特尔IGB驱动程序(I350 NIC)。根据DPDK文档IGB轮询模式驱动程序( https://doc.dpdk.org/guides /nics/igb.html )应支持端口的多个RX/TX队列。我正在尝试为端口配置两个TX队列(port_id = 0),当调用API“ rte_eth_eth_dev_configure(portid = 0,nb_rx_queue = 1,nb_tx_queue = 1,nb_tx_queue = 2,返回错误代码:-22,“ ethdev port_id = 0 nb_tx_queues = 2> 1 ”。

IGB PMD驱动程序是否支持端口的多个TX队列?还是我需要进行任何配置更改以支持多个TX队列?

I have an application that uses DPDK for Fast Path. During DPDK initialization, am trying to configure two TX queues for a port, but it failed to configure the eth device.

I am using Intel IGB driver(I350 NIC) on a Bare Metal setup. As per DPDK documentation IGB Poll Mode Driver (https://doc.dpdk.org/guides/nics/igb.html) should support multiple RX/TX queues for a port. Am trying to configure two TX queues for a port(port_id = 0), when invoking the API "rte_eth_dev_configure(portid = 0, nb_rx_queue = 1, nb_tx_queue = 2, &local_port_conf)", it is returning error code: -22, "Ethdev port_id=0 nb_tx_queues=2 > 1".

Does the IGB PMD driver support multiple TX queues for a port? Or do I need to do any configuration changes to support multiple TX queues?

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

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

发布评论

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

评论(2

神妖 2025-02-14 17:03:19

对于虚拟函数(vfs),所讨论的NIC模型仅支持单格模式( source )。

要测试多标题支持,请考虑将A 物理功能(PF)转到设置。

For virtual functions (VFs), the NIC model in question supports only single-queue mode (source).

To test multi-queue support, consider passing a physical function (PF) to the setup instead.

单调的奢华 2025-02-14 17:03:19

Intel基础NIC I350分配根据产品简介Intel®以太网控制器i350,每个端口最多八个队列。关于每个VF 的每个端口1个队列的虚拟功能,总共每个端口总计8 VF最大值根据Intel®以太网控制器i350 DataSheet

在Linux中,可以通过EthTool验证这些

  1. :一个人可以使用选项-s检查每个队列实例,因为每个队列都支持统计信息。
  2. dpdk:使用rte_eth_dev_info_get获取属性max_rx_queues and max_tx_queues and max_tx_queues

注意:随着VF的分配给1 rx-tx Queue Pair,ERROR提及-22,Ethdev Port_id = -22,Ethdev Port_id = -22,Ethdev port_id = -22 0 nb_tx_queues = 2> 1可以使用正在使用的VF。因此,首先,正确的配置方法是获得DPDK端口最大RX-TX队列并确保其处于范围。

示例代码段:

 /* Initialise each port */
    RTE_ETH_FOREACH_DEV(portid) {
        struct rte_eth_rxconf rxq_conf;
        struct rte_eth_txconf txq_conf;
        struct rte_eth_conf local_port_conf = port_conf;
        struct rte_eth_dev_info dev_info;
        /* skip ports that are not enabled */
        if ((l2fwd_enabled_port_mask & (1 << portid)) == 0) {
            printf("Skipping disabled port %u\n", portid);
            continue;
        }
        nb_ports_available++;
        /* init port */
        printf("Initializing port %u... ", portid);
        fflush(stdout);
        ret = rte_eth_dev_info_get(portid, &dev_info);
        if (ret != 0)
            rte_exit(EXIT_FAILURE,
                "Error during getting device (port %u) info: %s\n",
                portid, strerror(-ret));
        if (dev_info.tx_offload_capa & RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE)
            local_port_conf.txmode.offloads |=
                RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE;

        /* Configure the number of queues for a port. */
        if ((dev_info.max_rx_queues  >= user_rx_queues) && (dev_info.max_tx_queues  >= user_tx_queues)) {
        ret = rte_eth_dev_configure(portid, user_rx_queues, user_tx_queues, &local_port_conf);
        if (ret < 0)
            rte_exit(EXIT_FAILURE, "Cannot configure device: err=%d, port=%u\n",
                  ret, portid);
        /* >8 End of configuration of the number of queues for a port. */
        }

Intel Foundational NIC i350 assign Up to eight queues per port for Physical Funtion driver as per PRODUCT BRIEF Intel® Ethernet Controller I350. With respect to virtual function per port 1 queue for each VF with a total of 8 VF max per port defined under Intel® Ethernet Controller I350 Datasheet.

In Linux, these can be validated by

  1. ethtool: One can check per queue instance with option -S, as statistics is supported per queue.
  2. dpdk: using rte_eth_dev_info_get to get attributes max_rx_queues and max_tx_queues

Note: as VF gets allocated with 1 RX-TX queue pair, the error mentioned -22, Ethdev port_id=0 nb_tx_queues=2 > 1 can be of VF in use. Hence the right way of configuration is first get the DPDK port max rx-tx queues and ensure it is in bounds.

Sample Code Snippet:

 /* Initialise each port */
    RTE_ETH_FOREACH_DEV(portid) {
        struct rte_eth_rxconf rxq_conf;
        struct rte_eth_txconf txq_conf;
        struct rte_eth_conf local_port_conf = port_conf;
        struct rte_eth_dev_info dev_info;
        /* skip ports that are not enabled */
        if ((l2fwd_enabled_port_mask & (1 << portid)) == 0) {
            printf("Skipping disabled port %u\n", portid);
            continue;
        }
        nb_ports_available++;
        /* init port */
        printf("Initializing port %u... ", portid);
        fflush(stdout);
        ret = rte_eth_dev_info_get(portid, &dev_info);
        if (ret != 0)
            rte_exit(EXIT_FAILURE,
                "Error during getting device (port %u) info: %s\n",
                portid, strerror(-ret));
        if (dev_info.tx_offload_capa & RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE)
            local_port_conf.txmode.offloads |=
                RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE;

        /* Configure the number of queues for a port. */
        if ((dev_info.max_rx_queues  >= user_rx_queues) && (dev_info.max_tx_queues  >= user_tx_queues)) {
        ret = rte_eth_dev_configure(portid, user_rx_queues, user_tx_queues, &local_port_conf);
        if (ret < 0)
            rte_exit(EXIT_FAILURE, "Cannot configure device: err=%d, port=%u\n",
                  ret, portid);
        /* >8 End of configuration of the number of queues for a port. */
        }
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文