Commit 4dd64df8 authored by Jesse Brandeburg's avatar Jesse Brandeburg Committed by David S. Miller

ixgbe: fix bug with napi add before request_irq

Occasionally if the driver was loaded in a system that
didn't support MSI-X or MSI and was on a shared interrupt,
the driver would then panic in NAPI on the first shared
interrupt because we hadn't called napi_add yet.

Solution: call napi_add before calling request_irq
Signed-off-by: default avatarJesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: default avatarPeter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 509ee935
...@@ -2339,8 +2339,6 @@ static int ixgbe_up_complete(struct ixgbe_adapter *adapter) ...@@ -2339,8 +2339,6 @@ static int ixgbe_up_complete(struct ixgbe_adapter *adapter)
else else
ixgbe_configure_msi_and_legacy(adapter); ixgbe_configure_msi_and_legacy(adapter);
ixgbe_napi_add_all(adapter);
clear_bit(__IXGBE_DOWN, &adapter->state); clear_bit(__IXGBE_DOWN, &adapter->state);
ixgbe_napi_enable_all(adapter); ixgbe_napi_enable_all(adapter);
...@@ -2397,6 +2395,8 @@ int ixgbe_up(struct ixgbe_adapter *adapter) ...@@ -2397,6 +2395,8 @@ int ixgbe_up(struct ixgbe_adapter *adapter)
/* hardware has been reset, we need to reload some things */ /* hardware has been reset, we need to reload some things */
ixgbe_configure(adapter); ixgbe_configure(adapter);
ixgbe_napi_add_all(adapter);
return ixgbe_up_complete(adapter); return ixgbe_up_complete(adapter);
} }
...@@ -3426,6 +3426,8 @@ static int ixgbe_open(struct net_device *netdev) ...@@ -3426,6 +3426,8 @@ static int ixgbe_open(struct net_device *netdev)
ixgbe_configure(adapter); ixgbe_configure(adapter);
ixgbe_napi_add_all(adapter);
err = ixgbe_request_irq(adapter); err = ixgbe_request_irq(adapter);
if (err) if (err)
goto err_req_irq; goto err_req_irq;
...@@ -3480,6 +3482,7 @@ static int ixgbe_close(struct net_device *netdev) ...@@ -3480,6 +3482,7 @@ static int ixgbe_close(struct net_device *netdev)
/** /**
* ixgbe_napi_add_all - prep napi structs for use * ixgbe_napi_add_all - prep napi structs for use
* @adapter: private struct * @adapter: private struct
*
* helper function to napi_add each possible q_vector->napi * helper function to napi_add each possible q_vector->napi
*/ */
void ixgbe_napi_add_all(struct ixgbe_adapter *adapter) void ixgbe_napi_add_all(struct ixgbe_adapter *adapter)
...@@ -3552,7 +3555,6 @@ static int ixgbe_resume(struct pci_dev *pdev) ...@@ -3552,7 +3555,6 @@ static int ixgbe_resume(struct pci_dev *pdev)
return err; return err;
} }
ixgbe_napi_add_all(adapter);
ixgbe_reset(adapter); ixgbe_reset(adapter);
if (netif_running(netdev)) { if (netif_running(netdev)) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment