Skip to content

Commit

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

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: Ferruh Yigit <ferruh.yigit@amd.com>
  • Loading branch information
Jie Hai authored and kevintraynor committed Oct 31, 2023
1 parent bd403e9 commit eb249c2
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions drivers/net/mvpp2/mrvl_ethdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -956,6 +956,9 @@ mrvl_dev_start(struct rte_eth_dev *dev)
goto out;
}

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

mrvl_flow_init(dev);
mrvl_mtr_init(dev);
mrvl_set_tx_function(dev);
Expand Down Expand Up @@ -1081,6 +1084,13 @@ mrvl_flush_bpool(struct rte_eth_dev *dev)
static int
mrvl_dev_stop(struct rte_eth_dev *dev)
{
uint16_t i;

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 mrvl_dev_set_link_down(dev);
}

Expand Down

0 comments on commit eb249c2

Please sign in to comment.