Skip to content

Commit

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

Igc 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: a5aeb2b ("net/igc: support Rx and Tx")

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 a821b02 commit 831bf81
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/net/igc/igc_txrx.c
Original file line number Diff line number Diff line change
Expand Up @@ -1291,6 +1291,7 @@ igc_rx_init(struct rte_eth_dev *dev)
dvmolr |= IGC_DVMOLR_STRCRC;

IGC_WRITE_REG(hw, IGC_DVMOLR(rxq->reg_idx), dvmolr);
dev->data->rx_queue_state[i] = RTE_ETH_QUEUE_STATE_STARTED;
}

return 0;
Expand Down Expand Up @@ -1934,6 +1935,7 @@ igc_dev_clear_queues(struct rte_eth_dev *dev)
if (txq != NULL) {
igc_tx_queue_release_mbufs(txq);
igc_reset_tx_queue(txq);
dev->data->tx_queue_state[i] = RTE_ETH_QUEUE_STATE_STOPPED;
}
}

Expand All @@ -1942,6 +1944,7 @@ igc_dev_clear_queues(struct rte_eth_dev *dev)
if (rxq != NULL) {
igc_rx_queue_release_mbufs(rxq);
igc_reset_rx_queue(rxq);
dev->data->rx_queue_state[i] = RTE_ETH_QUEUE_STATE_STOPPED;
}
}
}
Expand Down Expand Up @@ -2187,6 +2190,7 @@ igc_tx_init(struct rte_eth_dev *dev)
IGC_TXDCTL_WTHRESH_MSK;
txdctl |= IGC_TXDCTL_QUEUE_ENABLE;
IGC_WRITE_REG(hw, IGC_TXDCTL(txq->reg_idx), txdctl);
dev->data->tx_queue_state[i] = RTE_ETH_QUEUE_STATE_STARTED;
}

igc_config_collision_dist(hw);
Expand Down

0 comments on commit 831bf81

Please sign in to comment.