summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/intel/e1000e
diff options
context:
space:
mode:
authorDmitry Fleytman <dmitry@daynix.com>2015-10-13 12:48:18 +0300
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2015-12-13 10:14:21 +0300
commitb77ac46bbae862dcb3f51296825c940404c69b0f (patch)
treea1813636414eb0ae33531db9fe4d627622619727 /drivers/net/ethernet/intel/e1000e
parent13a87c124ec8a717b557cd8bc08693af021c8812 (diff)
downloadlinux-b77ac46bbae862dcb3f51296825c940404c69b0f.tar.xz
e1000e: fix division by zero on jumbo MTUs
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: Dmitry Fleytman <dmitry@daynix.com> Signed-off-by: Leonid Bloch <leonid@daynix.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Diffstat (limited to 'drivers/net/ethernet/intel/e1000e')
-rw-r--r--drivers/net/ethernet/intel/e1000e/netdev.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c
index 0003bf61b211..772447306c13 100644
--- a/drivers/net/ethernet/intel/e1000e/netdev.c
+++ b/drivers/net/ethernet/intel/e1000e/netdev.c
@@ -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;
}