From: Marek Vasut <marex@nabladev.com>
To: netdev@vger.kernel.org
Cc: Marek Vasut <marex@nabladev.com>,
stable@vger.kernel.org, "David S. Miller" <davem@davemloft.net>,
Andrew Lunn <andrew+netdev@lunn.ch>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>,
Nicolai Buchwitz <nb@tipi-net.de>,
Paolo Abeni <pabeni@redhat.com>,
Ronald Wahl <ronald.wahl@raritan.com>,
Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
Yicong Hui <yiconghui@gmail.com>,
linux-kernel@vger.kernel.org
Subject: [net,PATCH v3 2/2] net: ks8851: Avoid excess softirq scheduling
Date: Tue, 14 Apr 2026 12:32:53 +0200 [thread overview]
Message-ID: <20260414103327.113500-2-marex@nabladev.com> (raw)
In-Reply-To: <20260414103327.113500-1-marex@nabladev.com>
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.
Fixes: e0863634bf9f ("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>
---
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Andrew Lunn <andrew+netdev@lunn.ch>
Cc: Eric Dumazet <edumazet@google.com>
Cc: Jakub Kicinski <kuba@kernel.org>
Cc: Nicolai Buchwitz <nb@tipi-net.de>
Cc: Paolo Abeni <pabeni@redhat.com>
Cc: Ronald Wahl <ronald.wahl@raritan.com>
Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: Yicong Hui <yiconghui@gmail.com>
Cc: linux-kernel@vger.kernel.org
Cc: netdev@vger.kernel.org
---
V3: New patch
---
drivers/net/ethernet/micrel/ks8851_common.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/micrel/ks8851_common.c b/drivers/net/ethernet/micrel/ks8851_common.c
index 6c375647b24de..4afbb40bc0e4a 100644
--- a/drivers/net/ethernet/micrel/ks8851_common.c
+++ b/drivers/net/ethernet/micrel/ks8851_common.c
@@ -373,9 +373,12 @@ static irqreturn_t ks8851_irq(int irq, void *_ks)
if (status & IRQ_LCI)
mii_check_link(&ks->mii);
- if (status & IRQ_RXI)
+ if (status & IRQ_RXI) {
+ local_bh_disable();
while ((skb = __skb_dequeue(&rxq)))
netif_rx(skb);
+ local_bh_enable();
+ }
return IRQ_HANDLED;
}
--
2.53.0
next prev parent reply other threads:[~2026-04-14 10:33 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-14 10:32 [net,PATCH v3 1/2] net: ks8851: Reinstate disabling of BHs around IRQ handler Marek Vasut
2026-04-14 10:32 ` Marek Vasut [this message]
2026-04-14 13:02 ` [net,PATCH v3 2/2] net: ks8851: Avoid excess softirq scheduling Sebastian Andrzej Siewior
2026-04-14 12:57 ` [net,PATCH v3 1/2] net: ks8851: Reinstate disabling of BHs around IRQ handler Sebastian Andrzej Siewior
2026-04-14 14:20 ` Marek Vasut
2026-04-14 14:52 ` Sebastian Andrzej Siewior
2026-04-15 23:14 ` Marek Vasut
2026-04-16 6:21 ` Sebastian Andrzej Siewior
2026-04-16 9:26 ` Marek Vasut
2026-04-16 10:48 ` Sebastian Andrzej Siewior
2026-04-14 15:09 ` Jakub Kicinski
2026-04-14 15:29 ` Jakub Kicinski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260414103327.113500-2-marex@nabladev.com \
--to=marex@nabladev.com \
--cc=andrew+netdev@lunn.ch \
--cc=bigeasy@linutronix.de \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nb@tipi-net.de \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=ronald.wahl@raritan.com \
--cc=stable@vger.kernel.org \
--cc=yiconghui@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox