]> Pileus Git - ~andy/linux/blobdiff - drivers/net/e1000/e1000_main.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/ide-2.6
[~andy/linux] / drivers / net / e1000 / e1000_main.c
index e6ebc222459fe83aa9c14e70742832e5ea901c65..ebdea0891665dbb81fbd6e7894abc4e97b6fd2c4 100644 (file)
@@ -31,7 +31,7 @@
 
 char e1000_driver_name[] = "e1000";
 static char e1000_driver_string[] = "Intel(R) PRO/1000 Network Driver";
-#define DRV_VERSION "7.3.21-k5-NAPI"
+#define DRV_VERSION "7.3.21-k6-NAPI"
 const char e1000_driver_version[] = DRV_VERSION;
 static const char e1000_copyright[] = "Copyright (c) 1999-2006 Intel Corporation.";
 
@@ -2161,8 +2161,6 @@ static void e1000_set_rx_mode(struct net_device *netdev)
                        e1000_rar_set(hw, ha->addr, i++);
                }
 
-       WARN_ON(i == rar_entries);
-
        netdev_for_each_mc_addr(ha, netdev) {
                if (i == rar_entries) {
                        /* load any remaining addresses into the hash table */
@@ -2386,6 +2384,22 @@ link_up:
                }
        }
 
+       /* Simple mode for Interrupt Throttle Rate (ITR) */
+       if (hw->mac_type >= e1000_82540 && adapter->itr_setting == 4) {
+               /*
+                * Symmetric Tx/Rx gets a reduced ITR=2000;
+                * Total asymmetrical Tx or Rx gets ITR=8000;
+                * everyone else is between 2000-8000.
+                */
+               u32 goc = (adapter->gotcl + adapter->gorcl) / 10000;
+               u32 dif = (adapter->gotcl > adapter->gorcl ?
+                           adapter->gotcl - adapter->gorcl :
+                           adapter->gorcl - adapter->gotcl) / 10000;
+               u32 itr = goc > 0 ? (dif * 6000 / goc + 2000) : 8000;
+
+               ew32(ITR, 1000000000 / (itr * 256));
+       }
+
        /* Cause software interrupt to ensure rx ring is cleaned */
        ew32(ICS, E1000_ICS_RXDMT0);
 
@@ -2530,8 +2544,6 @@ set_itr_now:
                adapter->itr = new_itr;
                ew32(ITR, 1000000000 / (new_itr * 256));
        }
-
-       return;
 }
 
 #define E1000_TX_FLAGS_CSUM            0x00000001
@@ -3773,6 +3785,31 @@ next_desc:
        return cleaned;
 }
 
+/*
+ * this should improve performance for small packets with large amounts
+ * of reassembly being done in the stack
+ */
+static void e1000_check_copybreak(struct net_device *netdev,
+                                struct e1000_buffer *buffer_info,
+                                u32 length, struct sk_buff **skb)
+{
+       struct sk_buff *new_skb;
+
+       if (length > copybreak)
+               return;
+
+       new_skb = netdev_alloc_skb_ip_align(netdev, length);
+       if (!new_skb)
+               return;
+
+       skb_copy_to_linear_data_offset(new_skb, -NET_IP_ALIGN,
+                                      (*skb)->data - NET_IP_ALIGN,
+                                      length + NET_IP_ALIGN);
+       /* save the skb in buffer_info as good */
+       buffer_info->skb = *skb;
+       *skb = new_skb;
+}
+
 /**
  * e1000_clean_rx_irq - Send received data up the network stack; legacy
  * @adapter: board private structure
@@ -3871,26 +3908,8 @@ static bool e1000_clean_rx_irq(struct e1000_adapter *adapter,
                total_rx_bytes += length;
                total_rx_packets++;
 
-               /* code added for copybreak, this should improve
-                * performance for small packets with large amounts
-                * of reassembly being done in the stack */
-               if (length < copybreak) {
-                       struct sk_buff *new_skb =
-                           netdev_alloc_skb_ip_align(netdev, length);
-                       if (new_skb) {
-                               skb_copy_to_linear_data_offset(new_skb,
-                                                              -NET_IP_ALIGN,
-                                                              (skb->data -
-                                                               NET_IP_ALIGN),
-                                                              (length +
-                                                               NET_IP_ALIGN));
-                               /* save the skb in buffer_info as good */
-                               buffer_info->skb = skb;
-                               skb = new_skb;
-                       }
-                       /* else just continue with the old one */
-               }
-               /* end copybreak code */
+               e1000_check_copybreak(netdev, buffer_info, length, &skb);
+
                skb_put(skb, length);
 
                /* Receive Checksum Offload */