aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ixgbe
diff options
context:
space:
mode:
authorMilton Miller <miltonm@bga.com>2010-02-19 12:44:42 -0500
committerDavid S. Miller <davem@davemloft.net>2010-02-22 18:45:32 -0500
commit3c945e5b3719bcc18c6ddd31bbcae8ef94f3d19a (patch)
tree2642881822ef675db78594f9a391bbea5c01cf49 /drivers/net/ixgbe
parent06c92ee6384c33dbb6e313c66272181db70abbb0 (diff)
ixgbe: prevent speculative processing of descriptors before ready
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. Signed-off-by: Milton Miller <miltonm@bga.com> Signed-off-by: Anton Blanchard <anton@samba.org> Acked-by: Don Skidmore <donald.c.skidmore@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.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c
index 43a8de3dc4d6..330879004ea1 100644
--- a/drivers/net/ixgbe/ixgbe_main.c
+++ b/drivers/net/ixgbe/ixgbe_main.c
@@ -849,6 +849,7 @@ static bool ixgbe_clean_rx_irq(struct ixgbe_q_vector *q_vector,
849 break; 849 break;
850 (*work_done)++; 850 (*work_done)++;
851 851
852 rmb(); /* read descriptor and rx_buffer_info after status DD */
852 if (rx_ring->flags & IXGBE_RING_RX_PS_ENABLED) { 853 if (rx_ring->flags & IXGBE_RING_RX_PS_ENABLED) {
853 hdr_info = le16_to_cpu(ixgbe_get_hdr_info(rx_desc)); 854 hdr_info = le16_to_cpu(ixgbe_get_hdr_info(rx_desc));
854 len = (hdr_info & IXGBE_RXDADV_HDRBUFLEN_MASK) >> 855 len = (hdr_info & IXGBE_RXDADV_HDRBUFLEN_MASK) >>