Skip to content

Commit

Permalink
net/gve: fix queue setup and stop
Browse files Browse the repository at this point in the history
Update the Tx/Rx queue setup/stop routines that are unique to DQO,
so that they may be called for instances that use the DQO RDA format
during dev start/stop

Fixes: b044845 ("net/gve: support queue start/stop")
Cc: stable@dpdk.org

Signed-off-by: Tathagat Priyadarshi <tathagat.dpdk@gmail.com>
Acked-by: Joshua Washington <joshwash@google.com>
  • Loading branch information
priyadarshitathagat authored and ferruhy committed Jul 31, 2024
1 parent 4b5abe7 commit 64daee9
Showing 1 changed file with 23 additions and 6 deletions.
29 changes: 23 additions & 6 deletions drivers/net/gve/gve_ethdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -288,11 +288,16 @@ gve_start_queues(struct rte_eth_dev *dev)
PMD_DRV_LOG(ERR, "Failed to create %u tx queues.", num_queues);
return ret;
}
for (i = 0; i < num_queues; i++)
if (gve_tx_queue_start(dev, i) != 0) {
for (i = 0; i < num_queues; i++) {
if (gve_is_gqi(priv))
ret = gve_tx_queue_start(dev, i);
else
ret = gve_tx_queue_start_dqo(dev, i);
if (ret != 0) {
PMD_DRV_LOG(ERR, "Fail to start Tx queue %d", i);
goto err_tx;
}
}

num_queues = dev->data->nb_rx_queues;
priv->rxqs = (struct gve_rx_queue **)dev->data->rx_queues;
Expand All @@ -315,9 +320,15 @@ gve_start_queues(struct rte_eth_dev *dev)
return 0;

err_rx:
gve_stop_rx_queues(dev);
if (gve_is_gqi(priv))
gve_stop_rx_queues(dev);
else
gve_stop_rx_queues_dqo(dev);
err_tx:
gve_stop_tx_queues(dev);
if (gve_is_gqi(priv))
gve_stop_tx_queues(dev);
else
gve_stop_tx_queues_dqo(dev);
return ret;
}

Expand Down Expand Up @@ -362,10 +373,16 @@ gve_dev_start(struct rte_eth_dev *dev)
static int
gve_dev_stop(struct rte_eth_dev *dev)
{
struct gve_priv *priv = dev->data->dev_private;
dev->data->dev_link.link_status = RTE_ETH_LINK_DOWN;

gve_stop_tx_queues(dev);
gve_stop_rx_queues(dev);
if (gve_is_gqi(priv)) {
gve_stop_tx_queues(dev);
gve_stop_rx_queues(dev);
} else {
gve_stop_tx_queues_dqo(dev);
gve_stop_rx_queues_dqo(dev);
}

dev->data->dev_started = 0;

Expand Down

0 comments on commit 64daee9

Please sign in to comment.