Skip to content

Commit

Permalink
net/e1000: fix Rx and Tx queue status
Browse files Browse the repository at this point in the history
[ upstream commit b2a0271188f3428ad5dc1ea600e1e2254b9d6781 ]

Igb driver don't enable queue start/stop functions, queue status is not
updated when the HW queue enabled or disabled. It caused application can't
get correct queue status.
This patch fixes the issue by updating the queue states when the queue is
disabled or enabled.

Fixes: be2d648 ("igb: add PF support")

Signed-off-by: Qiming Yang <qiming.yang@intel.com>
Signed-off-by: Mingjin Ye <mingjinx.ye@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
  • Loading branch information
qimingya authored and kevintraynor committed Jul 21, 2023
1 parent 831bf81 commit c7a2de8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/net/e1000/igb_rxtx.c
Original file line number Diff line number Diff line change
Expand Up @@ -1853,6 +1853,7 @@ igb_dev_clear_queues(struct rte_eth_dev *dev)
if (txq != NULL) {
igb_tx_queue_release_mbufs(txq);
igb_reset_tx_queue(txq, dev);
dev->data->tx_queue_state[i] = RTE_ETH_QUEUE_STATE_STOPPED;
}
}

Expand All @@ -1861,6 +1862,7 @@ igb_dev_clear_queues(struct rte_eth_dev *dev)
if (rxq != NULL) {
igb_rx_queue_release_mbufs(rxq);
igb_reset_rx_queue(rxq);
dev->data->rx_queue_state[i] = RTE_ETH_QUEUE_STATE_STOPPED;
}
}
}
Expand Down Expand Up @@ -2441,6 +2443,7 @@ eth_igb_rx_init(struct rte_eth_dev *dev)
rxdctl |= ((rxq->hthresh & 0x1F) << 8);
rxdctl |= ((rxq->wthresh & 0x1F) << 16);
E1000_WRITE_REG(hw, E1000_RXDCTL(rxq->reg_idx), rxdctl);
dev->data->rx_queue_state[i] = RTE_ETH_QUEUE_STATE_STARTED;
}

if (dev->data->dev_conf.rxmode.offloads & RTE_ETH_RX_OFFLOAD_SCATTER) {
Expand Down Expand Up @@ -2605,6 +2608,7 @@ eth_igb_tx_init(struct rte_eth_dev *dev)
txdctl |= ((txq->wthresh & 0x1F) << 16);
txdctl |= E1000_TXDCTL_QUEUE_ENABLE;
E1000_WRITE_REG(hw, E1000_TXDCTL(txq->reg_idx), txdctl);
dev->data->tx_queue_state[i] = RTE_ETH_QUEUE_STATE_STARTED;
}

/* Program the Transmit Control Register. */
Expand Down

0 comments on commit c7a2de8

Please sign in to comment.