[PATCH 21.11] net/cnxk: fix configuring large Rx/Tx queues

Hanumanth Pothula hpothula at marvell.com
Tue Nov 29 10:04:41 CET 2022


[upstream commit 5a0f64d84bf939aba37527d511fde45e1a9f6f9e]

While configuring NIX, local variables 'nb_rxq' and 'nb_txq'
are declared as 8bit variables, leading to an integer overflow
when an application sends Rxq/Txq value greater than 255.

Hence, declare local variables, 'nb_rxq' and 'nb_txq' as 16bit
variable.

Fixes: b75e0aca84b0 ("net/cnxk: add device configuration operation")

Signed-off-by: Hanumanth Pothula <hpothula at marvell.com>
---
 drivers/net/cnxk/cnxk_ethdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/cnxk/cnxk_ethdev.c b/drivers/net/cnxk/cnxk_ethdev.c
index 8ba35ac36f..67a8dec75b 100644
--- a/drivers/net/cnxk/cnxk_ethdev.c
+++ b/drivers/net/cnxk/cnxk_ethdev.c
@@ -1034,7 +1034,7 @@ cnxk_nix_configure(struct rte_eth_dev *eth_dev)
 	struct roc_nix_fc_cfg fc_cfg = {0};
 	struct roc_nix *nix = &dev->nix;
 	struct rte_ether_addr *ea;
-	uint8_t nb_rxq, nb_txq;
+	uint16_t nb_rxq, nb_txq;
 	uint64_t rx_cfg;
 	void *qs;
 	int rc;
-- 
2.25.1



More information about the stable mailing list