net/iavf: fix endless loop
PATCH v2 1/1 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+.
---
v2:
- add missing fix in reset_tx_queue.
drivers/net/iavf/iavf_rxtx.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/net/iavf/iavf_rxtx.c +4 -2
@@ -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" );
Signature · 1 line
2.13.6
Quoted 42 lines · Qi Zhang
Change loop index from
uint16_ttouint32_tsince max index 65535 could be exceeded when ring size is 2k+.Fixes 69dd4c3d0898 ("net/avf: enable queue and device")Reported-by Lei Yao <[email protected]>Signed-off-by Qi Zhang <[email protected]>---
v2:
- add missing fix inreset_tx_queue.
drivers/net/iavf/iavf_rxtx.c| 6 ++++--1 file changed, 4 insertions(+), 2 deletions(-)drivers/net/iavf/iavf_rxtx.c +0
-0@@ -144,7 +144,8 @@ check_rx_bulk_allow(struct iavf_rx_queue *rxq)static inline void
reset_rx_queue(struct iavf_rx_queue *rxq)
{drivers/net/iavf/iavf_rxtx.c +2
-1-uint16_t len, i; +uint16_t len; +uint32_t i;if (!rxq) return;drivers/net/iavf/iavf_rxtx.c +2
-1@@ -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" );Signature · 1 line
2.13.6
Zhang, Qi Z
AppliedQuoted 15 lines
-----Original Message-----
From: Ye, Xiaolong
Sent: Thursday, July 25, 2019 8:47 PM
To: Zhang, Qi Z <[email protected]>
Cc: Lu, Wenzhuo <[email protected]>; Wu, Jingjing <[email protected]>; Yao, Lei <[email protected]>; [email protected]; [email protected]
Subject: Re: [dpdk-dev] [PATCH v2] net/iavf: fix endless loopQuoted 3 lines · Qi Zhang
Change loop index from
uint16_ttouint32_tsince max index 65535 could be exceeded when ring size is 2k+.
Quoted 8 lines
Quoted 6 lines
Fixes 69dd4c3d0898 ("net/avf: enable queue and device")Reported-by Lei Yao <[email protected]>Signed-off-by Qi Zhang <[email protected]>---
Reviewed-by Xiaolong Ye <[email protected]>
Applied to dpdk-next-net-intel.
Thanks
Qi