Commit c6210760 authored by Dmitry Fleytman's avatar Dmitry Fleytman Committed by Greg Kroah-Hartman

e1000e: fix division by zero on jumbo MTUs

[ Upstream commit b77ac46b ]

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.
Signed-off-by: default avatarDmitry Fleytman <dmitry@daynix.com>
Signed-off-by: default avatarLeonid Bloch <leonid@daynix.com>
Tested-by: default avatarAaron Brown <aaron.f.brown@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: default avatarSasha Levin <alexander.levin@verizon.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent abe2792f
...@@ -1959,8 +1959,10 @@ static irqreturn_t e1000_intr_msix_rx(int __always_unused irq, void *data) ...@@ -1959,8 +1959,10 @@ static irqreturn_t e1000_intr_msix_rx(int __always_unused irq, void *data)
* previous interrupt. * previous interrupt.
*/ */
if (rx_ring->set_itr) { if (rx_ring->set_itr) {
writel(1000000000 / (rx_ring->itr_val * 256), u32 itr = rx_ring->itr_val ?
rx_ring->itr_register); 1000000000 / (rx_ring->itr_val * 256) : 0;
writel(itr, rx_ring->itr_register);
rx_ring->set_itr = 0; rx_ring->set_itr = 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment