]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
ice: Fix error on driver remove
authorDave Ertman <david.m.ertman@intel.com>
Thu, 20 Sep 2018 00:43:07 +0000 (17:43 -0700)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Tue, 2 Oct 2018 14:20:31 +0000 (07:20 -0700)
If the driver is unloaded when traffic is in progress, errors are
generated. Fix this by releasing qvectors and NAPI handler on remove.

Signed-off-by: Dave Ertman <david.m.ertman@intel.com>
Signed-off-by: Anirudh Venkataramanan <anirudh.venkataramanan@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ethernet/intel/ice/ice_main.c

index 9638684f75ac83e8b44ca5fba5c927a7d038edf3..46ccf265c2188c52912be529a4a5aea0ed92bab7 100644 (file)
@@ -2130,6 +2130,7 @@ static int ice_probe(struct pci_dev *pdev,
 static void ice_remove(struct pci_dev *pdev)
 {
        struct ice_pf *pf = pci_get_drvdata(pdev);
+       int i;
 
        if (!pf)
                return;
@@ -2139,6 +2140,11 @@ static void ice_remove(struct pci_dev *pdev)
 
        ice_vsi_release_all(pf);
        ice_free_irq_msix_misc(pf);
+       ice_for_each_vsi(pf, i) {
+               if (!pf->vsi[i])
+                       continue;
+               ice_vsi_free_q_vectors(pf->vsi[i]);
+       }
        ice_clear_interrupt_scheme(pf);
        ice_deinit_pf(pf);
        ice_deinit_hw(&pf->hw);