From 43b29221c1f13189f41d5200027a22f11149dfee Mon Sep 17 00:00:00 2001 From: Qi Zhang Date: Thu, 25 Jul 2019 12:38:29 +0800 Subject: [PATCH] net/iavf: fix endless loop Change loop index from uint16_t to uint32_t since max index 65535 could be exceeded when ring size is 2k+. Fixes: 69dd4c3d0898 ("net/avf: enable queue and device") Cc: stable@dpdk.org Reported-by: Lei Yao Signed-off-by: Qi Zhang Reviewed-by: Xiaolong Ye --- drivers/net/iavf/iavf_rxtx.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/net/iavf/iavf_rxtx.c b/drivers/net/iavf/iavf_rxtx.c index d8eb6d296c..22d7bb6127 100644 --- a/drivers/net/iavf/iavf_rxtx.c +++ b/drivers/net/iavf/iavf_rxtx.c @@ -144,7 +144,8 @@ check_rx_bulk_allow(struct iavf_rx_queue *rxq) static inline void reset_rx_queue(struct iavf_rx_queue *rxq) { - uint16_t len, i; + uint16_t len; + uint32_t i; if (!rxq) return; @@ -174,7 +175,8 @@ static inline void reset_tx_queue(struct iavf_tx_queue *txq) { struct iavf_tx_entry *txe; - uint16_t i, prev, size; + uint32_t i, size; + uint16_t prev; if (!txq) { PMD_DRV_LOG(DEBUG, "Pointer to txq is NULL"); -- 2.20.1