Skip to content

Commit 8a7cb24

Browse files
Yackoukuba-moo
authored andcommitted
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 578c18e commit 8a7cb24

File tree

2 files changed

+3
-18
lines changed

2 files changed

+3
-18
lines changed

drivers/net/ethernet/stmicro/stmmac/dwmac4_dma.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ static void dwmac4_dma_rx_chan_op_mode(void __iomem *ioaddr, int mode,
232232
u32 channel, int fifosz, u8 qmode)
233233
{
234234
unsigned int rqs = fifosz / 256 - 1;
235-
u32 mtl_rx_op, mtl_rx_int;
235+
u32 mtl_rx_op;
236236

237237
mtl_rx_op = readl(ioaddr + MTL_CHAN_RX_OP_MODE(channel));
238238

@@ -293,11 +293,6 @@ static void dwmac4_dma_rx_chan_op_mode(void __iomem *ioaddr, int mode,
293293
}
294294

295295
writel(mtl_rx_op, ioaddr + MTL_CHAN_RX_OP_MODE(channel));
296-
297-
/* Enable MTL RX overflow */
298-
mtl_rx_int = readl(ioaddr + MTL_CHAN_INT_CTRL(channel));
299-
writel(mtl_rx_int | MTL_RX_OVERFLOW_INT_EN,
300-
ioaddr + MTL_CHAN_INT_CTRL(channel));
301296
}
302297

303298
static void dwmac4_dma_tx_chan_op_mode(void __iomem *ioaddr, int mode,

drivers/net/ethernet/stmicro/stmmac/stmmac_main.c

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5587,7 +5587,6 @@ static void stmmac_common_interrupt(struct stmmac_priv *priv)
55875587
/* To handle GMAC own interrupts */
55885588
if ((priv->plat->has_gmac) || xmac) {
55895589
int status = stmmac_host_irq_status(priv, priv->hw, &priv->xstats);
5590-
int mtl_status;
55915590

55925591
if (unlikely(status)) {
55935592
/* For LPI we need to save the tx status */
@@ -5598,17 +5597,8 @@ static void stmmac_common_interrupt(struct stmmac_priv *priv)
55985597
}
55995598

56005599
for (queue = 0; queue < queues_count; queue++) {
5601-
struct stmmac_rx_queue *rx_q = &priv->rx_queue[queue];
5602-
5603-
mtl_status = stmmac_host_mtl_irq_status(priv, priv->hw,
5604-
queue);
5605-
if (mtl_status != -EINVAL)
5606-
status |= mtl_status;
5607-
5608-
if (status & CORE_IRQ_MTL_RX_OVERFLOW)
5609-
stmmac_set_rx_tail_ptr(priv, priv->ioaddr,
5610-
rx_q->rx_tail_addr,
5611-
queue);
5600+
status = stmmac_host_mtl_irq_status(priv, priv->hw,
5601+
queue);
56125602
}
56135603

56145604
/* PCS link status */

0 commit comments

Comments
 (0)