mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH net-next v2] net: ag71xx: Use default NAPI weight
@ 2026-10-07 17:36 Rosen Penev
  2026-10-07 18:28 ` Andrew Lunn
  0 siblings, 1 reply; 2+ messages in thread
From: Rosen Penev @ 2026-10-07 17:36 UTC (permalink / raw)
  To: netdev
  Cc: Chris Snook, Andrew Lunn, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, open list

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
Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
 v2: move out of patchset
 drivers/net/ethernet/atheros/ag71xx.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/drivers/net/ethernet/atheros/ag71xx.c b/drivers/net/ethernet/atheros/ag71xx.c
index 4e4794c4dfdc..8a3c689f6825 100644
--- a/drivers/net/ethernet/atheros/ag71xx.c
+++ b/drivers/net/ethernet/atheros/ag71xx.c
@@ -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);
 
-- 
2.56.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH net-next v2] net: ag71xx: Use default NAPI weight
  2026-10-07 17:36 [PATCH net-next v2] net: ag71xx: Use default NAPI weight Rosen Penev
@ 2026-10-07 18:28 ` Andrew Lunn
  0 siblings, 0 replies; 2+ messages in thread
From: Andrew Lunn @ 2026-10-07 18:28 UTC (permalink / raw)
  To: Rosen Penev
  Cc: netdev, Chris Snook, Andrew Lunn, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, open list

On Wed, Oct 07, 2026 at 10:36:28AM -0700, Rosen Penev 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.
> 
> 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
> Signed-off-by: Rosen Penev <rosenp@gmail.com>

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-10-07 18:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-07 17:36 [PATCH net-next v2] net: ag71xx: Use default NAPI weight Rosen Penev
2026-10-07 18:28 ` Andrew Lunn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®