aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/e1000e/netdev.c
diff options
context:
space:
mode:
authorJesse Brandeburg <jesse.brandeburg@intel.com>2010-05-04 18:26:03 -0400
committerDavid S. Miller <davem@davemloft.net>2010-05-06 00:15:32 -0400
commiteab2abf5826b78b126826cc70e564c44816396da (patch)
treef771389b55090767e8aecdc36f3e80019b3b60bf /drivers/net/e1000e/netdev.c
parentedf15c17420fed108046da50b3d3ae53dfa0e0ae (diff)
e1000/e1000e: implement a simple interrupt moderation
Back before e1000-7.3.20, the e1000 driver had a simple algorithm that managed interrupt moderation. The driver was updated in 7.3.20 to have the new "adaptive" interrupt moderation but we have customer requests to redeploy the old way as an option. This patch adds the old functionality back. The new functionality can be enabled via module parameter or at runtime via ethtool. Module parameter: (InterruptThrottleRate=4) to use this new moderation method. Ethtool method: ethtool -C ethX rx-usecs 4 Signed-off-by: Jesse Brandeburg <jesse.brandeburg@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/e1000e/netdev.c')
-rw-r--r--drivers/net/e1000e/netdev.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
index 478c34a47d18..c5f65a29865a 100644
--- a/drivers/net/e1000e/netdev.c
+++ b/drivers/net/e1000e/netdev.c
@@ -52,7 +52,7 @@
52 52
53#include "e1000.h" 53#include "e1000.h"
54 54
55#define DRV_VERSION "1.0.2-k2" 55#define DRV_VERSION "1.0.2-k4"
56char e1000e_driver_name[] = "e1000e"; 56char e1000e_driver_name[] = "e1000e";
57const char e1000e_driver_version[] = DRV_VERSION; 57const char e1000e_driver_version[] = DRV_VERSION;
58 58
@@ -4070,6 +4070,22 @@ link_up:
4070 } 4070 }
4071 } 4071 }
4072 4072
4073 /* Simple mode for Interrupt Throttle Rate (ITR) */
4074 if (adapter->itr_setting == 4) {
4075 /*
4076 * Symmetric Tx/Rx gets a reduced ITR=2000;
4077 * Total asymmetrical Tx or Rx gets ITR=8000;
4078 * everyone else is between 2000-8000.
4079 */
4080 u32 goc = (adapter->gotc + adapter->gorc) / 10000;
4081 u32 dif = (adapter->gotc > adapter->gorc ?
4082 adapter->gotc - adapter->gorc :
4083 adapter->gorc - adapter->gotc) / 10000;
4084 u32 itr = goc > 0 ? (dif * 6000 / goc + 2000) : 8000;
4085
4086 ew32(ITR, 1000000000 / (itr * 256));
4087 }
4088
4073 /* Cause software interrupt to ensure Rx ring is cleaned */ 4089 /* Cause software interrupt to ensure Rx ring is cleaned */
4074 if (adapter->msix_entries) 4090 if (adapter->msix_entries)
4075 ew32(ICS, adapter->rx_ring->ims_val); 4091 ew32(ICS, adapter->rx_ring->ims_val);