The index of the loop was a 16-bit variable which is sufficient for
ring entries number but not for the byte size of the whole ring.
The overflow happens when queue rings are configured for 4096 entries
(descriptor size is 16 bytes). The result is an endless loop.
Signed-off-by: Intel
ixgbe_reset_tx_queue(struct igb_tx_queue *txq)
{
struct igb_tx_entry *txe = txq->sw_ring;
- uint16_t prev, i;
+ uint16_t prev;
+ uint32_t i;
/* Zero out HW ring memory */
for (i = 0; i < sizeof(union ixgbe_adv_tx_desc) * txq->nb_tx_desc; i++) {
volatile union ixgbe_adv_tx_desc *txd = &txq->tx_ring[i];
txd->wb.status = IXGBE_TXD_STAT_DD;
txe[i].mbuf = NULL;
- txe[i].last_id = i;
- txe[prev].next_id = i;
- prev = i;
+ txe[i].last_id = (uint16_t)i;
+ txe[prev].next_id = (uint16_t)i;
+ prev = (uint16_t)i;
}
txq->tx_next_dd = (uint16_t)(txq->tx_rs_thresh - 1);