Skip to content

Commit

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

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 a508510 commit 91c5c25
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions drivers/net/vmxnet3/vmxnet3_ethdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -890,6 +890,7 @@ vmxnet3_dev_start(struct rte_eth_dev *dev)
{
int ret;
struct vmxnet3_hw *hw = dev->data->dev_private;
uint16_t i;

PMD_INIT_FUNC_TRACE();

Expand Down Expand Up @@ -985,6 +986,11 @@ vmxnet3_dev_start(struct rte_eth_dev *dev)
*/
__vmxnet3_dev_link_update(dev, 0);

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 VMXNET3_SUCCESS;
}

Expand All @@ -997,6 +1003,7 @@ vmxnet3_dev_stop(struct rte_eth_dev *dev)
struct rte_eth_link link;
struct vmxnet3_hw *hw = dev->data->dev_private;
struct rte_intr_handle *intr_handle = dev->intr_handle;
uint16_t i;
int ret;

PMD_INIT_FUNC_TRACE();
Expand Down Expand Up @@ -1052,6 +1059,11 @@ vmxnet3_dev_stop(struct rte_eth_dev *dev)
hw->adapter_stopped = 1;
dev->data->dev_started = 0;

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 91c5c25

Please sign in to comment.