net/mlx5: dev_info.tx_desc_lim.nb_min is zero (uninitialized), causing port start failure when TX descriptors set to 0
http://bugs.dpdk.org/show_bug.cgi?id=1879
Bug ID: 1879
Summary: net/mlx5: dev_info.tx_desc_lim.nb_min is zero
(uninitialized), causing port start failure when TX descriptors set to 0
Product: DPDK
Version: 26.03
Hardware: x86
OS: Linux
Status: UNCONFIRMED
Severity: normal
Priority: Normal
Component: ethdev
Assignee: [email protected]
Reporter: [email protected]
Target Milestone: ---
Description
===========
The Mellanox (mlx5) PMD driver does not populate dev_info.tx_desc_lim.nb_min with a valid value. It currently reports 0 (zero) as the minimum number of TX descriptors. This leads to a port start failure when an application configures a minimum number of TX descriptors on a TX queue, because the driver accepts the configuration but then fails internally during port start.
This is particularly problematic for applications that are RX-only (packet capture/reading applications) and have no intention of transmitting any packets. Such applications should logically be able to set TX descriptor count to 0 or at least to a very small number to conserve resources, but the current behavior makes this impossible.
Steps to Reproduce
==================
1. Call rte_eth_dev_info_get() and observe that dev_info.tx_desc_lim.nb_min == 0.
2. Configure a TX queue with nb_tx_desc = 0 via rte_eth_tx_queue_setup(). Since nb_min is 0, the ethdev layer does not reject this configuration.
3. Attempt to start the port with rte_eth_dev_start().
4. Port start fails.
Note: This bug cannot be reproduced using testpmd, because testpmd has internal logic that prevents setting the TX descriptor count to zero (it enforces its own minimum regardless of what the driver reports). This means the bug is effectively hidden from the most common DPDK testing tool. I could reproduce it in Suricata.
Expected Behavior
=================
The mlx5 driver should report a correct, non-zero nb_min value in dev_info.tx_desc_lim.nb_min (matching the actual hardware/driver minimum). This way, the ethdev layer can properly validate the number of TX descriptors at configuration time and return a clear error to the user, rather than silently accepting an invalid configuration that fails later during port start.
Actual Behavior
===============
dev_info.tx_desc_lim.nb_min is reported as 0. The ethdev layer allows configuring 0 TX descriptors (since 0 >= nb_min which is 0). The port then fails to start with no clear indication that the root cause is the zero TX descriptor count.
When set to less than 32, the driver complains about the value being lower than MLX5_TX_COMP_THRESH, but this macro is not available in the user application code.
``` $ sudo dpdk-testpmd -a 0000:3b:00.0 -- -i --forward-mode=rxonly --txd=16 ... mlx5_net: port 0 number of descriptors requested for Tx queue 0 must be higher than MLX5_TX_COMP_THRESH, using 33 instead of 16 mlx5_net: port 0 increased number of descriptors in Tx queue 0 to the next power of two (64) ... ```
Additional Remarks
==================
Previous DPDK versions allowed configuration of 0 TX descriptors. On some sites I've found, DPDK devices should not be configured with 0 TX descriptors but I see no reason for not doing so.
Environment
===========
- DPDK version: 26.03-dev (dce76acf61859242946e619cf6113de5e134b117)
- NIC: Mellanox ConnectX-6 (mlx5 PMD)
- OS: Oracle Linux 8
- Architecture: x86_64
Signature · 2 lines
You are receiving this mail because: You are the assignee for the bug.