Skip to content

Commit

Permalink
net: stmmac: Only disable interrupts if NAPI is scheduled
Browse files Browse the repository at this point in the history
Only disable the interrupts if RX NAPI gets to be scheduled. Also,
schedule the TX NAPI only when the interrupts are disabled.

Signed-off-by: Jose Abreu <joabreu@synopsys.com>
Cc: Joao Pinto <jpinto@synopsys.com>
Cc: David S. Miller <davem@davemloft.net>
Cc: Giuseppe Cavallaro <peppe.cavallaro@st.com>
Cc: Alexandre Torgue <alexandre.torgue@st.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Jose Abreu authored and David S. Miller committed Jun 28, 2019
1 parent 858a31f commit 3ba07de
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -2053,12 +2053,12 @@ static int stmmac_napi_check(struct stmmac_priv *priv, u32 chan)
&priv->xstats, chan);
struct stmmac_channel *ch = &priv->channel[chan];

if (status)
status |= handle_rx | handle_tx;

if ((status & handle_rx) && (chan < priv->plat->rx_queues_to_use)) {
stmmac_disable_dma_irq(priv, priv->ioaddr, chan);
napi_schedule_irqoff(&ch->rx_napi);
if (napi_schedule_prep(&ch->rx_napi)) {
stmmac_disable_dma_irq(priv, priv->ioaddr, chan);
__napi_schedule_irqoff(&ch->rx_napi);
status |= handle_tx;
}
}

if ((status & handle_tx) && (chan < priv->plat->tx_queues_to_use))
Expand Down

0 comments on commit 3ba07de

Please sign in to comment.