Skip to contentSkip to conversation

ixgbevf: fix possible divide by zero in ixgbevf_update_itr

PATCH In review Young Xiao 2 participants 2 messages May 28, 2019 – Jun 13, 2019

Subsystems (3)
lore
Share & tools
lore

Young Xiao

author
#0 lore raw

PATCH 1/1 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")

---
 drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c +3 -0
index d189ed2..d2b41f9 100644
@@ -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) {
Signature · 1 line
2.7.4
Tested-by on v1 1/1
#1 lore raw
Quoted 13 lines

-----Original Message-----
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at osuosl.org] On Behalf Of Young Xiao
Sent: Tuesday, May 28, 2019 4:58 AM
To: Kirsher, Jeffrey T <[email protected]>; davem at davemloft.net; intel-wired-lan at lists.osuosl.org; netdev at vger.kernel.org; linux- kernel at vger.kernel.org
Cc: Young Xiao <[email protected]>
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.

Quoted 7 lines

Copy from commit bdbeefe8ea8c ("ixgbe: fix possible divide by zero in ixgbe_update_itr")

---
 drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c | 3 +++
 1 file changed, 3 insertions(+)