ixgbevf: fix possible divide by zero in ixgbevf_update_itr
authorYoung Xiao <92siuyang@gmail.com>
Tue, 28 May 2019 11:58:02 +0000 (19:58 +0800)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Wed, 26 Jun 2019 16:18:54 +0000 (09:18 -0700)
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>
drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c

index d189ed24766524676f2a1baa3651e53412bd1ad0..d2b41f9f87f80513a793eafe5e65899464488a9c 100644 (file)
@@ -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) {