* [PATCH] e1000e: fix division by zero on jumbo MTUs
@ 2015-10-13 9:48 Leonid Bloch
2015-11-20 4:45 ` Brown, Aaron F
0 siblings, 1 reply; 2+ messages in thread
From: Leonid Bloch @ 2015-10-13 9:48 UTC (permalink / raw)
To: linux-kernel
Cc: Jeff Kirsher, Jesse Brandeburg, Shannon Nelson, Carolyn Wyborny,
Don Skidmore, Matthew Vick, John Ronciak, Mitch Williams,
intel-wired-lan, netdev, Dmitry Fleytman
From: Dmitry Fleytman <dmitry@daynix.com>
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>
---
drivers/net/ethernet/intel/e1000e/netdev.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c
index faf4b3f..a60dce1 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;
}
--
2.4.3
^ permalink raw reply related [flat|nested] 2+ messages in thread
* RE: [PATCH] e1000e: fix division by zero on jumbo MTUs
2015-10-13 9:48 [PATCH] e1000e: fix division by zero on jumbo MTUs Leonid Bloch
@ 2015-11-20 4:45 ` Brown, Aaron F
0 siblings, 0 replies; 2+ messages in thread
From: Brown, Aaron F @ 2015-11-20 4:45 UTC (permalink / raw)
To: Leonid Bloch, linux-kernel
Cc: Kirsher, Jeffrey T, Brandeburg, Jesse, Nelson, Shannon, Wyborny,
Carolyn, Skidmore, Donald C, Vick, Matthew, Ronciak, John,
Williams, Mitch A, intel-wired-lan, netdev, Dmitry Fleytman
> From: netdev-owner@vger.kernel.org [mailto:netdev-
> owner@vger.kernel.org] On Behalf Of Leonid Bloch
> Sent: Tuesday, October 13, 2015 2:48 AM
> To: linux-kernel@vger.kernel.org
> Cc: Kirsher, Jeffrey T <jeffrey.t.kirsher@intel.com>; Brandeburg, Jesse
> <jesse.brandeburg@intel.com>; Nelson, Shannon
> <shannon.nelson@intel.com>; Wyborny, Carolyn
> <carolyn.wyborny@intel.com>; Skidmore, Donald C
> <donald.c.skidmore@intel.com>; Vick, Matthew <matthew.vick@intel.com>;
> Ronciak, John <john.ronciak@intel.com>; Williams, Mitch A
> <mitch.a.williams@intel.com>; intel-wired-lan@lists.osuosl.org;
> netdev@vger.kernel.org; Dmitry Fleytman <dmitry@daynix.com>
> Subject: [PATCH] e1000e: fix division by zero on jumbo MTUs
>
> From: Dmitry Fleytman <dmitry@daynix.com>
>
> 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>
> ---
> drivers/net/ethernet/intel/e1000e/netdev.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-11-20 4:46 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-13 9:48 [PATCH] e1000e: fix division by zero on jumbo MTUs Leonid Bloch
2015-11-20 4:45 ` Brown, Aaron F
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).