public inbox for dev@dpdk.org
 help / color / mirror / Atom feed
* [PATCH 0/4] net/iavf: improve VF reset resilience
@ 2026-03-31 13:01 Ciara Loftus
  2026-03-31 13:01 ` [PATCH 1/4] net/iavf: fix disabling of promiscuous modes on device close Ciara Loftus
                   ` (4 more replies)
  0 siblings, 5 replies; 8+ messages in thread
From: Ciara Loftus @ 2026-03-31 13:01 UTC (permalink / raw)
  To: dev; +Cc: Ciara Loftus

Previously, VF recovery from PF-initiated resets required explicit
opt-in via auto_reset, leaving VFs non-functional by default after a
reset unless the application handled it. This series makes transparent
recovery including the restoration of settings the default, and
implements some fixes related to the reset path as well.

Patch 1 fixes a regression which prevented promiscuous mode from being
disabled before sending the RESET_VF message to the PF during device
close.

Patch 2 enables the auto_reset and no-poll-on-link-down devargs
by default so VFs recover from resets without the need to introduce any
reset handling in the application.

Patch 3 introduces a new auto_reconfig devarg (on by default) which
extends the recovery path to restore unicast and multicast promiscuous
state after a reset. Restoration of additional settings such as VLAN
filters could be added under the same mechanism in a follow-up series.

Patch 4 fixes a minor logging issue.

Ciara Loftus (4):
  net/iavf: fix disabling of promiscuous modes on device close
  net/iavf: enable auto reset by default
  net/iavf: enable post-reset restoration of VF settings
  net/iavf: fix reset handling error log

 doc/guides/nics/intel_vf.rst         | 15 ++++--
 drivers/net/intel/iavf/iavf.h        |  1 +
 drivers/net/intel/iavf/iavf_ethdev.c | 75 ++++++++++++++++++++++++----
 3 files changed, 77 insertions(+), 14 deletions(-)

-- 
2.43.0


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 1/4] net/iavf: fix disabling of promiscuous modes on device close
  2026-03-31 13:01 [PATCH 0/4] net/iavf: improve VF reset resilience Ciara Loftus
@ 2026-03-31 13:01 ` Ciara Loftus
  2026-03-31 13:01 ` [PATCH 2/4] net/iavf: enable auto reset by default Ciara Loftus
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 8+ messages in thread
From: Ciara Loftus @ 2026-03-31 13:01 UTC (permalink / raw)
  To: dev; +Cc: Ciara Loftus, stable

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: stable@dpdk.org

Signed-off-by: Ciara Loftus <ciara.loftus@intel.com>
---
 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


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 2/4] net/iavf: enable auto reset by default
  2026-03-31 13:01 [PATCH 0/4] net/iavf: improve VF reset resilience Ciara Loftus
  2026-03-31 13:01 ` [PATCH 1/4] net/iavf: fix disabling of promiscuous modes on device close Ciara Loftus
@ 2026-03-31 13:01 ` Ciara Loftus
  2026-03-31 13:01 ` [PATCH 3/4] net/iavf: enable post-reset restoration of VF settings Ciara Loftus
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 8+ messages in thread
From: Ciara Loftus @ 2026-03-31 13:01 UTC (permalink / raw)
  To: dev; +Cc: Ciara Loftus

Previously, VF automatic recovery after a PF-initiated reset required
the user to enable the auto_reset devarg. Without this, recovery was not
attempted by the driver, leaving the VF not fully functional. Enable
auto_reset by default so VFs transparently recover without requiring any
user action.

Since auto_reset requires no-poll-on-link-down to function correctly,
no-poll-on-link-down is also enabled by default. If the user tries to
disable no-poll-on-link-down when auto_reset is enabled, a warning is
emitted and no-poll-on-link-down will remain enabled.

Signed-off-by: Ciara Loftus <ciara.loftus@intel.com>
---
 doc/guides/nics/intel_vf.rst         | 11 +++++++----
 drivers/net/intel/iavf/iavf_ethdev.c |  8 +++++++-
 2 files changed, 14 insertions(+), 5 deletions(-)

diff --git a/doc/guides/nics/intel_vf.rst b/doc/guides/nics/intel_vf.rst
index bc600e4b58..aec7f11b84 100644
--- a/doc/guides/nics/intel_vf.rst
+++ b/doc/guides/nics/intel_vf.rst
@@ -100,12 +100,15 @@ IAVF PMD parameters
     for example, ``-a 18:01.0,watchdog_period=5000`` or ``-a 18:01.0,watchdog_period=0``.
 
 ``auto_reset``
-    Enable VF auto-reset by setting the devargs parameter,
-    for example ``-a 18:01.0,auto_reset=1``,
+    VF auto-reset is enabled by default, meaning the driver will attempt to bring the VF back up
+    transparently after a reset event, rather than relying on the application to do so. To disable
+    this functionality, set the ``auto_reset`` devarg to zero: ``-a 18:01.0,auto_reset=0``
 
 ``no-poll-on-link-down``
-    Stop polling Rx/Tx hardware queue when link is down
-    by setting the ``devargs`` parameter like ``-a 18:01.0,no-poll-on-link-down=1``.
+    Stop polling Rx/Tx hardware queue when link is down. This is enabled by default because it is
+    required when ``auto_reset`` is enabled which it is by default. To disable it, you must disable
+    both ``auto_reset`` and ``no-poll-on-link-down``, for example,
+    ``-a 18:01.0,auto_reset=0,no-poll-on-link-down=0``.
 
 ``mbuf_check``
     Set the ``devargs`` parameter ``mbuf_check`` to enable Tx diagnostics.
diff --git a/drivers/net/intel/iavf/iavf_ethdev.c b/drivers/net/intel/iavf/iavf_ethdev.c
index 2858cd4cb5..b5abfb1316 100644
--- a/drivers/net/intel/iavf/iavf_ethdev.c
+++ b/drivers/net/intel/iavf/iavf_ethdev.c
@@ -2373,6 +2373,9 @@ static int iavf_parse_devargs(struct rte_eth_dev *dev)
 	int ret;
 	int watchdog_period = -1;
 
+	ad->devargs.auto_reset = 1;
+	ad->devargs.no_poll_on_link_down = 1;
+
 	if (!devargs)
 		return 0;
 
@@ -2428,8 +2431,11 @@ static int iavf_parse_devargs(struct rte_eth_dev *dev)
 	if (ret)
 		goto bail;
 
-	if (ad->devargs.auto_reset != 0)
+	if (ad->devargs.auto_reset != 0 && ad->devargs.no_poll_on_link_down == 0) {
+		PMD_INIT_LOG(WARNING,
+			"no-poll-on-link-down=0 is incompatible with auto_reset=1, ignoring");
 		ad->devargs.no_poll_on_link_down = 1;
+	}
 
 bail:
 	rte_kvargs_free(kvlist);
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 3/4] net/iavf: enable post-reset restoration of VF settings
  2026-03-31 13:01 [PATCH 0/4] net/iavf: improve VF reset resilience Ciara Loftus
  2026-03-31 13:01 ` [PATCH 1/4] net/iavf: fix disabling of promiscuous modes on device close Ciara Loftus
  2026-03-31 13:01 ` [PATCH 2/4] net/iavf: enable auto reset by default Ciara Loftus
@ 2026-03-31 13:01 ` Ciara Loftus
  2026-03-31 13:01 ` [PATCH 4/4] net/iavf: fix reset handling error log Ciara Loftus
  2026-04-03 16:08 ` [PATCH 0/4] net/iavf: improve VF reset resilience Bruce Richardson
  4 siblings, 0 replies; 8+ messages in thread
From: Ciara Loftus @ 2026-03-31 13:01 UTC (permalink / raw)
  To: dev; +Cc: Ciara Loftus

When a VF is reset its settings are not restored. These settings include
unicast and multicast promiscuous states. Enable the ability to restore
these settings by introducing a new devarg "auto_reconfig" which accepts
values of zero to disable or one to enable. It is enabled by default.

Signed-off-by: Ciara Loftus <ciara.loftus@intel.com>
---
 doc/guides/nics/intel_vf.rst         |  4 +++
 drivers/net/intel/iavf/iavf.h        |  1 +
 drivers/net/intel/iavf/iavf_ethdev.c | 51 ++++++++++++++++++++++++++++
 3 files changed, 56 insertions(+)

diff --git a/doc/guides/nics/intel_vf.rst b/doc/guides/nics/intel_vf.rst
index aec7f11b84..5fa2ddc9ea 100644
--- a/doc/guides/nics/intel_vf.rst
+++ b/doc/guides/nics/intel_vf.rst
@@ -104,6 +104,10 @@ IAVF PMD parameters
     transparently after a reset event, rather than relying on the application to do so. To disable
     this functionality, set the ``auto_reset`` devarg to zero: ``-a 18:01.0,auto_reset=0``
 
+``auto_reconfig``
+    Restore settings (unicast and multicast promiscuous states) on the VF after a reset event.
+    Enabled by default. To disable it: ``-a 18:01.0,auto_reconfig=0``
+
 ``no-poll-on-link-down``
     Stop polling Rx/Tx hardware queue when link is down. This is enabled by default because it is
     required when ``auto_reset`` is enabled which it is by default. To disable it, you must disable
diff --git a/drivers/net/intel/iavf/iavf.h b/drivers/net/intel/iavf/iavf.h
index 403c61e2e8..02fa780e86 100644
--- a/drivers/net/intel/iavf/iavf.h
+++ b/drivers/net/intel/iavf/iavf.h
@@ -319,6 +319,7 @@ struct iavf_devargs {
 	uint16_t quanta_size;
 	uint32_t watchdog_period;
 	int auto_reset;
+	int auto_reconfig;
 	int no_poll_on_link_down;
 	uint64_t mbuf_check;
 };
diff --git a/drivers/net/intel/iavf/iavf_ethdev.c b/drivers/net/intel/iavf/iavf_ethdev.c
index b5abfb1316..111bfa1934 100644
--- a/drivers/net/intel/iavf/iavf_ethdev.c
+++ b/drivers/net/intel/iavf/iavf_ethdev.c
@@ -41,6 +41,7 @@
 #define IAVF_QUANTA_SIZE_ARG       "quanta_size"
 #define IAVF_RESET_WATCHDOG_ARG    "watchdog_period"
 #define IAVF_ENABLE_AUTO_RESET_ARG "auto_reset"
+#define IAVF_ENABLE_AUTO_RECONFIG_ARG "auto_reconfig"
 #define IAVF_NO_POLL_ON_LINK_DOWN_ARG "no-poll-on-link-down"
 #define IAVF_MBUF_CHECK_ARG       "mbuf_check"
 uint64_t iavf_timestamp_dynflag;
@@ -52,6 +53,7 @@ static const char * const iavf_valid_args[] = {
 	IAVF_QUANTA_SIZE_ARG,
 	IAVF_RESET_WATCHDOG_ARG,
 	IAVF_ENABLE_AUTO_RESET_ARG,
+	IAVF_ENABLE_AUTO_RECONFIG_ARG,
 	IAVF_NO_POLL_ON_LINK_DOWN_ARG,
 	IAVF_MBUF_CHECK_ARG,
 	NULL
@@ -2375,6 +2377,7 @@ static int iavf_parse_devargs(struct rte_eth_dev *dev)
 
 	ad->devargs.auto_reset = 1;
 	ad->devargs.no_poll_on_link_down = 1;
+	ad->devargs.auto_reconfig = 1;
 
 	if (!devargs)
 		return 0;
@@ -2437,6 +2440,11 @@ static int iavf_parse_devargs(struct rte_eth_dev *dev)
 		ad->devargs.no_poll_on_link_down = 1;
 	}
 
+	ret = rte_kvargs_process(kvlist, IAVF_ENABLE_AUTO_RECONFIG_ARG,
+				 &parse_bool, &ad->devargs.auto_reconfig);
+	if (ret)
+		goto bail;
+
 bail:
 	rte_kvargs_free(kvlist);
 	return ret;
@@ -3101,6 +3109,34 @@ iavf_is_reset_detected(struct iavf_adapter *adapter)
 	return false;
 }
 
+static int
+iavf_post_reset_reconfig(struct rte_eth_dev *dev)
+{
+	int ret, status = 0;
+	bool allmulti = false, allunicast = false;
+	struct iavf_adapter *adapter = IAVF_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private);
+
+	/* Restore pre-reset unicast promiscuous and multicast promiscuous states */
+	if (dev->data->promiscuous)
+		allunicast = true;
+	if (dev->data->all_multicast)
+		allmulti = true;
+	if (allmulti || allunicast) {
+		ret = iavf_config_promisc(adapter, allunicast, allmulti);
+		if (ret)
+			PMD_DRV_LOG(ERR, "Failed to restore unicast promiscuous mode (%s) "
+						"and multicast promiscuous mode (%s)",
+						allunicast ? "on" : "off", allmulti ? "on" : "off");
+		else
+			PMD_DRV_LOG(DEBUG, "Restored unicast promiscuous mode (%s) "
+						"and multicast promiscuous mode (%s)",
+						allunicast ? "on" : "off", allmulti ? "on" : "off");
+		status |= ret;
+	}
+
+	return status;
+}
+
 /*
  * Handle hardware reset
  */
@@ -3150,6 +3186,21 @@ iavf_handle_hw_reset(struct rte_eth_dev *dev, bool vf_initiated_reset)
 
 		dev->data->dev_started = 1;
 	}
+
+	/* Restore settings after the reset */
+	if (adapter->devargs.auto_reconfig) {
+		ret = iavf_post_reset_reconfig(dev);
+		if (ret) {
+			PMD_DRV_LOG(ERR, "Failed to restore VF settings after reset");
+			goto error;
+		}
+	} else {
+		dev->data->promiscuous = 0;
+		dev->data->all_multicast = 0;
+		vf->promisc_unicast_enabled = false;
+		vf->promisc_multicast_enabled = false;
+	}
+
 	goto exit;
 
 error:
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 4/4] net/iavf: fix reset handling error log
  2026-03-31 13:01 [PATCH 0/4] net/iavf: improve VF reset resilience Ciara Loftus
                   ` (2 preceding siblings ...)
  2026-03-31 13:01 ` [PATCH 3/4] net/iavf: enable post-reset restoration of VF settings Ciara Loftus
@ 2026-03-31 13:01 ` Ciara Loftus
  2026-03-31 13:23   ` David Marchand
  2026-04-03 16:08 ` [PATCH 0/4] net/iavf: improve VF reset resilience Bruce Richardson
  4 siblings, 1 reply; 8+ messages in thread
From: Ciara Loftus @ 2026-03-31 13:01 UTC (permalink / raw)
  To: dev; +Cc: Ciara Loftus, stable

Commit f665790a5dba ("drivers: remove redundant newline from logs")
intended to remove the newline from the log, however an unwanted
character was left over. Remove it.

Fixes: f665790a5dba ("drivers: remove redundant newline from logs")
Cc: stable@dpdk.org

Signed-off-by: Ciara Loftus <ciara.loftus@intel.com>
---
 drivers/net/intel/iavf/iavf_ethdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/intel/iavf/iavf_ethdev.c b/drivers/net/intel/iavf/iavf_ethdev.c
index 111bfa1934..cf98d7e5e9 100644
--- a/drivers/net/intel/iavf/iavf_ethdev.c
+++ b/drivers/net/intel/iavf/iavf_ethdev.c
@@ -3204,7 +3204,7 @@ iavf_handle_hw_reset(struct rte_eth_dev *dev, bool vf_initiated_reset)
 	goto exit;
 
 error:
-	PMD_DRV_LOG(DEBUG, "RESET recover with error code=%dn", ret);
+	PMD_DRV_LOG(DEBUG, "RESET recover with error code=%d", ret);
 exit:
 	/* Call the post reset callback */
 	if (vf->post_reset_cb != NULL)
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH 4/4] net/iavf: fix reset handling error log
  2026-03-31 13:01 ` [PATCH 4/4] net/iavf: fix reset handling error log Ciara Loftus
@ 2026-03-31 13:23   ` David Marchand
  0 siblings, 0 replies; 8+ messages in thread
From: David Marchand @ 2026-03-31 13:23 UTC (permalink / raw)
  To: Ciara Loftus; +Cc: dev, stable

On Tue, 31 Mar 2026 at 15:03, Ciara Loftus <ciara.loftus@intel.com> wrote:
>
> Commit f665790a5dba ("drivers: remove redundant newline from logs")
> intended to remove the newline from the log, however an unwanted
> character was left over. Remove it.
>
> Fixes: f665790a5dba ("drivers: remove redundant newline from logs")
> Cc: stable@dpdk.org
>
> Signed-off-by: Ciara Loftus <ciara.loftus@intel.com>

Oops.

Reviewed-by: David Marchand <david.marchand@redhat.com>


-- 
David Marchand


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 0/4] net/iavf: improve VF reset resilience
  2026-03-31 13:01 [PATCH 0/4] net/iavf: improve VF reset resilience Ciara Loftus
                   ` (3 preceding siblings ...)
  2026-03-31 13:01 ` [PATCH 4/4] net/iavf: fix reset handling error log Ciara Loftus
@ 2026-04-03 16:08 ` Bruce Richardson
  2026-04-03 16:40   ` Bruce Richardson
  4 siblings, 1 reply; 8+ messages in thread
From: Bruce Richardson @ 2026-04-03 16:08 UTC (permalink / raw)
  To: Ciara Loftus; +Cc: dev

On Tue, Mar 31, 2026 at 01:01:16PM +0000, Ciara Loftus wrote:
> Previously, VF recovery from PF-initiated resets required explicit
> opt-in via auto_reset, leaving VFs non-functional by default after a
> reset unless the application handled it. This series makes transparent
> recovery including the restoration of settings the default, and
> implements some fixes related to the reset path as well.
> 
> Patch 1 fixes a regression which prevented promiscuous mode from being
> disabled before sending the RESET_VF message to the PF during device
> close.
> 
> Patch 2 enables the auto_reset and no-poll-on-link-down devargs
> by default so VFs recover from resets without the need to introduce any
> reset handling in the application.
> 
> Patch 3 introduces a new auto_reconfig devarg (on by default) which
> extends the recovery path to restore unicast and multicast promiscuous
> state after a reset. Restoration of additional settings such as VLAN
> filters could be added under the same mechanism in a follow-up series.
> 
> Patch 4 fixes a minor logging issue.
> 
> Ciara Loftus (4):
>   net/iavf: fix disabling of promiscuous modes on device close
>   net/iavf: enable auto reset by default
>   net/iavf: enable post-reset restoration of VF settings
>   net/iavf: fix reset handling error log
> 
Series-Acked-by: Bruce Richardson <bruce.richardson@intel.com>


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 0/4] net/iavf: improve VF reset resilience
  2026-04-03 16:08 ` [PATCH 0/4] net/iavf: improve VF reset resilience Bruce Richardson
@ 2026-04-03 16:40   ` Bruce Richardson
  0 siblings, 0 replies; 8+ messages in thread
From: Bruce Richardson @ 2026-04-03 16:40 UTC (permalink / raw)
  To: Ciara Loftus; +Cc: dev

On Fri, Apr 03, 2026 at 05:08:36PM +0100, Bruce Richardson wrote:
> On Tue, Mar 31, 2026 at 01:01:16PM +0000, Ciara Loftus wrote:
> > Previously, VF recovery from PF-initiated resets required explicit
> > opt-in via auto_reset, leaving VFs non-functional by default after a
> > reset unless the application handled it. This series makes transparent
> > recovery including the restoration of settings the default, and
> > implements some fixes related to the reset path as well.
> > 
> > Patch 1 fixes a regression which prevented promiscuous mode from being
> > disabled before sending the RESET_VF message to the PF during device
> > close.
> > 
> > Patch 2 enables the auto_reset and no-poll-on-link-down devargs
> > by default so VFs recover from resets without the need to introduce any
> > reset handling in the application.
> > 
> > Patch 3 introduces a new auto_reconfig devarg (on by default) which
> > extends the recovery path to restore unicast and multicast promiscuous
> > state after a reset. Restoration of additional settings such as VLAN
> > filters could be added under the same mechanism in a follow-up series.
> > 
> > Patch 4 fixes a minor logging issue.
> > 
> > Ciara Loftus (4):
> >   net/iavf: fix disabling of promiscuous modes on device close
> >   net/iavf: enable auto reset by default
> >   net/iavf: enable post-reset restoration of VF settings
> >   net/iavf: fix reset handling error log
> > 
> Series-Acked-by: Bruce Richardson <bruce.richardson@intel.com>
> 
Applied to dpdk-next-net-intel.

Thanks,
/Bruce

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2026-04-03 16:40 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-31 13:01 [PATCH 0/4] net/iavf: improve VF reset resilience Ciara Loftus
2026-03-31 13:01 ` [PATCH 1/4] net/iavf: fix disabling of promiscuous modes on device close Ciara Loftus
2026-03-31 13:01 ` [PATCH 2/4] net/iavf: enable auto reset by default Ciara Loftus
2026-03-31 13:01 ` [PATCH 3/4] net/iavf: enable post-reset restoration of VF settings Ciara Loftus
2026-03-31 13:01 ` [PATCH 4/4] net/iavf: fix reset handling error log Ciara Loftus
2026-03-31 13:23   ` David Marchand
2026-04-03 16:08 ` [PATCH 0/4] net/iavf: improve VF reset resilience Bruce Richardson
2026-04-03 16:40   ` Bruce Richardson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox