Skip to contentSkip to conversation

net: ag71xx: Use default NAPI weight

PATCH Applied Rosen Penev 4 participants 4 messages Oct 7 – Oct 13

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 net: ag71xx: Use default NAPI weight

Drop the custom NAPI weight and let netif_napi_add() use the core default.

The old comment claimed larger weights wasted cycles and cache, but recent RX and TX path changes altered those tradeoffs. Keep the driver on the standard default unless measurements show a device-specific value is needed.

iperf3:

Before:

[ ID][Role] Interval Transfer Bitrate Retr

[  5][TX-C]   0.00-10.00  sec   327 MBytes   274 Mbits/sec   31            sender
[  5][TX-C]   0.00-10.00  sec   325 MBytes   273 Mbits/sec                  receiver
[  7][RX-C]   0.00-10.00  sec   170 MBytes   143 Mbits/sec    0            sender
[  7][RX-C]   0.00-10.00  sec   170 MBytes   143 Mbits/sec                  receiver

After:

[ ID][Role] Interval Transfer Bitrate Retr

[  5][TX-C]   0.00-10.00  sec   341 MBytes   286 Mbits/sec   30            sender
[  5][TX-C]   0.00-10.00  sec   338 MBytes   284 Mbits/sec                  receiver
[  7][RX-C]   0.00-10.00  sec   184 MBytes   154 Mbits/sec    0            sender
[  7][RX-C]   0.00-10.00  sec   184 MBytes   154 Mbits/sec                  receiver
Assisted-by LLM

---
v2: move out of patchset

 drivers/net/ethernet/atheros/ag71xx.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)
drivers/net/ethernet/atheros/ag71xx.c +1 -7
index 4e4794c4dfdc..8a3c689f6825 100644
@@ -40,11 +40,6 @@
 #include <linux/io.h>
 #include <net/selftests.h>
 
-/* For our NAPI weight bigger does *NOT* mean better - it means more
- * D-cache misses and lots more wasted cycles than we'll ever
- * possibly gain from saving instructions.
- */
-#define AG71XX_NAPI_WEIGHT	32
 #define AG71XX_OOM_REFILL	(1 + HZ / 10)
 
 #define AG71XX_INT_ERR	(AG71XX_INT_RX_BE | AG71XX_INT_TX_BE)
@@ -1913,8 +1908,7 @@ static int ag71xx_probe(struct platform_device *pdev)
 		return err;
 	}
 
-	netif_napi_add_weight(ndev, &ag->napi, ag71xx_poll,
-			      AG71XX_NAPI_WEIGHT);
+	netif_napi_add(ndev, &ag->napi, ag71xx_poll);
 
 	ag71xx_wr(ag, AG71XX_REG_MAC_CFG1, 0);
 
Signature · 1 line
2.56.0
Reviewed-by on v2 1/1
#1 lore raw
Quoted 20 lines · Rosen Penev

Drop the custom NAPI weight and let netif_napi_add() use the core default.

The old comment claimed larger weights wasted cycles and cache, but recent RX and TX path changes altered those tradeoffs. Keep the driver on the standard default unless measurements show a device-specific value is needed.

iperf3:

Before:

[ ID][Role] Interval Transfer Bitrate Retr

[  5][TX-C]   0.00-10.00  sec   327 MBytes   274 Mbits/sec   31            sender
[  5][TX-C]   0.00-10.00  sec   325 MBytes   273 Mbits/sec                  receiver
[  7][RX-C]   0.00-10.00  sec   170 MBytes   143 Mbits/sec    0            sender
[  7][RX-C]   0.00-10.00  sec   170 MBytes   143 Mbits/sec                  receiver

After:

Quoted 8 lines

[ ID][Role] Interval Transfer Bitrate Retr

[  5][TX-C]   0.00-10.00  sec   341 MBytes   286 Mbits/sec   30            sender
[  5][TX-C]   0.00-10.00  sec   338 MBytes   284 Mbits/sec                  receiver
[  7][RX-C]   0.00-10.00  sec   184 MBytes   154 Mbits/sec    0            sender
[  7][RX-C]   0.00-10.00  sec   184 MBytes   154 Mbits/sec                  receiver
Assisted-by LLM

Andrew

Reviewed-by on v2 1/1
#2 lore raw
In reply to Rosen Penev
Quoted 18 lines

Drop the custom NAPI weight and let netif_napi_add() use the core default.

The old comment claimed larger weights wasted cycles and cache, but recent RX and TX path changes altered those tradeoffs. Keep the driver on the standard default unless measurements show a device-specific value is needed.

iperf3:

Before:

[ ID][Role] Interval Transfer Bitrate Retr

[  5][TX-C]   0.00-10.00  sec   327 MBytes   274 Mbits/sec   31            sender
[  5][TX-C]   0.00-10.00  sec   325 MBytes   273 Mbits/sec                  receiver
[  7][RX-C]   0.00-10.00  sec   170 MBytes   143 Mbits/sec    0            sender
[  7][RX-C]   0.00-10.00  sec   170 MBytes   143 Mbits/sec                  receiver
Quoted 7 lines

After:

[ ID][Role] Interval Transfer Bitrate Retr

[  5][TX-C]   0.00-10.00  sec   341 MBytes   286 Mbits/sec   30            sender
[  5][TX-C]   0.00-10.00  sec   338 MBytes   284 Mbits/sec                  receiver
[  7][RX-C]   0.00-10.00  sec   184 MBytes   154 Mbits/sec    0            sender
[  7][RX-C]   0.00-10.00  sec   184 MBytes   154 Mbits/sec                  receiver
#3 lore raw
In reply to Rosen Penev
This patch was applied to netdev/net-next.git (main) by Paolo Abeni <[email protected]>:

Hello:

This patch was applied to netdev/net-next.git (main) by Paolo Abeni <[email protected]>:

Quoted 9 lines · On Wed, 7 Oct 2026 10:36:28 -0700 you wrote:

Drop the custom NAPI weight and let netif_napi_add() use the core default.

The old comment claimed larger weights wasted cycles and cache, but recent RX and TX path changes altered those tradeoffs. Keep the driver on the standard default unless measurements show a device-specific value is needed.

[...]

Here is the summary with links:
- [net-next,v2] net: ag71xx: Use default NAPI weight

    https://git.kernel.org/netdev/net-next/c/0063f777b58d

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html