From: Rosen Penev <rosenp@gmail.com>
To: netdev@vger.kernel.org
Cc: Andrew Lunn <andrew+netdev@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
linux-kernel@vger.kernel.org (open list)
Subject: [PATCH] net: ibm: emac: Use napi_gro_receive() for Rx packets
Date: Thu, 21 May 2026 14:59:08 -0700 [thread overview]
Message-ID: <20260521215908.257118-1-rosenp@gmail.com> (raw)
emac_poll_rx() already runs in NAPI context and TAH-equipped EMACs set
CHECKSUM_UNNECESSARY on verified frames, which lets GRO coalesce TCP
segments without a software checksum on the merge path. Replace the
per-poll rx_list batched with netif_receive_skb_list() with direct
napi_gro_receive() calls so the stack can merge segments into super-skbs
and skip a full traversal per packet -- a meaningful win on the slow
4xx-class CPUs this driver targets.
Small routing speed improvement tested on a Cisco Meraki MX60W:
Tested with iperf3
Before:
[ ID] Interval Transfer Bitrate Retr
[ 5] 0.00-10.00 sec 494 MBytes 414 Mbits/sec 839 sender
[ 5] 0.00-10.04 sec 492 MBytes 411 Mbits/sec receiver
After:
[ ID] Interval Transfer Bitrate Retr
[ 5] 0.00-10.00 sec 510 MBytes 428 Mbits/sec 580 sender
[ 5] 0.00-10.04 sec 508 MBytes 424 Mbits/sec receiver
Traffic to and from the router seems to be slow no matter what:
Tested with iperf3 --bidir
Before:
[ ID][Role] Interval Transfer Bitrate Retr
[ 8][TX-C] 0.00-10.00 sec 297 MBytes 249 Mbits/sec 35 sender
[ 8][TX-C] 0.00-10.00 sec 293 MBytes 245 Mbits/sec receiver
[ 10][RX-C] 0.00-10.00 sec 184 MBytes 154 Mbits/sec 0 sender
[ 10][RX-C] 0.00-10.00 sec 184 MBytes 154 Mbits/sec receiver
After:
[ ID][Role] Interval Transfer Bitrate Retr
[ 8][TX-C] 0.00-10.00 sec 295 MBytes 248 Mbits/sec 31 sender
[ 8][TX-C] 0.00-10.00 sec 294 MBytes 246 Mbits/sec receiver
[ 10][RX-C] 0.00-10.00 sec 181 MBytes 152 Mbits/sec 0 sender
[ 10][RX-C] 0.00-10.00 sec 181 MBytes 152 Mbits/sec receiver
Assisted-by: Claude:Opus-4.7
Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
drivers/net/ethernet/ibm/emac/core.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/ibm/emac/core.c b/drivers/net/ethernet/ibm/emac/core.c
index adac0b55936c..11d673a9f119 100644
--- a/drivers/net/ethernet/ibm/emac/core.c
+++ b/drivers/net/ethernet/ibm/emac/core.c
@@ -1738,7 +1738,6 @@ static inline int emac_rx_sg_append(struct emac_instance *dev, int slot)
/* NAPI poll context */
static int emac_poll_rx(void *param, int budget)
{
- LIST_HEAD(rx_list);
struct emac_instance *dev = param;
int slot = dev->rx_slot, received = 0;
@@ -1795,7 +1794,7 @@ static int emac_poll_rx(void *param, int budget)
skb->protocol = eth_type_trans(skb, dev->ndev);
emac_rx_csum(dev, skb, ctrl);
- list_add_tail(&skb->list, &rx_list);
+ napi_gro_receive(&dev->mal->napi, skb);
next:
++dev->stats.rx_packets;
skip:
@@ -1839,8 +1838,6 @@ static int emac_poll_rx(void *param, int budget)
goto next;
}
- netif_receive_skb_list(&rx_list);
-
if (received) {
DBG2(dev, "rx %d BDs" NL, received);
dev->rx_slot = slot;
--
2.54.0
reply other threads:[~2026-05-21 21:59 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20260521215908.257118-1-rosenp@gmail.com \
--to=rosenp@gmail.com \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.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