[PATCH v1 1/1] net/nbl: fix queue count issue on port restart
Dimon Zhao
dimon.zhao at nebula-matrix.com
Sat Feb 28 03:12:11 CET 2026
Remove tx_ring_num and rx_ring_num from struct nbl_txrx_mgt to fix
an issue where these counts keep increasing during port stop/start cycles.
The counts were incremented in tx_queue_setup/rx_queue_setup, but never
decremented. This causes incorrect queue counts after multiple port
restarts. Since the actual queue counts are already available via
eth_dev->data->nb_tx_queues and nb_rx_queues, use those instead.
Update nbl_res_txrx_get_xstats() to use eth_dev->data->nb_rx_queues.
Fixes: 661c0ccf2512 ("net/nbl: support statistics")
Cc: stable at dpdk.org
Signed-off-by: Dimon Zhao <dimon.zhao at nebula-matrix.com>
---
drivers/net/nbl/nbl_hw/nbl_resource.h | 2 --
drivers/net/nbl/nbl_hw/nbl_txrx.c | 6 ++----
2 files changed, 2 insertions(+), 6 deletions(-)
diff --git a/drivers/net/nbl/nbl_hw/nbl_resource.h b/drivers/net/nbl/nbl_hw/nbl_resource.h
index 469c3f5827..bf5a9461f5 100644
--- a/drivers/net/nbl/nbl_hw/nbl_resource.h
+++ b/drivers/net/nbl/nbl_hw/nbl_resource.h
@@ -219,8 +219,6 @@ struct nbl_txrx_mgt {
struct nbl_res_tx_ring **tx_rings;
struct nbl_res_rx_ring **rx_rings;
u16 queue_offset;
- u8 tx_ring_num;
- u8 rx_ring_num;
};
struct nbl_res_info {
diff --git a/drivers/net/nbl/nbl_hw/nbl_txrx.c b/drivers/net/nbl/nbl_hw/nbl_txrx.c
index 48f20e4f4c..f29f0a6d5b 100644
--- a/drivers/net/nbl/nbl_hw/nbl_txrx.c
+++ b/drivers/net/nbl/nbl_hw/nbl_txrx.c
@@ -212,7 +212,6 @@ static int nbl_res_txrx_start_tx_ring(void *priv,
eth_dev->data->tx_queues[param->queue_idx] = tx_ring;
txrx_mgt->tx_rings[param->queue_idx] = tx_ring;
- txrx_mgt->tx_ring_num++;
*dma_addr = tx_ring->ring_phys_addr;
@@ -366,7 +365,6 @@ static int nbl_res_txrx_start_rx_ring(void *priv,
eth_dev->data->rx_queues[param->queue_idx] = rx_ring;
txrx_mgt->rx_rings[param->queue_idx] = rx_ring;
- txrx_mgt->rx_ring_num++;
*dma_addr = rx_ring->ring_phys_addr;
@@ -879,7 +877,7 @@ static int nbl_res_txrx_get_xstats(void *priv, struct rte_eth_xstat *xstats,
u16 need_xstats_cnt, u16 *xstats_cnt)
{
struct nbl_resource_mgt *res_mgt = (struct nbl_resource_mgt *)priv;
- struct nbl_txrx_mgt *txrx_mgt = NBL_RES_MGT_TO_TXRX_MGT(res_mgt);
+ struct rte_eth_dev *eth_dev = res_mgt->eth_dev;
struct nbl_res_rx_ring *rxq;
uint64_t rx_multi_descs = 0, rx_drop_noport = 0, rx_drop_proto = 0;
u64 txrx_xstats[3];
@@ -887,7 +885,7 @@ static int nbl_res_txrx_get_xstats(void *priv, struct rte_eth_xstat *xstats,
u16 count = *xstats_cnt;
/* todo: get eth stats from emp */
- for (i = 0; i < txrx_mgt->rx_ring_num; i++) {
+ for (i = 0; i < eth_dev->data->nb_rx_queues; i++) {
rxq = NBL_RES_MGT_TO_RX_RING(res_mgt, i);
if (unlikely(rxq == NULL))
--
2.34.1
More information about the stable
mailing list