e1000e: fix division by zero on jumbo MTUs
Subsystems (3)
PATCH 1/1 e1000e: fix division by zero on jumbo MTUs
From: Dmitry Fleytman <[email protected]>
This patch fixes possible division by zero in receive interrupt handler when working without adaptive interrupt moderation.
The adaptive interrupt moderation mechanism is typically disabled on jumbo MTUs.
--- drivers/net/ethernet/intel/e1000e/netdev.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/net/ethernet/intel/e1000e/netdev.c +4 -2
@@ -1959,8 +1959,10 @@ static irqreturn_t e1000_intr_msix_rx(int __always_unused irq, void *data)* previous interrupt. */ if (rx_ring->set_itr) { -writel (1000000000 / (rx_ring->itr_val *256 ), - rx_ring->itr_register); +u32 itr = rx_ring->itr_val ? +1000000000 / (rx_ring->itr_val *256 ) :0 ; + +writel (itr, rx_ring->itr_register); rx_ring->set_itr =0 ; }
Signature · 1 line
2.4.3
Quoted 20 lines
From: netdev-owner at vger.kernel.org [mailto:netdev-
owner at vger.kernel.org] On Behalf Of Leonid Bloch
Sent: Tuesday, October 13, 2015 2:48 AM
To: linux-kernel at vger.kernel.org
Cc: Kirsher, Jeffrey T <[email protected]>; Brandeburg, Jesse <[email protected]>; Nelson, Shannon <[email protected]>; Wyborny, Carolyn <[email protected]>; Skidmore, Donald C <[email protected]>; Vick, Matthew <[email protected]>; Ronciak, John <[email protected]>; Williams, Mitch A <[email protected]>; intel-wired-lan at lists.osuosl.org; netdev at vger.kernel.org; Dmitry Fleytman <[email protected]>
Subject: [PATCH] e1000e: fix division by zero on jumbo MTUsFrom: Dmitry Fleytman <[email protected]>
This patch fixes possible division by zero in receive interrupt handler when working without adaptive interrupt moderation.
Quoted 8 lines
The adaptive interrupt moderation mechanism is typically disabled on jumbo MTUs.
Signed-off-by Dmitry Fleytman <[email protected]>Signed-off-by Leonid Bloch <[email protected]>--- drivers/net/ethernet/intel/e1000e/netdev.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)