net/iavf: fix the order of closing Rx queue
Checks
Commit Message
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: stable@dpdk.org
Signed-off-by: Bartosz Staszewski <bartoszx.staszewski@intel.com>
Signed-off-by: Zhichao Zeng <zhichaox.zeng@intel.com>
---
drivers/net/iavf/iavf_ethdev.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
Comments
> -----Original Message-----
> From: Zeng, ZhichaoX <zhichaox.zeng@intel.com>
> Sent: Wednesday, July 12, 2023 1:36 PM
> To: dev@dpdk.org
> Cc: stable@dpdk.org; Zhang, Qi Z <qi.z.zhang@intel.com>; Staszewski, BartoszX
> <bartoszx.staszewski@intel.com>; Zeng, ZhichaoX <zhichaox.zeng@intel.com>;
> Wu, Jingjing <jingjing.wu@intel.com>; Xing, Beilei <beilei.xing@intel.com>;
> Ferruh Yigit <ferruh.yigit@intel.com>; Rong, Leyi <leyi.rong@intel.com>
> Subject: [PATCH] net/iavf: fix the order of closing Rx queue
>
> 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: stable@dpdk.org
> Signed-off-by: Bartosz Staszewski <bartoszx.staszewski@intel.com>
> Signed-off-by: Zhichao Zeng <zhichaox.zeng@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Applied to dpdk-next-net-intel.
Thanks
Qi
@@ -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;