Commit bbd98fe4 authored by Alexander Duyck's avatar Alexander Duyck Committed by David S. Miller

igb: Fix DCA errors and do not use context index for 82576

82576 was being incorrectly flagged as needing a context index.  It does not as
each ring has it's own table of 2 contexts.

Driver was registering after registering the driver instead of the other way around.
Signed-off-by: default avatarAlexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 5d6e430d
...@@ -300,11 +300,10 @@ struct igb_adapter { ...@@ -300,11 +300,10 @@ struct igb_adapter {
#define IGB_FLAG_HAS_MSI (1 << 0) #define IGB_FLAG_HAS_MSI (1 << 0)
#define IGB_FLAG_MSI_ENABLE (1 << 1) #define IGB_FLAG_MSI_ENABLE (1 << 1)
#define IGB_FLAG_HAS_DCA (1 << 2) #define IGB_FLAG_DCA_ENABLED (1 << 2)
#define IGB_FLAG_DCA_ENABLED (1 << 3) #define IGB_FLAG_IN_NETPOLL (1 << 3)
#define IGB_FLAG_IN_NETPOLL (1 << 5) #define IGB_FLAG_QUAD_PORT_A (1 << 4)
#define IGB_FLAG_QUAD_PORT_A (1 << 6) #define IGB_FLAG_NEED_CTX_IDX (1 << 5)
#define IGB_FLAG_NEED_CTX_IDX (1 << 7)
enum e1000_state_t { enum e1000_state_t {
__IGB_TESTING, __IGB_TESTING,
......
...@@ -206,10 +206,11 @@ static int __init igb_init_module(void) ...@@ -206,10 +206,11 @@ static int __init igb_init_module(void)
global_quad_port_a = 0; global_quad_port_a = 0;
ret = pci_register_driver(&igb_driver);
#ifdef CONFIG_IGB_DCA #ifdef CONFIG_IGB_DCA
dca_register_notify(&dca_notifier); dca_register_notify(&dca_notifier);
#endif #endif
ret = pci_register_driver(&igb_driver);
return ret; return ret;
} }
...@@ -1156,11 +1157,10 @@ static int __devinit igb_probe(struct pci_dev *pdev, ...@@ -1156,11 +1157,10 @@ static int __devinit igb_probe(struct pci_dev *pdev,
/* set flags */ /* set flags */
switch (hw->mac.type) { switch (hw->mac.type) {
case e1000_82576:
case e1000_82575: case e1000_82575:
adapter->flags |= IGB_FLAG_HAS_DCA;
adapter->flags |= IGB_FLAG_NEED_CTX_IDX; adapter->flags |= IGB_FLAG_NEED_CTX_IDX;
break; break;
case e1000_82576:
default: default:
break; break;
} }
...@@ -1310,8 +1310,7 @@ static int __devinit igb_probe(struct pci_dev *pdev, ...@@ -1310,8 +1310,7 @@ static int __devinit igb_probe(struct pci_dev *pdev,
goto err_register; goto err_register;
#ifdef CONFIG_IGB_DCA #ifdef CONFIG_IGB_DCA
if ((adapter->flags & IGB_FLAG_HAS_DCA) && if (dca_add_requester(&pdev->dev) == 0) {
(dca_add_requester(&pdev->dev) == 0)) {
adapter->flags |= IGB_FLAG_DCA_ENABLED; adapter->flags |= IGB_FLAG_DCA_ENABLED;
dev_info(&pdev->dev, "DCA enabled\n"); dev_info(&pdev->dev, "DCA enabled\n");
/* Always use CB2 mode, difference is masked /* Always use CB2 mode, difference is masked
...@@ -3473,19 +3472,16 @@ static int __igb_notify_dca(struct device *dev, void *data) ...@@ -3473,19 +3472,16 @@ static int __igb_notify_dca(struct device *dev, void *data)
struct e1000_hw *hw = &adapter->hw; struct e1000_hw *hw = &adapter->hw;
unsigned long event = *(unsigned long *)data; unsigned long event = *(unsigned long *)data;
if (!(adapter->flags & IGB_FLAG_HAS_DCA))
goto out;
switch (event) { switch (event) {
case DCA_PROVIDER_ADD: case DCA_PROVIDER_ADD:
/* if already enabled, don't do it again */ /* if already enabled, don't do it again */
if (adapter->flags & IGB_FLAG_DCA_ENABLED) if (adapter->flags & IGB_FLAG_DCA_ENABLED)
break; break;
adapter->flags |= IGB_FLAG_DCA_ENABLED;
/* Always use CB2 mode, difference is masked /* Always use CB2 mode, difference is masked
* in the CB driver. */ * in the CB driver. */
wr32(E1000_DCA_CTRL, 2); wr32(E1000_DCA_CTRL, 2);
if (dca_add_requester(dev) == 0) { if (dca_add_requester(dev) == 0) {
adapter->flags |= IGB_FLAG_DCA_ENABLED;
dev_info(&adapter->pdev->dev, "DCA enabled\n"); dev_info(&adapter->pdev->dev, "DCA enabled\n");
igb_setup_dca(adapter); igb_setup_dca(adapter);
break; break;
...@@ -3502,7 +3498,7 @@ static int __igb_notify_dca(struct device *dev, void *data) ...@@ -3502,7 +3498,7 @@ static int __igb_notify_dca(struct device *dev, void *data)
} }
break; break;
} }
out:
return 0; return 0;
} }
......
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