]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
e1000e: Set InterruptThrottleRate to default when invalid value used
authorBruce Allan <bruce.w.allan@intel.com>
Sat, 9 Aug 2008 01:35:51 +0000 (18:35 -0700)
committerJeff Garzik <jgarzik@redhat.com>
Thu, 14 Aug 2008 08:40:03 +0000 (04:40 -0400)
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>
drivers/net/e1000e/param.c

index 8effc3107f9a914e3ae710d22dc97487d79ddc87..b0499f27e5ff0a0b724dc0cd59bc2b57d3a5094b 100644 (file)
@@ -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 {