aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/benet/be_main.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/benet/be_main.c')
-rw-r--r--drivers/net/benet/be_main.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/drivers/net/benet/be_main.c b/drivers/net/benet/be_main.c
index 9a54c8b24ff9..7cb5a114c733 100644
--- a/drivers/net/benet/be_main.c
+++ b/drivers/net/benet/be_main.c
@@ -1497,7 +1497,7 @@ static int be_tx_queues_create(struct be_adapter *adapter)
1497 if (be_cmd_eq_create(adapter, eq, adapter->tx_eq.cur_eqd)) 1497 if (be_cmd_eq_create(adapter, eq, adapter->tx_eq.cur_eqd))
1498 goto tx_eq_free; 1498 goto tx_eq_free;
1499 1499
1500 adapter->tx_eq.msix_vec_idx = adapter->msix_vec_next_idx++; 1500 adapter->tx_eq.eq_idx = adapter->eq_next_idx++;
1501 1501
1502 1502
1503 /* Alloc TX eth compl queue */ 1503 /* Alloc TX eth compl queue */
@@ -1590,7 +1590,7 @@ static int be_rx_queues_create(struct be_adapter *adapter)
1590 if (rc) 1590 if (rc)
1591 goto err; 1591 goto err;
1592 1592
1593 rxo->rx_eq.msix_vec_idx = adapter->msix_vec_next_idx++; 1593 rxo->rx_eq.eq_idx = adapter->eq_next_idx++;
1594 1594
1595 /* CQ */ 1595 /* CQ */
1596 cq = &rxo->cq; 1596 cq = &rxo->cq;
@@ -1666,11 +1666,11 @@ static irqreturn_t be_intx(int irq, void *dev)
1666 if (!isr) 1666 if (!isr)
1667 return IRQ_NONE; 1667 return IRQ_NONE;
1668 1668
1669 if ((1 << adapter->tx_eq.msix_vec_idx & isr)) 1669 if ((1 << adapter->tx_eq.eq_idx & isr))
1670 event_handle(adapter, &adapter->tx_eq); 1670 event_handle(adapter, &adapter->tx_eq);
1671 1671
1672 for_all_rx_queues(adapter, rxo, i) { 1672 for_all_rx_queues(adapter, rxo, i) {
1673 if ((1 << rxo->rx_eq.msix_vec_idx & isr)) 1673 if ((1 << rxo->rx_eq.eq_idx & isr))
1674 event_handle(adapter, &rxo->rx_eq); 1674 event_handle(adapter, &rxo->rx_eq);
1675 } 1675 }
1676 } 1676 }
@@ -1951,7 +1951,7 @@ static void be_sriov_disable(struct be_adapter *adapter)
1951static inline int be_msix_vec_get(struct be_adapter *adapter, 1951static inline int be_msix_vec_get(struct be_adapter *adapter,
1952 struct be_eq_obj *eq_obj) 1952 struct be_eq_obj *eq_obj)
1953{ 1953{
1954 return adapter->msix_entries[eq_obj->msix_vec_idx].vector; 1954 return adapter->msix_entries[eq_obj->eq_idx].vector;
1955} 1955}
1956 1956
1957static int be_request_irq(struct be_adapter *adapter, 1957static int be_request_irq(struct be_adapter *adapter,
@@ -2345,6 +2345,7 @@ static int be_clear(struct be_adapter *adapter)
2345 be_mcc_queues_destroy(adapter); 2345 be_mcc_queues_destroy(adapter);
2346 be_rx_queues_destroy(adapter); 2346 be_rx_queues_destroy(adapter);
2347 be_tx_queues_destroy(adapter); 2347 be_tx_queues_destroy(adapter);
2348 adapter->eq_next_idx = 0;
2348 2349
2349 if (be_physfn(adapter) && adapter->sriov_enabled) 2350 if (be_physfn(adapter) && adapter->sriov_enabled)
2350 for (vf = 0; vf < num_vfs; vf++) 2351 for (vf = 0; vf < num_vfs; vf++)
@@ -3141,12 +3142,14 @@ static int be_resume(struct pci_dev *pdev)
3141static void be_shutdown(struct pci_dev *pdev) 3142static void be_shutdown(struct pci_dev *pdev)
3142{ 3143{
3143 struct be_adapter *adapter = pci_get_drvdata(pdev); 3144 struct be_adapter *adapter = pci_get_drvdata(pdev);
3144 struct net_device *netdev = adapter->netdev;
3145 3145
3146 if (netif_running(netdev)) 3146 if (!adapter)
3147 return;
3148
3149 if (netif_running(adapter->netdev))
3147 cancel_delayed_work_sync(&adapter->work); 3150 cancel_delayed_work_sync(&adapter->work);
3148 3151
3149 netif_device_detach(netdev); 3152 netif_device_detach(adapter->netdev);
3150 3153
3151 be_cmd_reset_function(adapter); 3154 be_cmd_reset_function(adapter);
3152 3155