Commit 41515403f184 ("net/iavf: disable promiscuous mode on close")
introduced logic that disabled promiscuous mode when closing the device.
However this logic was effectively disabled by commit 676d986b4b86
("net/iavf: fix crash after VF reset failure") which prevented the
configuration of promiscuous mode when the adapter was marked as
"closed". Re-enable the disabling logic by moving it to earlier in the
device close function, before the adapter is marked as "closed".
Fixes: 676d986b4b86 ("net/iavf: fix crash after VF reset failure")
Cc: [email protected]
Signed-off-by: Ciara Loftus <[email protected]>
---
drivers/net/intel/iavf/iavf_ethdev.c | 14 ++++++--------
1 file changed, 6 insertions(+), 8 deletions(-)
diff --git a/drivers/net/intel/iavf/iavf_ethdev.c
b/drivers/net/intel/iavf/iavf_ethdev.c
index 1eca20bc9a..2858cd4cb5 100644
--- a/drivers/net/intel/iavf/iavf_ethdev.c
+++ b/drivers/net/intel/iavf/iavf_ethdev.c
@@ -2955,6 +2955,12 @@ iavf_dev_close(struct rte_eth_dev *dev)
vf->max_rss_qregion = IAVF_MAX_NUM_QUEUES_DFLT;
}
+ /* Disable promiscuous mode before resetting the VF. This is to avoid
+ * potential issues when the PF is bound to the kernel driver.
+ */
+ if (vf->promisc_unicast_enabled || vf->promisc_multicast_enabled)
+ iavf_config_promisc(adapter, false, false);
+
adapter->closed = true;
/* free iAVF security device context all related resources */
@@ -2966,14 +2972,6 @@ iavf_dev_close(struct rte_eth_dev *dev)
iavf_flow_flush(dev, NULL);
iavf_flow_uninit(adapter);
- /*
- * disable promiscuous mode before reset vf
- * it is a workaround solution when work with kernel driver
- * and it is not the normal way
- */
- if (vf->promisc_unicast_enabled || vf->promisc_multicast_enabled)
- iavf_config_promisc(adapter, false, false);
-
iavf_vf_reset(hw);
iavf_shutdown_adminq(hw);
if (vf->vf_res->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_WB_ON_ITR) {
--
2.43.0