Skip to content

Commit

Permalink
net/dpaa: fix Rx and Tx queue state
Browse files Browse the repository at this point in the history
[ upstream commit f1d381b48d4673b14eb3c3378f3b890334015489 ]

The DPDK framework reports the queue state, which is stored in
dev->data->tx_queue_state and dev->data->rx_queue_state. The
state is maintained by the driver. Users may determine whether
a queue participates in packet forwarding based on the state.
Therefore, the driver needs to modify the queue state in time
according to the actual situation.

Fixes: 9ad9ff4 ("ethdev: add queue state in queried queue information")

Signed-off-by: Jie Hai <haijie1@huawei.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
  • Loading branch information
Jie Hai authored and kevintraynor committed Oct 31, 2023
1 parent 92c7732 commit 87695a1
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions drivers/net/dpaa/dpaa_ethdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,7 @@ static void dpaa_interrupt_handler(void *param)
static int dpaa_eth_dev_start(struct rte_eth_dev *dev)
{
struct dpaa_if *dpaa_intf = dev->data->dev_private;
uint16_t i;

PMD_INIT_FUNC_TRACE();

Expand All @@ -401,12 +402,18 @@ static int dpaa_eth_dev_start(struct rte_eth_dev *dev)

fman_if_enable_rx(dev->process_private);

for (i = 0; i < dev->data->nb_rx_queues; i++)
dev->data->rx_queue_state[i] = RTE_ETH_QUEUE_STATE_STARTED;
for (i = 0; i < dev->data->nb_tx_queues; i++)
dev->data->tx_queue_state[i] = RTE_ETH_QUEUE_STATE_STARTED;

return 0;
}

static int dpaa_eth_dev_stop(struct rte_eth_dev *dev)
{
struct fman_if *fif = dev->process_private;
uint16_t i;

PMD_INIT_FUNC_TRACE();
dev->data->dev_started = 0;
Expand All @@ -415,6 +422,11 @@ static int dpaa_eth_dev_stop(struct rte_eth_dev *dev)
fman_if_disable_rx(fif);
dev->tx_pkt_burst = dpaa_eth_tx_drop_all;

for (i = 0; i < dev->data->nb_rx_queues; i++)
dev->data->rx_queue_state[i] = RTE_ETH_QUEUE_STATE_STOPPED;
for (i = 0; i < dev->data->nb_tx_queues; i++)
dev->data->tx_queue_state[i] = RTE_ETH_QUEUE_STATE_STOPPED;

return 0;
}

Expand Down

0 comments on commit 87695a1

Please sign in to comment.