Skip to content

Commit

Permalink
net/iavf: fix queue stop for large VF
Browse files Browse the repository at this point in the history
[ upstream commit 96e66d3 ]

Use large VF queue stop request when large VF is enabled

Fixes: 9cf9c02 ("net/iavf: add enable/disable queues for large VF")

Signed-off-by: Radu Nicolau <radu.nicolau@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
  • Loading branch information
rnicolau authored and kevintraynor committed Nov 7, 2022
1 parent c346009 commit f2a44e4
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions drivers/net/iavf/iavf_rxtx.c
Expand Up @@ -946,6 +946,7 @@ iavf_dev_rx_queue_stop(struct rte_eth_dev *dev, uint16_t rx_queue_id)
{
struct iavf_adapter *adapter =
IAVF_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private);
struct iavf_info *vf = IAVF_DEV_PRIVATE_TO_VF(dev->data->dev_private);
struct iavf_rx_queue *rxq;
int err;

Expand All @@ -954,7 +955,11 @@ iavf_dev_rx_queue_stop(struct rte_eth_dev *dev, uint16_t rx_queue_id)
if (rx_queue_id >= dev->data->nb_rx_queues)
return -EINVAL;

err = iavf_switch_queue(adapter, rx_queue_id, true, false);
if (!vf->lv_enabled)
err = iavf_switch_queue(adapter, rx_queue_id, true, false);
else
err = iavf_switch_queue_lv(adapter, rx_queue_id, true, false);

if (err) {
PMD_DRV_LOG(ERR, "Failed to switch RX queue %u off",
rx_queue_id);
Expand All @@ -974,6 +979,7 @@ iavf_dev_tx_queue_stop(struct rte_eth_dev *dev, uint16_t tx_queue_id)
{
struct iavf_adapter *adapter =
IAVF_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private);
struct iavf_info *vf = IAVF_DEV_PRIVATE_TO_VF(dev->data->dev_private);
struct iavf_tx_queue *txq;
int err;

Expand All @@ -982,7 +988,11 @@ iavf_dev_tx_queue_stop(struct rte_eth_dev *dev, uint16_t tx_queue_id)
if (tx_queue_id >= dev->data->nb_tx_queues)
return -EINVAL;

err = iavf_switch_queue(adapter, tx_queue_id, false, false);
if (!vf->lv_enabled)
err = iavf_switch_queue(adapter, tx_queue_id, false, false);
else
err = iavf_switch_queue_lv(adapter, tx_queue_id, false, false);

if (err) {
PMD_DRV_LOG(ERR, "Failed to switch TX queue %u off",
tx_queue_id);
Expand Down

0 comments on commit f2a44e4

Please sign in to comment.