Skip to content
Permalink
Browse files

net/avf: fix endless loop

[ upstream commit 43b29221c1f13189f41d5200027a22f11149dfee ]

Change loop index from uint16_t to uint32_t since max
index 65535 could be exceeded when ring size is 2k+.

Fixes: 69dd4c3 ("net/avf: enable queue and device")

Reported-by: Lei Yao <lei.a.yao@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Reviewed-by: Xiaolong Ye <xiaolong.ye@intel.com>
  • Loading branch information...
Qi Zhang authored and kevintraynor committed Jul 25, 2019
1 parent c93d353 commit c452a379d36f0c8b99c38deca831606f848f7a10
Showing with 4 additions and 2 deletions.
  1. +4 −2 drivers/net/avf/avf_rxtx.c
@@ -144,7 +144,8 @@ check_rx_bulk_allow(struct avf_rx_queue *rxq)
static inline void
reset_rx_queue(struct avf_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 avf_tx_queue *txq)
{
struct avf_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");

0 comments on commit c452a37

Please sign in to comment.
You can’t perform that action at this time.