* [net-2.6 PATCH 1/3] igb: Fix DCA errors and do not use context index for 82576
@ 2009-01-31 0:53 Jeff Kirsher
2009-01-31 0:54 ` [net-2.6 PATCH 2/3] igb: prevent skb_over panic w/ mtu smaller than 1K Jeff Kirsher
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Jeff Kirsher @ 2009-01-31 0:53 UTC (permalink / raw)
To: davem; +Cc: netdev, jeff, gospo, Alexander Duyck, Jeff Kirsher
From: Alexander Duyck <alexander.h.duyck@intel.com>
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: Alexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/igb/igb.h | 9 ++++-----
drivers/net/igb/igb_main.c | 16 ++++++----------
2 files changed, 10 insertions(+), 15 deletions(-)
diff --git a/drivers/net/igb/igb.h b/drivers/net/igb/igb.h
index 5a27825..aebef8e 100644
--- a/drivers/net/igb/igb.h
+++ b/drivers/net/igb/igb.h
@@ -300,11 +300,10 @@ struct igb_adapter {
#define IGB_FLAG_HAS_MSI (1 << 0)
#define IGB_FLAG_MSI_ENABLE (1 << 1)
-#define IGB_FLAG_HAS_DCA (1 << 2)
-#define IGB_FLAG_DCA_ENABLED (1 << 3)
-#define IGB_FLAG_IN_NETPOLL (1 << 5)
-#define IGB_FLAG_QUAD_PORT_A (1 << 6)
-#define IGB_FLAG_NEED_CTX_IDX (1 << 7)
+#define IGB_FLAG_DCA_ENABLED (1 << 2)
+#define IGB_FLAG_IN_NETPOLL (1 << 3)
+#define IGB_FLAG_QUAD_PORT_A (1 << 4)
+#define IGB_FLAG_NEED_CTX_IDX (1 << 5)
enum e1000_state_t {
__IGB_TESTING,
diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
index b82b0fb..cc94412 100644
--- a/drivers/net/igb/igb_main.c
+++ b/drivers/net/igb/igb_main.c
@@ -206,10 +206,11 @@ static int __init igb_init_module(void)
global_quad_port_a = 0;
- ret = pci_register_driver(&igb_driver);
#ifdef CONFIG_IGB_DCA
dca_register_notify(&dca_notifier);
#endif
+
+ ret = pci_register_driver(&igb_driver);
return ret;
}
@@ -1156,11 +1157,10 @@ static int __devinit igb_probe(struct pci_dev *pdev,
/* set flags */
switch (hw->mac.type) {
- case e1000_82576:
case e1000_82575:
- adapter->flags |= IGB_FLAG_HAS_DCA;
adapter->flags |= IGB_FLAG_NEED_CTX_IDX;
break;
+ case e1000_82576:
default:
break;
}
@@ -1310,8 +1310,7 @@ static int __devinit igb_probe(struct pci_dev *pdev,
goto err_register;
#ifdef CONFIG_IGB_DCA
- if ((adapter->flags & IGB_FLAG_HAS_DCA) &&
- (dca_add_requester(&pdev->dev) == 0)) {
+ if (dca_add_requester(&pdev->dev) == 0) {
adapter->flags |= IGB_FLAG_DCA_ENABLED;
dev_info(&pdev->dev, "DCA enabled\n");
/* Always use CB2 mode, difference is masked
@@ -3473,19 +3472,16 @@ static int __igb_notify_dca(struct device *dev, void *data)
struct e1000_hw *hw = &adapter->hw;
unsigned long event = *(unsigned long *)data;
- if (!(adapter->flags & IGB_FLAG_HAS_DCA))
- goto out;
-
switch (event) {
case DCA_PROVIDER_ADD:
/* if already enabled, don't do it again */
if (adapter->flags & IGB_FLAG_DCA_ENABLED)
break;
- adapter->flags |= IGB_FLAG_DCA_ENABLED;
/* Always use CB2 mode, difference is masked
* in the CB driver. */
wr32(E1000_DCA_CTRL, 2);
if (dca_add_requester(dev) == 0) {
+ adapter->flags |= IGB_FLAG_DCA_ENABLED;
dev_info(&adapter->pdev->dev, "DCA enabled\n");
igb_setup_dca(adapter);
break;
@@ -3502,7 +3498,7 @@ static int __igb_notify_dca(struct device *dev, void *data)
}
break;
}
-out:
+
return 0;
}
^ permalink raw reply related [flat|nested] 6+ messages in thread* [net-2.6 PATCH 2/3] igb: prevent skb_over panic w/ mtu smaller than 1K
2009-01-31 0:53 [net-2.6 PATCH 1/3] igb: Fix DCA errors and do not use context index for 82576 Jeff Kirsher
@ 2009-01-31 0:54 ` Jeff Kirsher
2009-01-31 8:53 ` David Miller
2009-01-31 0:54 ` [net-2.6 PATCH 3/3] igb: fix link reporting when using sgmii Jeff Kirsher
2009-01-31 8:53 ` [net-2.6 PATCH 1/3] igb: Fix DCA errors and do not use context index for 82576 David Miller
2 siblings, 1 reply; 6+ messages in thread
From: Jeff Kirsher @ 2009-01-31 0:54 UTC (permalink / raw)
To: davem; +Cc: netdev, jeff, gospo, Alexander Duyck, Jeff Kirsher
From: Alexander Duyck <alexander.h.duyck@intel.com>
A panic has been observed with frame sizes smaller than 1K. This has been
root caused to the hardware spanning larger frames across multiple buffers
and then reporting the original frame size in the first descriptor. To
prevent this we can enable set the LPE bit which in turn will restrict
packet sizes to those set in the RLPML register.
Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/igb/igb_main.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
index cc94412..a50db53 100644
--- a/drivers/net/igb/igb_main.c
+++ b/drivers/net/igb/igb_main.c
@@ -1834,11 +1834,11 @@ static void igb_setup_rctl(struct igb_adapter *adapter)
rctl |= E1000_RCTL_SECRC;
/*
- * disable store bad packets, long packet enable, and clear size bits.
+ * disable store bad packets and clear size bits.
*/
- rctl &= ~(E1000_RCTL_SBP | E1000_RCTL_LPE | E1000_RCTL_SZ_256);
+ rctl &= ~(E1000_RCTL_SBP | E1000_RCTL_SZ_256);
- if (adapter->netdev->mtu > ETH_DATA_LEN)
+ /* enable LPE when to prevent packets larger than max_frame_size */
rctl |= E1000_RCTL_LPE;
/* Setup buffer sizes */
@@ -1864,7 +1864,7 @@ static void igb_setup_rctl(struct igb_adapter *adapter)
*/
/* allocations using alloc_page take too long for regular MTU
* so only enable packet split for jumbo frames */
- if (rctl & E1000_RCTL_LPE) {
+ if (adapter->netdev->mtu > ETH_DATA_LEN) {
adapter->rx_ps_hdr_size = IGB_RXBUFFER_128;
srrctl |= adapter->rx_ps_hdr_size <<
E1000_SRRCTL_BSIZEHDRSIZE_SHIFT;
^ permalink raw reply related [flat|nested] 6+ messages in thread* Re: [net-2.6 PATCH 2/3] igb: prevent skb_over panic w/ mtu smaller than 1K
2009-01-31 0:54 ` [net-2.6 PATCH 2/3] igb: prevent skb_over panic w/ mtu smaller than 1K Jeff Kirsher
@ 2009-01-31 8:53 ` David Miller
0 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2009-01-31 8:53 UTC (permalink / raw)
To: jeffrey.t.kirsher; +Cc: netdev, jeff, gospo, alexander.h.duyck
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Fri, 30 Jan 2009 16:54:04 -0800
> A panic has been observed with frame sizes smaller than 1K. This has been
> root caused to the hardware spanning larger frames across multiple buffers
> and then reporting the original frame size in the first descriptor. To
> prevent this we can enable set the LPE bit which in turn will restrict
> packet sizes to those set in the RLPML register.
>
> Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Applied.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [net-2.6 PATCH 3/3] igb: fix link reporting when using sgmii
2009-01-31 0:53 [net-2.6 PATCH 1/3] igb: Fix DCA errors and do not use context index for 82576 Jeff Kirsher
2009-01-31 0:54 ` [net-2.6 PATCH 2/3] igb: prevent skb_over panic w/ mtu smaller than 1K Jeff Kirsher
@ 2009-01-31 0:54 ` Jeff Kirsher
2009-01-31 8:53 ` David Miller
2009-01-31 8:53 ` [net-2.6 PATCH 1/3] igb: Fix DCA errors and do not use context index for 82576 David Miller
2 siblings, 1 reply; 6+ messages in thread
From: Jeff Kirsher @ 2009-01-31 0:54 UTC (permalink / raw)
To: davem; +Cc: netdev, jeff, gospo, Alexander Duyck, Jeff Kirsher
From: Alexander Duyck <alexander.h.duyck@intel.com>
When using sgmii the link was not being properly passed up to the driver
from the underlying link management functions. This change corrects it so
that get_link_status is cleared when a link has been found.
Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/igb/e1000_82575.c | 11 +++++++++--
1 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/drivers/net/igb/e1000_82575.c b/drivers/net/igb/e1000_82575.c
index f5e2e72..13ca73f 100644
--- a/drivers/net/igb/e1000_82575.c
+++ b/drivers/net/igb/e1000_82575.c
@@ -699,11 +699,18 @@ static s32 igb_check_for_link_82575(struct e1000_hw *hw)
/* SGMII link check is done through the PCS register. */
if ((hw->phy.media_type != e1000_media_type_copper) ||
- (igb_sgmii_active_82575(hw)))
+ (igb_sgmii_active_82575(hw))) {
ret_val = igb_get_pcs_speed_and_duplex_82575(hw, &speed,
&duplex);
- else
+ /*
+ * Use this flag to determine if link needs to be checked or
+ * not. If we have link clear the flag so that we do not
+ * continue to check for link.
+ */
+ hw->mac.get_link_status = !hw->mac.serdes_has_link;
+ } else {
ret_val = igb_check_for_copper_link(hw);
+ }
return ret_val;
}
^ permalink raw reply related [flat|nested] 6+ messages in thread* Re: [net-2.6 PATCH 1/3] igb: Fix DCA errors and do not use context index for 82576
2009-01-31 0:53 [net-2.6 PATCH 1/3] igb: Fix DCA errors and do not use context index for 82576 Jeff Kirsher
2009-01-31 0:54 ` [net-2.6 PATCH 2/3] igb: prevent skb_over panic w/ mtu smaller than 1K Jeff Kirsher
2009-01-31 0:54 ` [net-2.6 PATCH 3/3] igb: fix link reporting when using sgmii Jeff Kirsher
@ 2009-01-31 8:53 ` David Miller
2 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2009-01-31 8:53 UTC (permalink / raw)
To: jeffrey.t.kirsher; +Cc: netdev, jeff, gospo, alexander.h.duyck
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Fri, 30 Jan 2009 16:53:43 -0800
> 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: Alexander Duyck <alexander.h.duyck@intel.com>
> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Applied.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2009-01-31 8:53 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-31 0:53 [net-2.6 PATCH 1/3] igb: Fix DCA errors and do not use context index for 82576 Jeff Kirsher
2009-01-31 0:54 ` [net-2.6 PATCH 2/3] igb: prevent skb_over panic w/ mtu smaller than 1K Jeff Kirsher
2009-01-31 8:53 ` David Miller
2009-01-31 0:54 ` [net-2.6 PATCH 3/3] igb: fix link reporting when using sgmii Jeff Kirsher
2009-01-31 8:53 ` David Miller
2009-01-31 8:53 ` [net-2.6 PATCH 1/3] igb: Fix DCA errors and do not use context index for 82576 David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).