Skip to content

Commit fa0c428

Browse files
Marek Vasutgregkh
authored andcommitted
net: ks8851: Avoid excess softirq scheduling
commit 22230e6 upstream. The code injects a packet into netif_rx() repeatedly, which will add it to its internal NAPI and schedule a softirq, and process it. It is more efficient to queue multiple packets and process them all at the local_bh_enable() time. Reviewed-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Fixes: e086363 ("net: ks8851: Queue RX packets in IRQ handler instead of disabling BHs") Cc: stable@vger.kernel.org Signed-off-by: Marek Vasut <marex@nabladev.com> Link: https://patch.msgid.link/20260415231020.455298-2-marex@nabladev.com Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 640a763 commit fa0c428

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

drivers/net/ethernet/micrel/ks8851_common.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -389,9 +389,12 @@ static irqreturn_t ks8851_irq(int irq, void *_ks)
389389
if (status & IRQ_LCI)
390390
mii_check_link(&ks->mii);
391391

392-
if (status & IRQ_RXI)
392+
if (status & IRQ_RXI) {
393+
local_bh_disable();
393394
while ((skb = __skb_dequeue(&rxq)))
394395
netif_rx(skb);
396+
local_bh_enable();
397+
}
395398

396399
return IRQ_HANDLED;
397400
}

0 commit comments

Comments
 (0)