Skip to content

Commit

Permalink
ixgbe: fix possible divide by zero in ixgbe_update_itr
Browse files Browse the repository at this point in the history
Protect the code by bailing out of ixgbe_update_itr() when this occurs.
The next call to ixgbe_update_itr will continue to dynamically update ITR.

Signed-of-by: Don Skidmore <donald.c.skidmore@intel.com>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>

Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
  • Loading branch information
Don Skidmore authored and Jeff Kirsher committed Apr 25, 2013
1 parent 01f27fc commit bdbeefe
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -2095,6 +2095,9 @@ static void ixgbe_update_itr(struct ixgbe_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) {
Expand Down

0 comments on commit bdbeefe

Please sign in to comment.