On Wed, Mar 29, 2006 at 08:44:09PM -0800, David S. Miller wrote:
> 
> Herbert do you see any holes here?

Well I started from the beginning again, and found this.  This may be
the smoking gun that we're after :)

The xmit routine is lockless but checks last_tx_tso outside the locked
section.  So if a TSO packet wins a race against a non-TSO packet with
last_tx_tso == 0 then we'll have memory corruption.

Everyone, please try this patch and let us know whether the problem
goes away.

Thanks,
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <[EMAIL PROTECTED]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
index 49cd096..96b7bef 100644
--- a/drivers/net/e1000/e1000_main.c
+++ b/drivers/net/e1000/e1000_main.c
@@ -2821,13 +2821,6 @@
                count++;
 #endif
 
-#ifdef NETIF_F_TSO
-       /* Controller Erratum workaround */
-       if (!skb->data_len && tx_ring->last_tx_tso &&
-           !skb_shinfo(skb)->tso_size)
-               count++;
-#endif
-
        count += TXD_USE_COUNT(len, max_txd_pwr);
 
        if (adapter->pcix_82544)
@@ -2846,11 +2839,6 @@
                                       max_txd_pwr);
        if (adapter->pcix_82544)
                count += nr_frags;
-
-
-       if (adapter->hw.tx_pkt_filtering &&
-           (adapter->hw.mac_type == e1000_82573))
-               e1000_transfer_dhcp_info(adapter, skb);
 
        local_irq_save(flags);
        if (!spin_trylock(&tx_ring->tx_lock)) {
@@ -2858,6 +2846,17 @@
                local_irq_restore(flags);
                return NETDEV_TX_LOCKED;
        }
+
+#ifdef NETIF_F_TSO
+       /* Controller Erratum workaround */
+       if (!skb->data_len && tx_ring->last_tx_tso &&
+           !skb_shinfo(skb)->tso_size)
+               count++;
+#endif
+
+       if (adapter->hw.tx_pkt_filtering &&
+           (adapter->hw.mac_type == e1000_82573))
+               e1000_transfer_dhcp_info(adapter, skb);
 
        /* need: count + 2 desc gap to keep tail from touching
         * head, otherwise try next time */

Reply via email to