iavf: free q_vectors before queues in iavf_disable_vf
authorNicholas Nunley <nicholas.d.nunley@intel.com>
Fri, 4 Jun 2021 16:48:54 +0000 (09:48 -0700)
committerTony Nguyen <anthony.l.nguyen@intel.com>
Mon, 15 Nov 2021 23:40:03 +0000 (15:40 -0800)
iavf_free_queues() clears adapter->num_active_queues, which
iavf_free_q_vectors() relies on, so swap the order of these two function
calls in iavf_disable_vf(). This resolves a panic encountered when the
interface is disabled and then later brought up again after PF
communication is restored.

Fixes: 65c7006f234c ("i40evf: assign num_active_queues inside i40evf_alloc_queues")
Signed-off-by: Nicholas Nunley <nicholas.d.nunley@intel.com>
Tested-by: Tony Brelinski <tony.brelinski@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
drivers/net/ethernet/intel/iavf/iavf_main.c

index 5611715..c23fff5 100644 (file)
@@ -2123,8 +2123,8 @@ static void iavf_disable_vf(struct iavf_adapter *adapter)
 
        iavf_free_misc_irq(adapter);
        iavf_reset_interrupt_capability(adapter);
-       iavf_free_queues(adapter);
        iavf_free_q_vectors(adapter);
+       iavf_free_queues(adapter);
        memset(adapter->vf_res, 0, IAVF_VIRTCHNL_VF_RESOURCE_SIZE);
        iavf_shutdown_adminq(&adapter->hw);
        adapter->netdev->flags &= ~IFF_UP;