Skip to content

Commit

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

Ixgbevf 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: 429c6d8 ("ixgbe: prepare for vector pmd")
Fixes: f0c50e5 ("ixgbe: move PMD specific fields out of base driver")

Signed-off-by: Qiming Yang <qiming.yang@intel.com>
Signed-off-by: Jie Hai <haijie1@huawei.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
  • Loading branch information
qimingya authored and kevintraynor committed Jul 21, 2023
1 parent 68c3c76 commit a821b02
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions drivers/net/ixgbe/ixgbe_rxtx.c
Original file line number Diff line number Diff line change
Expand Up @@ -3380,6 +3380,7 @@ ixgbe_dev_clear_queues(struct rte_eth_dev *dev)
if (txq != NULL) {
txq->ops->release_mbufs(txq);
txq->ops->reset(txq);
dev->data->tx_queue_state[i] = RTE_ETH_QUEUE_STATE_STOPPED;
}
}

Expand All @@ -3389,6 +3390,7 @@ ixgbe_dev_clear_queues(struct rte_eth_dev *dev)
if (rxq != NULL) {
ixgbe_rx_queue_release_mbufs(rxq);
ixgbe_reset_rx_queue(adapter, rxq);
dev->data->rx_queue_state[i] = RTE_ETH_QUEUE_STATE_STOPPED;
}
}
/* If loopback mode was enabled, reconfigure the link accordingly */
Expand Down Expand Up @@ -5826,6 +5828,8 @@ ixgbevf_dev_rxtx_start(struct rte_eth_dev *dev)
} while (--poll_ms && !(txdctl & IXGBE_TXDCTL_ENABLE));
if (!poll_ms)
PMD_INIT_LOG(ERR, "Could not enable Tx Queue %d", i);
else
dev->data->tx_queue_state[i] = RTE_ETH_QUEUE_STATE_STARTED;
}
for (i = 0; i < dev->data->nb_rx_queues; i++) {

Expand All @@ -5843,6 +5847,8 @@ ixgbevf_dev_rxtx_start(struct rte_eth_dev *dev)
} while (--poll_ms && !(rxdctl & IXGBE_RXDCTL_ENABLE));
if (!poll_ms)
PMD_INIT_LOG(ERR, "Could not enable Rx Queue %d", i);
else
dev->data->rx_queue_state[i] = RTE_ETH_QUEUE_STATE_STARTED;
rte_wmb();
IXGBE_WRITE_REG(hw, IXGBE_VFRDT(i), rxq->nb_rx_desc - 1);

Expand Down

0 comments on commit a821b02

Please sign in to comment.