The current implementation stops queue before disabling the Rx interrupt,
and when there are still unprocessed packets remaining in the queue,
this may cause the Rx ring to timeout, leading to IOMMU fault.

This patch disables the Rx interrupt before stopping the queue, ensuring
that no packets received when disabling the queues.

Fixes: 02d212ca3125 ("net/iavf: rename remaining avf strings")
Cc: sta...@dpdk.org
Signed-off-by: Bartosz Staszewski <bartoszx.staszew...@intel.com>
Signed-off-by: Zhichao Zeng <zhichaox.z...@intel.com>
---
 drivers/net/iavf/iavf_ethdev.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/iavf/iavf_ethdev.c b/drivers/net/iavf/iavf_ethdev.c
index ac7154d720..f2fc5a5621 100644
--- a/drivers/net/iavf/iavf_ethdev.c
+++ b/drivers/net/iavf/iavf_ethdev.c
@@ -1087,8 +1087,6 @@ iavf_dev_stop(struct rte_eth_dev *dev)
        if (adapter->stopped == 1)
                return 0;
 
-       iavf_stop_queues(dev);
-
        /* Disable the interrupt for Rx */
        rte_intr_efd_disable(intr_handle);
        /* Rx interrupt vector mapping free */
@@ -1101,6 +1099,8 @@ iavf_dev_stop(struct rte_eth_dev *dev)
        iavf_add_del_mc_addr_list(adapter, vf->mc_addrs, vf->mc_addrs_num,
                                  false);
 
+       iavf_stop_queues(dev);
+
        adapter->stopped = 1;
        dev->data->dev_started = 0;
 
-- 
2.34.1

Reply via email to