aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/Kconfig5
-rw-r--r--drivers/net/igb/igb_main.c32
2 files changed, 21 insertions, 16 deletions
diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
index 021e8f167406..c7f020c4f145 100644
--- a/drivers/net/Kconfig
+++ b/drivers/net/Kconfig
@@ -2003,6 +2003,11 @@ config IGB_LRO
2003 2003
2004 If in doubt, say N. 2004 If in doubt, say N.
2005 2005
2006config IGB_DCA
2007 bool "Enable DCA"
2008 default y
2009 depends on IGB && DCA && !(IGB=y && DCA=m)
2010
2006source "drivers/net/ixp2000/Kconfig" 2011source "drivers/net/ixp2000/Kconfig"
2007 2012
2008config MYRI_SBUS 2013config MYRI_SBUS
diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
index 33bd7bb0aacd..1f397cd99414 100644
--- a/drivers/net/igb/igb_main.c
+++ b/drivers/net/igb/igb_main.c
@@ -42,7 +42,7 @@
42#include <linux/delay.h> 42#include <linux/delay.h>
43#include <linux/interrupt.h> 43#include <linux/interrupt.h>
44#include <linux/if_ether.h> 44#include <linux/if_ether.h>
45#ifdef CONFIG_DCA 45#ifdef CONFIG_IGB_DCA
46#include <linux/dca.h> 46#include <linux/dca.h>
47#endif 47#endif
48#include "igb.h" 48#include "igb.h"
@@ -107,11 +107,11 @@ static irqreturn_t igb_msix_other(int irq, void *);
107static irqreturn_t igb_msix_rx(int irq, void *); 107static irqreturn_t igb_msix_rx(int irq, void *);
108static irqreturn_t igb_msix_tx(int irq, void *); 108static irqreturn_t igb_msix_tx(int irq, void *);
109static int igb_clean_rx_ring_msix(struct napi_struct *, int); 109static int igb_clean_rx_ring_msix(struct napi_struct *, int);
110#ifdef CONFIG_DCA 110#ifdef CONFIG_IGB_DCA
111static void igb_update_rx_dca(struct igb_ring *); 111static void igb_update_rx_dca(struct igb_ring *);
112static void igb_update_tx_dca(struct igb_ring *); 112static void igb_update_tx_dca(struct igb_ring *);
113static void igb_setup_dca(struct igb_adapter *); 113static void igb_setup_dca(struct igb_adapter *);
114#endif /* CONFIG_DCA */ 114#endif /* CONFIG_IGB_DCA */
115static bool igb_clean_tx_irq(struct igb_ring *); 115static bool igb_clean_tx_irq(struct igb_ring *);
116static int igb_poll(struct napi_struct *, int); 116static int igb_poll(struct napi_struct *, int);
117static bool igb_clean_rx_irq_adv(struct igb_ring *, int *, int); 117static bool igb_clean_rx_irq_adv(struct igb_ring *, int *, int);
@@ -132,7 +132,7 @@ static int igb_suspend(struct pci_dev *, pm_message_t);
132static int igb_resume(struct pci_dev *); 132static int igb_resume(struct pci_dev *);
133#endif 133#endif
134static void igb_shutdown(struct pci_dev *); 134static void igb_shutdown(struct pci_dev *);
135#ifdef CONFIG_DCA 135#ifdef CONFIG_IGB_DCA
136static int igb_notify_dca(struct notifier_block *, unsigned long, void *); 136static int igb_notify_dca(struct notifier_block *, unsigned long, void *);
137static struct notifier_block dca_notifier = { 137static struct notifier_block dca_notifier = {
138 .notifier_call = igb_notify_dca, 138 .notifier_call = igb_notify_dca,
@@ -208,7 +208,7 @@ static int __init igb_init_module(void)
208 global_quad_port_a = 0; 208 global_quad_port_a = 0;
209 209
210 ret = pci_register_driver(&igb_driver); 210 ret = pci_register_driver(&igb_driver);
211#ifdef CONFIG_DCA 211#ifdef CONFIG_IGB_DCA
212 dca_register_notify(&dca_notifier); 212 dca_register_notify(&dca_notifier);
213#endif 213#endif
214 return ret; 214 return ret;
@@ -224,7 +224,7 @@ module_init(igb_init_module);
224 **/ 224 **/
225static void __exit igb_exit_module(void) 225static void __exit igb_exit_module(void)
226{ 226{
227#ifdef CONFIG_DCA 227#ifdef CONFIG_IGB_DCA
228 dca_unregister_notify(&dca_notifier); 228 dca_unregister_notify(&dca_notifier);
229#endif 229#endif
230 pci_unregister_driver(&igb_driver); 230 pci_unregister_driver(&igb_driver);
@@ -1261,7 +1261,7 @@ static int __devinit igb_probe(struct pci_dev *pdev,
1261 if (err) 1261 if (err)
1262 goto err_register; 1262 goto err_register;
1263 1263
1264#ifdef CONFIG_DCA 1264#ifdef CONFIG_IGB_DCA
1265 if ((adapter->flags & IGB_FLAG_HAS_DCA) && 1265 if ((adapter->flags & IGB_FLAG_HAS_DCA) &&
1266 (dca_add_requester(&pdev->dev) == 0)) { 1266 (dca_add_requester(&pdev->dev) == 0)) {
1267 adapter->flags |= IGB_FLAG_DCA_ENABLED; 1267 adapter->flags |= IGB_FLAG_DCA_ENABLED;
@@ -1335,7 +1335,7 @@ static void __devexit igb_remove(struct pci_dev *pdev)
1335{ 1335{
1336 struct net_device *netdev = pci_get_drvdata(pdev); 1336 struct net_device *netdev = pci_get_drvdata(pdev);
1337 struct igb_adapter *adapter = netdev_priv(netdev); 1337 struct igb_adapter *adapter = netdev_priv(netdev);
1338#ifdef CONFIG_DCA 1338#ifdef CONFIG_IGB_DCA
1339 struct e1000_hw *hw = &adapter->hw; 1339 struct e1000_hw *hw = &adapter->hw;
1340#endif 1340#endif
1341 1341
@@ -1347,7 +1347,7 @@ static void __devexit igb_remove(struct pci_dev *pdev)
1347 1347
1348 flush_scheduled_work(); 1348 flush_scheduled_work();
1349 1349
1350#ifdef CONFIG_DCA 1350#ifdef CONFIG_IGB_DCA
1351 if (adapter->flags & IGB_FLAG_DCA_ENABLED) { 1351 if (adapter->flags & IGB_FLAG_DCA_ENABLED) {
1352 dev_info(&pdev->dev, "DCA disabled\n"); 1352 dev_info(&pdev->dev, "DCA disabled\n");
1353 dca_remove_requester(&pdev->dev); 1353 dca_remove_requester(&pdev->dev);
@@ -3295,7 +3295,7 @@ static irqreturn_t igb_msix_tx(int irq, void *data)
3295 struct igb_adapter *adapter = tx_ring->adapter; 3295 struct igb_adapter *adapter = tx_ring->adapter;
3296 struct e1000_hw *hw = &adapter->hw; 3296 struct e1000_hw *hw = &adapter->hw;
3297 3297
3298#ifdef CONFIG_DCA 3298#ifdef CONFIG_IGB_DCA
3299 if (adapter->flags & IGB_FLAG_DCA_ENABLED) 3299 if (adapter->flags & IGB_FLAG_DCA_ENABLED)
3300 igb_update_tx_dca(tx_ring); 3300 igb_update_tx_dca(tx_ring);
3301#endif 3301#endif
@@ -3347,14 +3347,14 @@ static irqreturn_t igb_msix_rx(int irq, void *data)
3347 if (netif_rx_schedule_prep(adapter->netdev, &rx_ring->napi)) 3347 if (netif_rx_schedule_prep(adapter->netdev, &rx_ring->napi))
3348 __netif_rx_schedule(adapter->netdev, &rx_ring->napi); 3348 __netif_rx_schedule(adapter->netdev, &rx_ring->napi);
3349 3349
3350#ifdef CONFIG_DCA 3350#ifdef CONFIG_IGB_DCA
3351 if (adapter->flags & IGB_FLAG_DCA_ENABLED) 3351 if (adapter->flags & IGB_FLAG_DCA_ENABLED)
3352 igb_update_rx_dca(rx_ring); 3352 igb_update_rx_dca(rx_ring);
3353#endif 3353#endif
3354 return IRQ_HANDLED; 3354 return IRQ_HANDLED;
3355} 3355}
3356 3356
3357#ifdef CONFIG_DCA 3357#ifdef CONFIG_IGB_DCA
3358static void igb_update_rx_dca(struct igb_ring *rx_ring) 3358static void igb_update_rx_dca(struct igb_ring *rx_ring)
3359{ 3359{
3360 u32 dca_rxctrl; 3360 u32 dca_rxctrl;
@@ -3474,7 +3474,7 @@ static int igb_notify_dca(struct notifier_block *nb, unsigned long event,
3474 3474
3475 return ret_val ? NOTIFY_BAD : NOTIFY_DONE; 3475 return ret_val ? NOTIFY_BAD : NOTIFY_DONE;
3476} 3476}
3477#endif /* CONFIG_DCA */ 3477#endif /* CONFIG_IGB_DCA */
3478 3478
3479/** 3479/**
3480 * igb_intr_msi - Interrupt Handler 3480 * igb_intr_msi - Interrupt Handler
@@ -3553,13 +3553,13 @@ static int igb_poll(struct napi_struct *napi, int budget)
3553 int tx_clean_complete, work_done = 0; 3553 int tx_clean_complete, work_done = 0;
3554 3554
3555 /* this poll routine only supports one tx and one rx queue */ 3555 /* this poll routine only supports one tx and one rx queue */
3556#ifdef CONFIG_DCA 3556#ifdef CONFIG_IGB_DCA
3557 if (adapter->flags & IGB_FLAG_DCA_ENABLED) 3557 if (adapter->flags & IGB_FLAG_DCA_ENABLED)
3558 igb_update_tx_dca(&adapter->tx_ring[0]); 3558 igb_update_tx_dca(&adapter->tx_ring[0]);
3559#endif 3559#endif
3560 tx_clean_complete = igb_clean_tx_irq(&adapter->tx_ring[0]); 3560 tx_clean_complete = igb_clean_tx_irq(&adapter->tx_ring[0]);
3561 3561
3562#ifdef CONFIG_DCA 3562#ifdef CONFIG_IGB_DCA
3563 if (adapter->flags & IGB_FLAG_DCA_ENABLED) 3563 if (adapter->flags & IGB_FLAG_DCA_ENABLED)
3564 igb_update_rx_dca(&adapter->rx_ring[0]); 3564 igb_update_rx_dca(&adapter->rx_ring[0]);
3565#endif 3565#endif
@@ -3587,7 +3587,7 @@ static int igb_clean_rx_ring_msix(struct napi_struct *napi, int budget)
3587 struct net_device *netdev = adapter->netdev; 3587 struct net_device *netdev = adapter->netdev;
3588 int work_done = 0; 3588 int work_done = 0;
3589 3589
3590#ifdef CONFIG_DCA 3590#ifdef CONFIG_IGB_DCA
3591 if (adapter->flags & IGB_FLAG_DCA_ENABLED) 3591 if (adapter->flags & IGB_FLAG_DCA_ENABLED)
3592 igb_update_rx_dca(rx_ring); 3592 igb_update_rx_dca(rx_ring);
3593#endif 3593#endif