summaryrefslogtreecommitdiffstats
path: root/drivers/net/e1000e
diff options
context:
space:
mode:
authorBruce Allan <bruce.w.allan@intel.com>2008-08-09 03:35:51 +0200
committerJeff Garzik <jgarzik@redhat.com>2008-08-14 10:40:03 +0200
commit2d06cad1a5ceb3b04dc9547e261ad4fcebf7433d (patch)
tree685175f1f7b6bbbde4b07a12391a112601544a97 /drivers/net/e1000e
parente1000e: Return 1 instead of a non-zero value for link up indication (diff)
downloadlinux-2d06cad1a5ceb3b04dc9547e261ad4fcebf7433d.tar.xz
linux-2d06cad1a5ceb3b04dc9547e261ad4fcebf7433d.zip
e1000e: Set InterruptThrottleRate to default when invalid value used
During module load, seting the InterruptThrottleRate parameter to an invalid value would result in the itr/itr_setting pair being set to unexpected values which would result in poor performance. Signed-off-by: Bruce Allan <bruce.w.allan@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers/net/e1000e')
-rw-r--r--drivers/net/e1000e/param.c23
1 files changed, 19 insertions, 4 deletions
diff --git a/drivers/net/e1000e/param.c b/drivers/net/e1000e/param.c
index 8effc3107f9a..b0499f27e5ff 100644
--- a/drivers/net/e1000e/param.c
+++ b/drivers/net/e1000e/param.c
@@ -327,11 +327,26 @@ void __devinit e1000e_check_options(struct e1000_adapter *adapter)
e1000_validate_option(&adapter->itr, &opt,
adapter);
/*
- * save the setting, because the dynamic bits
- * change itr. clear the lower two bits
- * because they are used as control
+ * Save the setting, because the dynamic bits
+ * change itr.
*/
- adapter->itr_setting = adapter->itr & ~3;
+ if (e1000_validate_option(&adapter->itr, &opt,
+ adapter) &&
+ (adapter->itr == 3)) {
+ /*
+ * In case of invalid user value,
+ * default to conservative mode.
+ */
+ adapter->itr_setting = adapter->itr;
+ adapter->itr = 20000;
+ } else {
+ /*
+ * Clear the lower two bits because
+ * they are used as control.
+ */
+ adapter->itr_setting =
+ adapter->itr & ~3;
+ }
break;
}
} else {