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 <[email protected]>
---
 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

Reply via email to