OSDN Git Service

net: stmmac: Do not enable RX FIFO overflow interrupts
authorYannick Vignon <yannick.vignon@nxp.com>
Thu, 6 May 2021 14:33:12 +0000 (16:33 +0200)
committerJakub Kicinski <kuba@kernel.org>
Fri, 7 May 2021 22:53:57 +0000 (15:53 -0700)
commit8a7cb245cf28cb3e541e0d6c8624b95d079e155b
treea8644fbe9e589e4e794f860d14581115af6ae165
parent578c18eff1627d6a911f08f4cf351eca41fdcc7d
net: stmmac: Do not enable RX FIFO overflow interrupts

The RX FIFO overflows when the system is not able to process all received
packets and they start accumulating (first in the DMA queue in memory,
then in the FIFO). An interrupt is then raised for each overflowing packet
and handled in stmmac_interrupt(). This is counter-productive, since it
brings the system (or more likely, one CPU core) to its knees to process
the FIFO overflow interrupts.

stmmac_interrupt() handles overflow interrupts by writing the rx tail ptr
into the corresponding hardware register (according to the MAC spec, this
has the effect of restarting the MAC DMA). However, without freeing any rx
descriptors, the DMA stops right away, and another overflow interrupt is
raised as the FIFO overflows again. Since the DMA is already restarted at
the end of stmmac_rx_refill() after freeing descriptors, disabling FIFO
overflow interrupts and the corresponding handling code has no side effect,
and eliminates the interrupt storm when the RX FIFO overflows.

Signed-off-by: Yannick Vignon <yannick.vignon@nxp.com>
Link: https://lore.kernel.org/r/20210506143312.20784-1-yannick.vignon@oss.nxp.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/stmicro/stmmac/dwmac4_dma.c
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c