Skip to content

Commit

Permalink
net/iavf: fix stop ordering
Browse files Browse the repository at this point in the history
[ upstream commit 87b2afdea3aae6095aa80956ae2e15f602594185 ]

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: 02d212c ("net/iavf: rename remaining avf strings")

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>
  • Loading branch information
zengzhichao233 authored and kevintraynor committed Jul 21, 2023
1 parent 54b7e8b commit 5a0e075
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions .mailmap
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ Balazs Nemeth <bnemeth@redhat.com> <balazs.nemeth@intel.com>
Bao-Long Tran <longtb5@viettel.com.vn>
Barak Enat <barak@saguna.net>
Barry Cao <barry.cao@nxp.com>
Bartosz Staszewski <bartoszx.staszewski@intel.com>
Baruch Siach <baruch@tkos.co.il>
Bassam Zaid AlKilani <bzalkilani@nvidia.com>
Beilei Xing <beilei.xing@intel.com>
Expand Down
4 changes: 2 additions & 2 deletions drivers/net/iavf/iavf_ethdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -1047,8 +1047,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 */
Expand All @@ -1061,6 +1059,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;

Expand Down

0 comments on commit 5a0e075

Please sign in to comment.