Commit 7adf1525 authored by Peter P Waskiewicz Jr's avatar Peter P Waskiewicz Jr Committed by David S. Miller

ixgbe: Fix NAPI enable/disable path when using DCB

This change allows DCB mode to change the number of queues, and presumably
the number of NAPI instances, safely.
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 d7b06636
...@@ -148,6 +148,7 @@ static u8 ixgbe_dcbnl_set_state(struct net_device *netdev, u8 state) ...@@ -148,6 +148,7 @@ static u8 ixgbe_dcbnl_set_state(struct net_device *netdev, u8 state)
netdev->netdev_ops->ndo_stop(netdev); netdev->netdev_ops->ndo_stop(netdev);
ixgbe_reset_interrupt_capability(adapter); ixgbe_reset_interrupt_capability(adapter);
ixgbe_napi_del_all(adapter); ixgbe_napi_del_all(adapter);
INIT_LIST_HEAD(&netdev->napi_list);
kfree(adapter->tx_ring); kfree(adapter->tx_ring);
kfree(adapter->rx_ring); kfree(adapter->rx_ring);
adapter->tx_ring = NULL; adapter->tx_ring = NULL;
...@@ -157,7 +158,6 @@ static u8 ixgbe_dcbnl_set_state(struct net_device *netdev, u8 state) ...@@ -157,7 +158,6 @@ static u8 ixgbe_dcbnl_set_state(struct net_device *netdev, u8 state)
adapter->flags &= ~IXGBE_FLAG_RSS_ENABLED; adapter->flags &= ~IXGBE_FLAG_RSS_ENABLED;
adapter->flags |= IXGBE_FLAG_DCB_ENABLED; adapter->flags |= IXGBE_FLAG_DCB_ENABLED;
ixgbe_init_interrupt_scheme(adapter); ixgbe_init_interrupt_scheme(adapter);
ixgbe_napi_add_all(adapter);
if (netif_running(netdev)) if (netif_running(netdev))
netdev->netdev_ops->ndo_open(netdev); netdev->netdev_ops->ndo_open(netdev);
} else { } else {
...@@ -167,6 +167,7 @@ static u8 ixgbe_dcbnl_set_state(struct net_device *netdev, u8 state) ...@@ -167,6 +167,7 @@ static u8 ixgbe_dcbnl_set_state(struct net_device *netdev, u8 state)
netdev->netdev_ops->ndo_stop(netdev); netdev->netdev_ops->ndo_stop(netdev);
ixgbe_reset_interrupt_capability(adapter); ixgbe_reset_interrupt_capability(adapter);
ixgbe_napi_del_all(adapter); ixgbe_napi_del_all(adapter);
INIT_LIST_HEAD(&netdev->napi_list);
kfree(adapter->tx_ring); kfree(adapter->tx_ring);
kfree(adapter->rx_ring); kfree(adapter->rx_ring);
adapter->tx_ring = NULL; adapter->tx_ring = NULL;
...@@ -176,7 +177,6 @@ static u8 ixgbe_dcbnl_set_state(struct net_device *netdev, u8 state) ...@@ -176,7 +177,6 @@ static u8 ixgbe_dcbnl_set_state(struct net_device *netdev, u8 state)
adapter->flags &= ~IXGBE_FLAG_DCB_ENABLED; adapter->flags &= ~IXGBE_FLAG_DCB_ENABLED;
adapter->flags |= IXGBE_FLAG_RSS_ENABLED; adapter->flags |= IXGBE_FLAG_RSS_ENABLED;
ixgbe_init_interrupt_scheme(adapter); ixgbe_init_interrupt_scheme(adapter);
ixgbe_napi_add_all(adapter);
if (netif_running(netdev)) if (netif_running(netdev))
netdev->netdev_ops->ndo_open(netdev); netdev->netdev_ops->ndo_open(netdev);
} }
......
...@@ -2064,6 +2064,8 @@ static int ixgbe_up_complete(struct ixgbe_adapter *adapter) ...@@ -2064,6 +2064,8 @@ 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);
...@@ -3176,8 +3178,13 @@ static int ixgbe_close(struct net_device *netdev) ...@@ -3176,8 +3178,13 @@ static int ixgbe_close(struct net_device *netdev)
void ixgbe_napi_add_all(struct ixgbe_adapter *adapter) void ixgbe_napi_add_all(struct ixgbe_adapter *adapter)
{ {
int q_idx, q_vectors; int q_idx, q_vectors;
struct net_device *netdev = adapter->netdev;
int (*poll)(struct napi_struct *, int); int (*poll)(struct napi_struct *, int);
/* check if we already have our netdev->napi_list populated */
if (&netdev->napi_list != netdev->napi_list.next)
return;
if (adapter->flags & IXGBE_FLAG_MSIX_ENABLED) { if (adapter->flags & IXGBE_FLAG_MSIX_ENABLED) {
poll = &ixgbe_clean_rxonly; poll = &ixgbe_clean_rxonly;
/* Only enable as many vectors as we have rx queues. */ /* Only enable as many vectors as we have rx queues. */
...@@ -3271,6 +3278,7 @@ static int ixgbe_suspend(struct pci_dev *pdev, pm_message_t state) ...@@ -3271,6 +3278,7 @@ static int ixgbe_suspend(struct pci_dev *pdev, pm_message_t state)
} }
ixgbe_reset_interrupt_capability(adapter); ixgbe_reset_interrupt_capability(adapter);
ixgbe_napi_del_all(adapter); ixgbe_napi_del_all(adapter);
INIT_LIST_HEAD(&netdev->napi_list);
kfree(adapter->tx_ring); kfree(adapter->tx_ring);
kfree(adapter->rx_ring); kfree(adapter->rx_ring);
...@@ -4212,8 +4220,6 @@ static int __devinit ixgbe_probe(struct pci_dev *pdev, ...@@ -4212,8 +4220,6 @@ static int __devinit ixgbe_probe(struct pci_dev *pdev,
netif_carrier_off(netdev); netif_carrier_off(netdev);
netif_tx_stop_all_queues(netdev); netif_tx_stop_all_queues(netdev);
ixgbe_napi_add_all(adapter);
strcpy(netdev->name, "eth%d"); strcpy(netdev->name, "eth%d");
err = register_netdev(netdev); err = register_netdev(netdev);
if (err) if (err)
...@@ -4299,7 +4305,6 @@ static void __devexit ixgbe_remove(struct pci_dev *pdev) ...@@ -4299,7 +4305,6 @@ static void __devexit ixgbe_remove(struct pci_dev *pdev)
pci_release_regions(pdev); pci_release_regions(pdev);
DPRINTK(PROBE, INFO, "complete\n"); DPRINTK(PROBE, INFO, "complete\n");
ixgbe_napi_del_all(adapter);
kfree(adapter->tx_ring); kfree(adapter->tx_ring);
kfree(adapter->rx_ring); kfree(adapter->rx_ring);
......
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