aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ixgbe/ixgbe_main.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/ixgbe/ixgbe_main.c')
-rw-r--r--drivers/net/ixgbe/ixgbe_main.c57
1 files changed, 43 insertions, 14 deletions
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c
index 9ef128ae645..febde45cf9f 100644
--- a/drivers/net/ixgbe/ixgbe_main.c
+++ b/drivers/net/ixgbe/ixgbe_main.c
@@ -2723,17 +2723,21 @@ static inline bool ixgbe_set_rss_queues(struct ixgbe_adapter *adapter)
2723 **/ 2723 **/
2724static void ixgbe_set_num_queues(struct ixgbe_adapter *adapter) 2724static void ixgbe_set_num_queues(struct ixgbe_adapter *adapter)
2725{ 2725{
2726 /* Start with base case */
2727 adapter->num_rx_queues = 1;
2728 adapter->num_tx_queues = 1;
2729
2730#ifdef CONFIG_IXGBE_DCB 2726#ifdef CONFIG_IXGBE_DCB
2731 if (ixgbe_set_dcb_queues(adapter)) 2727 if (ixgbe_set_dcb_queues(adapter))
2732 return; 2728 goto done;
2733 2729
2734#endif 2730#endif
2735 if (ixgbe_set_rss_queues(adapter)) 2731 if (ixgbe_set_rss_queues(adapter))
2736 return; 2732 goto done;
2733
2734 /* fallback to base case */
2735 adapter->num_rx_queues = 1;
2736 adapter->num_tx_queues = 1;
2737
2738done:
2739 /* Notify the stack of the (possibly) reduced Tx Queue count. */
2740 adapter->netdev->real_num_tx_queues = adapter->num_tx_queues;
2737} 2741}
2738 2742
2739static void ixgbe_acquire_msix_vectors(struct ixgbe_adapter *adapter, 2743static void ixgbe_acquire_msix_vectors(struct ixgbe_adapter *adapter,
@@ -2992,9 +2996,6 @@ try_msi:
2992 } 2996 }
2993 2997
2994out: 2998out:
2995 /* Notify the stack of the (possibly) reduced Tx Queue count. */
2996 adapter->netdev->real_num_tx_queues = adapter->num_tx_queues;
2997
2998 return err; 2999 return err;
2999} 3000}
3000 3001
@@ -3611,9 +3612,9 @@ static int ixgbe_resume(struct pci_dev *pdev)
3611 3612
3612 return 0; 3613 return 0;
3613} 3614}
3614
3615#endif /* CONFIG_PM */ 3615#endif /* CONFIG_PM */
3616static int ixgbe_suspend(struct pci_dev *pdev, pm_message_t state) 3616
3617static int __ixgbe_shutdown(struct pci_dev *pdev, bool *enable_wake)
3617{ 3618{
3618 struct net_device *netdev = pci_get_drvdata(pdev); 3619 struct net_device *netdev = pci_get_drvdata(pdev);
3619 struct ixgbe_adapter *adapter = netdev_priv(netdev); 3620 struct ixgbe_adapter *adapter = netdev_priv(netdev);
@@ -3672,18 +3673,46 @@ static int ixgbe_suspend(struct pci_dev *pdev, pm_message_t state)
3672 pci_enable_wake(pdev, PCI_D3cold, 0); 3673 pci_enable_wake(pdev, PCI_D3cold, 0);
3673 } 3674 }
3674 3675
3676 *enable_wake = !!wufc;
3677
3675 ixgbe_release_hw_control(adapter); 3678 ixgbe_release_hw_control(adapter);
3676 3679
3677 pci_disable_device(pdev); 3680 pci_disable_device(pdev);
3678 3681
3679 pci_set_power_state(pdev, pci_choose_state(pdev, state)); 3682 return 0;
3683}
3684
3685#ifdef CONFIG_PM
3686static int ixgbe_suspend(struct pci_dev *pdev, pm_message_t state)
3687{
3688 int retval;
3689 bool wake;
3690
3691 retval = __ixgbe_shutdown(pdev, &wake);
3692 if (retval)
3693 return retval;
3694
3695 if (wake) {
3696 pci_prepare_to_sleep(pdev);
3697 } else {
3698 pci_wake_from_d3(pdev, false);
3699 pci_set_power_state(pdev, PCI_D3hot);
3700 }
3680 3701
3681 return 0; 3702 return 0;
3682} 3703}
3704#endif /* CONFIG_PM */
3683 3705
3684static void ixgbe_shutdown(struct pci_dev *pdev) 3706static void ixgbe_shutdown(struct pci_dev *pdev)
3685{ 3707{
3686 ixgbe_suspend(pdev, PMSG_SUSPEND); 3708 bool wake;
3709
3710 __ixgbe_shutdown(pdev, &wake);
3711
3712 if (system_state == SYSTEM_POWER_OFF) {
3713 pci_wake_from_d3(pdev, wake);
3714 pci_set_power_state(pdev, PCI_D3hot);
3715 }
3687} 3716}
3688 3717
3689/** 3718/**
@@ -4342,7 +4371,7 @@ static int ixgbe_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
4342 int count = 0; 4371 int count = 0;
4343 unsigned int f; 4372 unsigned int f;
4344 4373
4345 r_idx = (adapter->num_tx_queues - 1) & skb->queue_mapping; 4374 r_idx = skb->queue_mapping;
4346 tx_ring = &adapter->tx_ring[r_idx]; 4375 tx_ring = &adapter->tx_ring[r_idx];
4347 4376
4348 if (adapter->vlgrp && vlan_tx_tag_present(skb)) { 4377 if (adapter->vlgrp && vlan_tx_tag_present(skb)) {