diff options
author | Jesse Brandeburg <jesse.brandeburg@intel.com> | 2010-05-04 18:26:03 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-05-06 00:15:32 -0400 |
commit | eab2abf5826b78b126826cc70e564c44816396da (patch) | |
tree | f771389b55090767e8aecdc36f3e80019b3b60bf /drivers/net/e1000/e1000_main.c | |
parent | edf15c17420fed108046da50b3d3ae53dfa0e0ae (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/e1000/e1000_main.c')
-rw-r--r-- | drivers/net/e1000/e1000_main.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c index e6ebc222459f..4dd2c23775cb 100644 --- a/drivers/net/e1000/e1000_main.c +++ b/drivers/net/e1000/e1000_main.c | |||
@@ -31,7 +31,7 @@ | |||
31 | 31 | ||
32 | char e1000_driver_name[] = "e1000"; | 32 | char e1000_driver_name[] = "e1000"; |
33 | static char e1000_driver_string[] = "Intel(R) PRO/1000 Network Driver"; | 33 | static char e1000_driver_string[] = "Intel(R) PRO/1000 Network Driver"; |
34 | #define DRV_VERSION "7.3.21-k5-NAPI" | 34 | #define DRV_VERSION "7.3.21-k6-NAPI" |
35 | const char e1000_driver_version[] = DRV_VERSION; | 35 | const char e1000_driver_version[] = DRV_VERSION; |
36 | static const char e1000_copyright[] = "Copyright (c) 1999-2006 Intel Corporation."; | 36 | static const char e1000_copyright[] = "Copyright (c) 1999-2006 Intel Corporation."; |
37 | 37 | ||
@@ -2386,6 +2386,22 @@ link_up: | |||
2386 | } | 2386 | } |
2387 | } | 2387 | } |
2388 | 2388 | ||
2389 | /* Simple mode for Interrupt Throttle Rate (ITR) */ | ||
2390 | if (hw->mac_type >= e1000_82540 && adapter->itr_setting == 4) { | ||
2391 | /* | ||
2392 | * Symmetric Tx/Rx gets a reduced ITR=2000; | ||
2393 | * Total asymmetrical Tx or Rx gets ITR=8000; | ||
2394 | * everyone else is between 2000-8000. | ||
2395 | */ | ||
2396 | u32 goc = (adapter->gotcl + adapter->gorcl) / 10000; | ||
2397 | u32 dif = (adapter->gotcl > adapter->gorcl ? | ||
2398 | adapter->gotcl - adapter->gorcl : | ||
2399 | adapter->gorcl - adapter->gotcl) / 10000; | ||
2400 | u32 itr = goc > 0 ? (dif * 6000 / goc + 2000) : 8000; | ||
2401 | |||
2402 | ew32(ITR, 1000000000 / (itr * 256)); | ||
2403 | } | ||
2404 | |||
2389 | /* Cause software interrupt to ensure rx ring is cleaned */ | 2405 | /* Cause software interrupt to ensure rx ring is cleaned */ |
2390 | ew32(ICS, E1000_ICS_RXDMT0); | 2406 | ew32(ICS, E1000_ICS_RXDMT0); |
2391 | 2407 | ||