iavf: Fix adopting new combined setting
authorMichal Maloszewski <michal.maloszewski@intel.com>
Wed, 2 Feb 2022 12:44:54 +0000 (12:44 +0000)
committerTony Nguyen <anthony.l.nguyen@intel.com>
Tue, 8 Mar 2022 21:30:57 +0000 (13:30 -0800)
In some cases overloaded flag IAVF_FLAG_REINIT_ITR_NEEDED
which should indicate that interrupts need to be completely
reinitialized during reset leads to RTNL deadlocks using ethtool -C
while a reset is in progress.
To fix, it was added a new flag IAVF_FLAG_REINIT_MSIX_NEEDED
used to trigger MSI-X reinit.
New combined setting is fixed adopt after VF reset.
This has been implemented by call reinit interrupt scheme
during VF reset.
Without this fix new combined setting has never been adopted.

Fixes: 209f2f9c7181 ("iavf: Add support for VIRTCHNL_VF_OFFLOAD_VLAN_V2 negotiation")
Signed-off-by: Grzegorz Szczurek <grzegorzx.szczurek@intel.com>
Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Signed-off-by: Michal Maloszewski <michal.maloszewski@intel.com>
Tested-by: Konrad Jankowski <konrad0.jankowski@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
drivers/net/ethernet/intel/iavf/iavf.h
drivers/net/ethernet/intel/iavf/iavf_main.c

index 89423947ee65fafa197aef33f508e2c9c6dfe3a8..4babe4705a5527c70ef2203ce04a8c6dd2f45041 100644 (file)
@@ -288,6 +288,7 @@ struct iavf_adapter {
 #define IAVF_FLAG_REINIT_ITR_NEEDED            BIT(16)
 #define IAVF_FLAG_QUEUES_DISABLED              BIT(17)
 #define IAVF_FLAG_SETUP_NETDEV_FEATURES                BIT(18)
+#define IAVF_FLAG_REINIT_MSIX_NEEDED           BIT(20)
 /* duplicates for common code */
 #define IAVF_FLAG_DCB_ENABLED                  0
        /* flags for admin queue service task */
index dcf24264c7eaf08721994782c249ca22b149a1da..8e644e9ed8da0060f0367a88c88bd3a720679044 100644 (file)
@@ -2120,7 +2120,7 @@ int iavf_parse_vf_resource_msg(struct iavf_adapter *adapter)
                        "Requested %d queues, but PF only gave us %d.\n",
                        num_req_queues,
                        adapter->vsi_res->num_queue_pairs);
-               adapter->flags |= IAVF_FLAG_REINIT_ITR_NEEDED;
+               adapter->flags |= IAVF_FLAG_REINIT_MSIX_NEEDED;
                adapter->num_req_queues = adapter->vsi_res->num_queue_pairs;
                iavf_schedule_reset(adapter);
 
@@ -2727,7 +2727,8 @@ continue_reset:
                         err);
        adapter->aq_required = 0;
 
-       if (adapter->flags & IAVF_FLAG_REINIT_ITR_NEEDED) {
+       if ((adapter->flags & IAVF_FLAG_REINIT_MSIX_NEEDED) ||
+           (adapter->flags & IAVF_FLAG_REINIT_ITR_NEEDED)) {
                err = iavf_reinit_interrupt_scheme(adapter);
                if (err)
                        goto reset_err;
@@ -2799,12 +2800,13 @@ continue_reset:
                if (err)
                        goto reset_err;
 
-               if (adapter->flags & IAVF_FLAG_REINIT_ITR_NEEDED) {
+               if ((adapter->flags & IAVF_FLAG_REINIT_MSIX_NEEDED) ||
+                   (adapter->flags & IAVF_FLAG_REINIT_ITR_NEEDED)) {
                        err = iavf_request_traffic_irqs(adapter, netdev->name);
                        if (err)
                                goto reset_err;
 
-                       adapter->flags &= ~IAVF_FLAG_REINIT_ITR_NEEDED;
+                       adapter->flags &= ~IAVF_FLAG_REINIT_MSIX_NEEDED;
                }
 
                iavf_configure(adapter);
@@ -2819,6 +2821,9 @@ continue_reset:
                iavf_change_state(adapter, __IAVF_DOWN);
                wake_up(&adapter->down_waitqueue);
        }
+
+       adapter->flags &= ~IAVF_FLAG_REINIT_ITR_NEEDED;
+
        mutex_unlock(&adapter->client_lock);
        mutex_unlock(&adapter->crit_lock);