[PATCH] e1000: Implement a workaround for 82546 errata 10
authorMalli Chilakala <mallikarjuna.chilakala@intel.com>
Fri, 29 Apr 2005 02:41:46 +0000 (19:41 -0700)
committerJeff Garzik <jgarzik@pobox.com>
Fri, 13 May 2005 00:48:54 +0000 (20:48 -0400)
Implement 82546 errata 10 --  first Tx descriptor cannot have more than 2015 byte of data in it or it could hang the transmitter.

Signed-off-by: Mallikarjuna R Chilakala <mallikarjuna.chilakala@intel.com>
Signed-off-by: Ganesh Venkatesan <ganesh.venkatesan@intel.com>
Signed-off-by: John Ronciak <john.ronciak@intel.com>
diff -up net-drivers-2.6/drivers/net/e1000/e1000_main.c net-drivers-2.6/drivers/net/e1000.new/e1000_main.c

drivers/net/e1000/e1000_main.c

index 479915a9f0fb4ecc7cd1b91c94d221ba01fb1a50..e54890aff5f1bda57afe2d019e405e2516448043 100644 (file)
@@ -1777,6 +1777,15 @@ e1000_tx_map(struct e1000_adapter *adapter, struct sk_buff *skb,
                if(unlikely(mss && !nr_frags && size == len && size > 8))
                        size -= 4;
 #endif
+               /* work-around for errata 10 and it applies
+                * to all controllers in PCI-X mode
+                * The fix is to make sure that the first descriptor of a
+                * packet is smaller than 2048 - 16 - 16 (or 2016) bytes
+                */
+               if(unlikely((adapter->hw.bus_type == e1000_bus_type_pcix) &&
+                               (size > 2015) && count == 0))
+                       size = 2015;
+                                                                                
                /* Workaround for potential 82544 hang in PCI-X.  Avoid
                 * terminating buffers within evenly-aligned dwords. */
                if(unlikely(adapter->pcix_82544 &&
@@ -1979,6 +1988,13 @@ e1000_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
        if(adapter->pcix_82544)
                count++;
 
+       /* work-around for errata 10 and it applies to all controllers 
+        * in PCI-X mode, so add one more descriptor to the count
+        */
+       if(unlikely((adapter->hw.bus_type == e1000_bus_type_pcix) &&
+                       (len > 2015)))
+               count++;
+
        nr_frags = skb_shinfo(skb)->nr_frags;
        for(f = 0; f < nr_frags; f++)
                count += TXD_USE_COUNT(skb_shinfo(skb)->frags[f].size,