[PATCH v5 01/10] net/iavf: keep device stopped if start fails
Anatoly Burakov
anatoly.burakov at intel.com
Fri Oct 23 11:32:21 CEST 2026
Currently, `iavf_dev_start()` clears `adapter->stopped` before several
operations that can fail. A subsequent `iavf_dev_stop()` then disables
interrupts and stops and resets queues even though startup did not
complete.
Mark the adapter running only after startup succeeds, and return early
from stop when it is already stopped.
Fixes: 69dd4c3d0898 ("net/avf: enable queue and device")
Cc: stable at dpdk.org
Signed-off-by: Anatoly Burakov <anatoly.burakov at intel.com>
Acked-by: Bruce Richardson <bruce.richardson at intel.com>
---
drivers/net/intel/iavf/iavf_ethdev.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/drivers/net/intel/iavf/iavf_ethdev.c b/drivers/net/intel/iavf/iavf_ethdev.c
index 9e0e13d4992..1ec9e946fc4 100644
--- a/drivers/net/intel/iavf/iavf_ethdev.c
+++ b/drivers/net/intel/iavf/iavf_ethdev.c
@@ -1039,8 +1039,6 @@ iavf_dev_start(struct rte_eth_dev *dev)
if (adapter->closed)
return -1;
- adapter->stopped = 0;
-
vf->max_pkt_len = dev->data->mtu + IAVF_ETH_OVERHEAD;
vf->num_queue_pairs = RTE_MAX(dev->data->nb_rx_queues,
dev->data->nb_tx_queues);
@@ -1112,6 +1110,7 @@ iavf_dev_start(struct rte_eth_dev *dev)
}
iavf_phc_sync_alarm_start(dev);
+ adapter->stopped = 0;
/* An explicit start supersedes any pending deferred start */
vf->start_pending = false;
@@ -1135,13 +1134,13 @@ iavf_dev_stop(struct rte_eth_dev *dev)
if (adapter->closed)
return -1;
+ if (adapter->stopped == 1)
+ return 0;
+
if (!(vf->vf_res->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_WB_ON_ITR) &&
dev->data->dev_conf.intr_conf.rxq != 0)
rte_intr_disable(intr_handle);
- if (adapter->stopped == 1)
- return 0;
-
iavf_phc_sync_alarm_stop(dev);
/* Disable the interrupt for Rx */
--
2.52.0
More information about the dev
mailing list