aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ixgbe
diff options
context:
space:
mode:
authorDon Skidmore <donald.c.skidmore@intel.com>2009-02-21 18:42:56 -0500
committerDavid S. Miller <davem@davemloft.net>2009-02-21 18:42:56 -0500
commit54037505a5278ce85df66531f384109ad94947e3 (patch)
tree392180002bbc3b399881332d8bf2232a2c3fa274 /drivers/net/ixgbe
parentcd4d8fdad1f13205c769266dfa99015e226b6e07 (diff)
ixgbe: fix for 82598 Si errata causing buffer overflow
The failure happens when an interrupt occurs and the driver is reading EICR. This read will cause a clear-by-read which leads to two TLP being inserted in the PCIe retry buffer leading to an overflow of the buffer and corruption of TLPs. The solution is different depending where the reading of EICR takes place. For ixgbe_msix_lsc() since we are in MSIX mode and know OCD is enabled a clear-by-write is done instead of the normal clear-by-read. For ixgbe_intr() 0xffffffff is written to EIMC before the read, masking the interrupts. Signed-off-by: Don Skidmore <donald.c.skidmore@intel.com> Acked-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ixgbe')
-rw-r--r--drivers/net/ixgbe/ixgbe_main.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c
index 8c32c18f569c..e0d736cc245b 100644
--- a/drivers/net/ixgbe/ixgbe_main.c
+++ b/drivers/net/ixgbe/ixgbe_main.c
@@ -936,7 +936,16 @@ static irqreturn_t ixgbe_msix_lsc(int irq, void *data)
936 struct net_device *netdev = data; 936 struct net_device *netdev = data;
937 struct ixgbe_adapter *adapter = netdev_priv(netdev); 937 struct ixgbe_adapter *adapter = netdev_priv(netdev);
938 struct ixgbe_hw *hw = &adapter->hw; 938 struct ixgbe_hw *hw = &adapter->hw;
939 u32 eicr = IXGBE_READ_REG(hw, IXGBE_EICR); 939 u32 eicr;
940
941 /*
942 * Workaround for Silicon errata. Use clear-by-write instead
943 * of clear-by-read. Reading with EICS will return the
944 * interrupt causes without clearing, which later be done
945 * with the write to EICR.
946 */
947 eicr = IXGBE_READ_REG(hw, IXGBE_EICS);
948 IXGBE_WRITE_REG(hw, IXGBE_EICR, eicr);
940 949
941 if (eicr & IXGBE_EICR_LSC) 950 if (eicr & IXGBE_EICR_LSC)
942 ixgbe_check_lsc(adapter); 951 ixgbe_check_lsc(adapter);
@@ -1355,6 +1364,12 @@ static irqreturn_t ixgbe_intr(int irq, void *data)
1355 struct ixgbe_hw *hw = &adapter->hw; 1364 struct ixgbe_hw *hw = &adapter->hw;
1356 u32 eicr; 1365 u32 eicr;
1357 1366
1367 /*
1368 * Workaround for silicon errata. Mask the interrupts
1369 * before the read of EICR.
1370 */
1371 IXGBE_WRITE_REG(hw, IXGBE_EIMC, IXGBE_IRQ_CLEAR_MASK);
1372
1358 /* for NAPI, using EIAM to auto-mask tx/rx interrupt bits on read 1373 /* for NAPI, using EIAM to auto-mask tx/rx interrupt bits on read
1359 * therefore no explict interrupt disable is necessary */ 1374 * therefore no explict interrupt disable is necessary */
1360 eicr = IXGBE_READ_REG(hw, IXGBE_EICR); 1375 eicr = IXGBE_READ_REG(hw, IXGBE_EICR);