我有一个应用程序,它使用DPDK作为快速路径。在DPDK初始化期间,我试图为一个端口配置两个TX队列,但它未能配置eth设备。
我正在使用英特尔IGB驱动程序(I350网卡)上的裸金属设置。根据DPDK文档,IGB Poll模式驱动程序(https://doc.dpdk.org/guides/nics/igb.html)应该支持端口的多个RX/TX队列。我试图为一个端口配置两个TX队列( port_id= 0 ),当调用API "rte_eth_dev_configure(portid = 0,nb_rx_queue = 1,nb_tx_queue = 2,&local_port_conf)“时,它将返回错误代码:-22,"Ethdev port_id=0 nb_tx_queues=2 > 1”。
IGB驱动程序是否支持端口的多个TX队列?还是需要进行任何配置更改以支持多个TX队列?
发布于 2022-06-15 11:40:48
对于虚拟函数,NIC模型只支持单队列模式(来源).
若要测试多队列支持,请考虑将物理函数(PF)传递给设置。
发布于 2022-06-17 09:25:38
英特尔基础网卡i350为物理功能驱动程序指定Up to eight queues per port
作为PRODUCT BRIEF Intel® Ethernet Controller I350
。关于每个端口的虚拟函数,1 queue for each VF
在Intel® Ethernet Controller I350 Datasheet
下定义的每个端口总共有8个VF。
在Linux中,这些都可以通过
-S
检查每个队列实例,因为每个队列都支持统计数据。rte_eth_dev_info_get
获取属性max_rx_queues and max_tx_queues
注意:当VF被分配给一个RX队列对时,提到的-22, Ethdev port_id=0 nb_tx_queues=2 > 1
错误可以使用VF。因此,正确的配置方式是首先获得DPDK端口最大rx队列,并确保它在范围内。
示例代码片段:
/* 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. */
}
https://stackoverflow.com/questions/72627279
复制相似问题