aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/e1000
diff options
context:
space:
mode:
authorJeff Kirsher <jeffrey.t.kirsher@intel.com>2010-08-08 12:02:31 -0400
committerDavid S. Miller <davem@davemloft.net>2010-08-08 23:02:45 -0400
commit2d0bb1c1f4524befe9f0fcf0d0cd3081a451223f (patch)
tree16abb34e4f852ac6c4101ef9e46940c3bcd5937f /drivers/net/e1000
parent4bc091d85f979a1a18ef2d710b819b3c5b397707 (diff)
e100/e1000*/igb*/ixgb*: Add missing read memory barrier
Based on patches from Sonny Rao and Milton Miller... Combined the patches to fix up clean_tx_irq and clean_rx_irq. The PowerPC architecture does not require loads to independent bytes to be ordered without adding an explicit barrier. In ixgbe_clean_rx_irq we load the status bit then load the packet data. With packet split disabled if these loads go out of order we get a stale packet, but we will notice the bad sequence numbers and drop it. The problem occurs with packet split enabled where the TCP/IP header and data are in different descriptors. If the reads go out of order we may have data that doesn't match the TCP/IP header. Since we use hardware checksumming this bad data is never verified and it makes it all the way to the application. This bug was found during stress testing and adding this barrier has been shown to fix it. The bug can manifest as a data integrity issue (bad payload data) or as a BUG in skb_pull(). This was a nasty bug to hunt down, if people agree with the fix I think it's a candidate for stable. Previously Submitted to e1000-devel only for ixgbe http://marc.info/?l=e1000-devel&m=126593062701537&w=3 We've now seen this problem hit with other device drivers (e1000e mostly) So I'm resubmitting with fixes for other Intel Device Drivers with similar issues. CC: Milton Miller <miltonm@bga.com> CC: Anton Blanchard <anton@samba.org> CC: Sonny Rao <sonnyrao@us.ibm.com> CC: stable <stable@kernel.org> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/e1000')
-rw-r--r--drivers/net/e1000/e1000_main.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
index 02833af8a0b1..5cc39ed289c6 100644
--- a/drivers/net/e1000/e1000_main.c
+++ b/drivers/net/e1000/e1000_main.c
@@ -3454,6 +3454,7 @@ static bool e1000_clean_tx_irq(struct e1000_adapter *adapter,
3454 while ((eop_desc->upper.data & cpu_to_le32(E1000_TXD_STAT_DD)) && 3454 while ((eop_desc->upper.data & cpu_to_le32(E1000_TXD_STAT_DD)) &&
3455 (count < tx_ring->count)) { 3455 (count < tx_ring->count)) {
3456 bool cleaned = false; 3456 bool cleaned = false;
3457 rmb(); /* read buffer_info after eop_desc */
3457 for ( ; !cleaned; count++) { 3458 for ( ; !cleaned; count++) {
3458 tx_desc = E1000_TX_DESC(*tx_ring, i); 3459 tx_desc = E1000_TX_DESC(*tx_ring, i);
3459 buffer_info = &tx_ring->buffer_info[i]; 3460 buffer_info = &tx_ring->buffer_info[i];
@@ -3643,6 +3644,7 @@ static bool e1000_clean_jumbo_rx_irq(struct e1000_adapter *adapter,
3643 if (*work_done >= work_to_do) 3644 if (*work_done >= work_to_do)
3644 break; 3645 break;
3645 (*work_done)++; 3646 (*work_done)++;
3647 rmb(); /* read descriptor and rx_buffer_info after status DD */
3646 3648
3647 status = rx_desc->status; 3649 status = rx_desc->status;
3648 skb = buffer_info->skb; 3650 skb = buffer_info->skb;
@@ -3849,6 +3851,7 @@ static bool e1000_clean_rx_irq(struct e1000_adapter *adapter,
3849 if (*work_done >= work_to_do) 3851 if (*work_done >= work_to_do)
3850 break; 3852 break;
3851 (*work_done)++; 3853 (*work_done)++;
3854 rmb(); /* read descriptor and rx_buffer_info after status DD */
3852 3855
3853 status = rx_desc->status; 3856 status = rx_desc->status;
3854 skb = buffer_info->skb; 3857 skb = buffer_info->skb;