summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/intel/ixgbevf
diff options
context:
space:
mode:
authorYoung Xiao <92siuyang@gmail.com>2019-05-28 19:58:02 +0800
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2019-06-26 09:18:54 -0700
commite0f0be7dee97dfa01d5c90ab45c1302600604bda (patch)
treeadf6a51d3d8b97fe55ac34b565a62a756194a5a6 /drivers/net/ethernet/intel/ixgbevf
parent655c91414579d7bb115a4f7898ee726fc18e0984 (diff)
ixgbevf: fix possible divide by zero in ixgbevf_update_itr
The next call to ixgbevf_update_itr will continue to dynamically update ITR. Copy from commit bdbeefe8ea8c ("ixgbe: fix possible divide by zero in ixgbe_update_itr") Signed-off-by: Young Xiao <92siuyang@gmail.com> Tested-by: Andrew Bowers <andrewx.bowers@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Diffstat (limited to 'drivers/net/ethernet/intel/ixgbevf')
-rw-r--r--drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
index d189ed247665..d2b41f9f87f8 100644
--- a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
+++ b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
@@ -1423,6 +1423,9 @@ static void ixgbevf_update_itr(struct ixgbevf_q_vector *q_vector,
*/
/* what was last interrupt timeslice? */
timepassed_us = q_vector->itr >> 2;
+ if (timepassed_us == 0)
+ return;
+
bytes_perint = bytes / timepassed_us; /* bytes/usec */
switch (itr_setting) {