[PATCH 03/11] net/enetfec: fix buffer descriptor size configuration

Hemant Agrawal hemant.agrawal at nxp.com
Mon Oct 6 10:04:02 CEST 2025


The driver previously allowed arbitrary descriptor counts, which could
lead to misaligned buffer allocations. This patch enforces the use of
fixed descriptor ring sizes for both RX and TX queues, ensuring proper
buffer allocation and avoiding potential runtime issues.

Fixes: bb5b5bf1e5c6 ("net/enetfec: support queue configuration")
Cc: stable at dpdk.org

Signed-off-by: Hemant Agrawal <hemant.agrawal at nxp.com>
---
 drivers/net/enetfec/enet_ethdev.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/enetfec/enet_ethdev.c b/drivers/net/enetfec/enet_ethdev.c
index 7c2926409e..f7a45fcd4d 100644
--- a/drivers/net/enetfec/enet_ethdev.c
+++ b/drivers/net/enetfec/enet_ethdev.c
@@ -384,7 +384,7 @@ enetfec_tx_queue_setup(struct rte_eth_dev *dev,
 		return -ENOMEM;
 	}
 
-	if (nb_desc > MAX_TX_BD_RING_SIZE) {
+	if (nb_desc != MAX_TX_BD_RING_SIZE) {
 		nb_desc = MAX_TX_BD_RING_SIZE;
 		ENETFEC_PMD_WARN("modified the nb_desc to MAX_TX_BD_RING_SIZE");
 	}
@@ -462,7 +462,7 @@ enetfec_rx_queue_setup(struct rte_eth_dev *dev,
 		return -ENOMEM;
 	}
 
-	if (nb_rx_desc > MAX_RX_BD_RING_SIZE) {
+	if (nb_rx_desc != MAX_RX_BD_RING_SIZE) {
 		nb_rx_desc = MAX_RX_BD_RING_SIZE;
 		ENETFEC_PMD_WARN("modified the nb_desc to MAX_RX_BD_RING_SIZE");
 	}
-- 
2.25.1



More information about the stable mailing list