[v2,6/8] net/hns3: fix data type to release fake queue > 255

Message ID 1603973875-8431-7-git-send-email-oulijun@huawei.com (mailing list archive)
State Superseded, archived
Delegated to: Ferruh Yigit
Headers
Series hns3 misc updates |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Lijun Ou Oct. 29, 2020, 12:17 p.m. UTC
  From: Huisong Li <lihuisong@huawei.com>

Currently, u8 type variable is used to control to release fake queues in
hns3_fake_rx/tx_queue_config function. Although there is no case in which
more than 256 fake queues are created in hns3 network engine, it is
unreasonable to compare u8 variable with u16 variable.

Fixes: a951c1ed3ab5 ("net/hns3: support different numbers of Rx and Tx queues")
Cc: stable@dpdk.org

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Lijun Ou <oulijun@huawei.com>
---
 drivers/net/hns3/hns3_rxtx.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
  

Patch

diff --git a/drivers/net/hns3/hns3_rxtx.c b/drivers/net/hns3/hns3_rxtx.c
index 3d5e465..3386453 100644
--- a/drivers/net/hns3/hns3_rxtx.c
+++ b/drivers/net/hns3/hns3_rxtx.c
@@ -1378,7 +1378,7 @@  hns3_fake_rx_queue_config(struct hns3_hw *hw, uint16_t nb_queues)
 {
 	uint16_t old_nb_queues = hw->fkq_data.nb_fake_rx_queues;
 	void **rxq;
-	uint8_t i;
+	uint16_t i;
 
 	if (hw->fkq_data.rx_queues == NULL && nb_queues != 0) {
 		/* first time configuration */
@@ -1425,7 +1425,7 @@  hns3_fake_tx_queue_config(struct hns3_hw *hw, uint16_t nb_queues)
 {
 	uint16_t old_nb_queues = hw->fkq_data.nb_fake_tx_queues;
 	void **txq;
-	uint8_t i;
+	uint16_t i;
 
 	if (hw->fkq_data.tx_queues == NULL && nb_queues != 0) {
 		/* first time configuration */