aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/e1000/e1000_param.c
diff options
context:
space:
mode:
authorJesse Brandeburg <jesse.brandeburg@intel.com>2006-11-01 11:48:13 -0500
committerJeff Garzik <jeff@garzik.org>2006-12-02 00:12:00 -0500
commit835bb1298311f372a3387fb40b952b18d90aa9f8 (patch)
tree1a58003158f03397212979727c2f5cfa37ebc4f2 /drivers/net/e1000/e1000_param.c
parent9ac98284428961bd5be285a6cc1f5e6f5b6644aa (diff)
e1000: add dynamic itr modes
Add a new dynamic itr algorithm, with 2 modes, and make it the default operation mode. This greatly reduces latency and increases small packet performance, at the "cost" of some CPU utilization. Bulk traffic throughput is unaffected. The driver can limit the amount of interrupts per second that the adapter will generate for incoming packets. It does this by writing a value to the adapter that is based on the maximum amount of interrupts that the adapter will generate per second. Setting InterruptThrottleRate to a value greater or equal to 100 will program the adapter to send out a maximum of that many interrupts per second, even if more packets have come in. This reduces interrupt load on the system and can lower CPU utilization under heavy load, but will increase latency as packets are not processed as quickly. The default behaviour of the driver previously assumed a static InterruptThrottleRate value of 8000, providing a good fallback value for all traffic types,but lacking in small packet performance and latency. The hardware can handle many more small packets per second however, and for this reason an adaptive interrupt moderation algorithm was implemented. Since 7.3.x, the driver has two adaptive modes (setting 1 or 3) in which it dynamically adjusts the InterruptThrottleRate value based on the traffic that it receives. After determining the type of incoming traffic in the last timeframe, it will adjust the InterruptThrottleRate to an appropriate value for that traffic. The algorithm classifies the incoming traffic every interval into classes. Once the class is determined, the InterruptThrottleRate value is adjusted to suit that traffic type the best. There are three classes defined: "Bulk traffic", for large amounts of packets of normal size; "Low latency", for small amounts of traffic and/or a significant percentage of small packets; and "Lowest latency", for almost completely small packets or minimal traffic. In dynamic conservative mode, the InterruptThrottleRate value is set to 4000 for traffic that falls in class "Bulk traffic". If traffic falls in the "Low latency" or "Lowest latency" class, the InterruptThrottleRate is increased stepwise to 20000. This default mode is suitable for most applications. For situations where low latency is vital such as cluster or grid computing, the algorithm can reduce latency even more when InterruptThrottleRate is set to mode 1. In this mode, which operates the same as mode 3, the InterruptThrottleRate will be increased stepwise to 70000 for traffic in class "Lowest latency". Setting InterruptThrottleRate to 0 turns off any interrupt moderation and may improve small packet latency, but is generally not suitable for bulk throughput traffic. Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com> Cc: Rick Jones <rick.jones2@hp.com> Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
Diffstat (limited to 'drivers/net/e1000/e1000_param.c')
-rw-r--r--drivers/net/e1000/e1000_param.c28
1 files changed, 20 insertions, 8 deletions
diff --git a/drivers/net/e1000/e1000_param.c b/drivers/net/e1000/e1000_param.c
index e4f88920b46b..cbfcd7f2889f 100644
--- a/drivers/net/e1000/e1000_param.c
+++ b/drivers/net/e1000/e1000_param.c
@@ -139,7 +139,7 @@ E1000_PARAM(XsumRX, "Disable or enable Receive Checksum offload");
139 * Valid Range: 0-65535 139 * Valid Range: 0-65535
140 */ 140 */
141E1000_PARAM(TxIntDelay, "Transmit Interrupt Delay"); 141E1000_PARAM(TxIntDelay, "Transmit Interrupt Delay");
142#define DEFAULT_TIDV 64 142#define DEFAULT_TIDV 8
143#define MAX_TXDELAY 0xFFFF 143#define MAX_TXDELAY 0xFFFF
144#define MIN_TXDELAY 0 144#define MIN_TXDELAY 0
145 145
@@ -148,7 +148,7 @@ E1000_PARAM(TxIntDelay, "Transmit Interrupt Delay");
148 * Valid Range: 0-65535 148 * Valid Range: 0-65535
149 */ 149 */
150E1000_PARAM(TxAbsIntDelay, "Transmit Absolute Interrupt Delay"); 150E1000_PARAM(TxAbsIntDelay, "Transmit Absolute Interrupt Delay");
151#define DEFAULT_TADV 64 151#define DEFAULT_TADV 32
152#define MAX_TXABSDELAY 0xFFFF 152#define MAX_TXABSDELAY 0xFFFF
153#define MIN_TXABSDELAY 0 153#define MIN_TXABSDELAY 0
154 154
@@ -167,16 +167,16 @@ E1000_PARAM(RxIntDelay, "Receive Interrupt Delay");
167 * Valid Range: 0-65535 167 * Valid Range: 0-65535
168 */ 168 */
169E1000_PARAM(RxAbsIntDelay, "Receive Absolute Interrupt Delay"); 169E1000_PARAM(RxAbsIntDelay, "Receive Absolute Interrupt Delay");
170#define DEFAULT_RADV 128 170#define DEFAULT_RADV 8
171#define MAX_RXABSDELAY 0xFFFF 171#define MAX_RXABSDELAY 0xFFFF
172#define MIN_RXABSDELAY 0 172#define MIN_RXABSDELAY 0
173 173
174/* Interrupt Throttle Rate (interrupts/sec) 174/* Interrupt Throttle Rate (interrupts/sec)
175 * 175 *
176 * Valid Range: 100-100000 (0=off, 1=dynamic) 176 * Valid Range: 100-100000 (0=off, 1=dynamic, 3=dynamic conservative)
177 */ 177 */
178E1000_PARAM(InterruptThrottleRate, "Interrupt Throttling Rate"); 178E1000_PARAM(InterruptThrottleRate, "Interrupt Throttling Rate");
179#define DEFAULT_ITR 8000 179#define DEFAULT_ITR 3
180#define MAX_ITR 100000 180#define MAX_ITR 100000
181#define MIN_ITR 100 181#define MIN_ITR 100
182 182
@@ -472,15 +472,27 @@ e1000_check_options(struct e1000_adapter *adapter)
472 break; 472 break;
473 case 1: 473 case 1:
474 DPRINTK(PROBE, INFO, "%s set to dynamic mode\n", 474 DPRINTK(PROBE, INFO, "%s set to dynamic mode\n",
475 opt.name); 475 opt.name);
476 adapter->itr_setting = adapter->itr;
477 adapter->itr = 20000;
478 break;
479 case 3:
480 DPRINTK(PROBE, INFO,
481 "%s set to dynamic conservative mode\n",
482 opt.name);
483 adapter->itr_setting = adapter->itr;
484 adapter->itr = 20000;
476 break; 485 break;
477 default: 486 default:
478 e1000_validate_option(&adapter->itr, &opt, 487 e1000_validate_option(&adapter->itr, &opt,
479 adapter); 488 adapter);
489 /* save the setting, because the dynamic bits change itr */
490 adapter->itr_setting = adapter->itr;
480 break; 491 break;
481 } 492 }
482 } else { 493 } else {
483 adapter->itr = opt.def; 494 adapter->itr_setting = opt.def;
495 adapter->itr = 20000;
484 } 496 }
485 } 497 }
486 { /* Smart Power Down */ 498 { /* Smart Power Down */