Message ID | 1559044682-23446-1-git-send-email-92siuyang@gmail.com |
---|---|
State | Awaiting Upstream |
Delegated to: | David Miller |
Headers | show |
Series | ixgbevf: fix possible divide by zero in ixgbevf_update_itr | expand |
> -----Original Message----- > From: Intel-wired-lan [mailto:intel-wired-lan-bounces@osuosl.org] On > Behalf Of Young Xiao > Sent: Tuesday, May 28, 2019 4:58 AM > To: Kirsher, Jeffrey T <jeffrey.t.kirsher@intel.com>; davem@davemloft.net; > intel-wired-lan@lists.osuosl.org; netdev@vger.kernel.org; linux- > kernel@vger.kernel.org > Cc: Young Xiao <92siuyang@gmail.com> > Subject: [Intel-wired-lan] [PATCH] 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> > --- > drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c | 3 +++ > 1 file changed, 3 insertions(+) Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
diff --git a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c index d189ed2..d2b41f9 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) {
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> --- drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c | 3 +++ 1 file changed, 3 insertions(+)