Re: [PATCH net-next] net: drop the weight argument from netif_napi_add

From
Jason A. Donenfeld <Jason@zx2c4.com>
Date
2022-09-27 15:55:35
Also in
linux-can, netdev
Reply to
Jakub Kicinski, 2022-09-27
On Tue, Sep 27, 2022 at 06:27:53AM -0700, Jakub Kicinski wrote:
quoted hunk ↗ jump to hunk
We tell driver developers to always pass NAPI_POLL_WEIGHT
as the weight to netif_napi_add(). This may be confusing
to newcomers, drop the weight argument, those who really
need to tweak the weight can use netif_napi_add_weight().

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
 drivers/net/wireguard/peer.c                  |  3 +--
diff --git a/drivers/net/wireguard/peer.c b/drivers/net/wireguard/peer.c
index 1acd00ab2fbc..1cb502a932e0 100644
--- a/drivers/net/wireguard/peer.c
+++ b/drivers/net/wireguard/peer.c
@@ -54,8 +54,7 @@ struct wg_peer *wg_peer_create(struct wg_device *wg,
 	skb_queue_head_init(&peer->staged_packet_queue);
 	wg_noise_reset_last_sent_handshake(&peer->last_sent_handshake);
 	set_bit(NAPI_STATE_NO_BUSY_POLL, &peer->napi.state);
-	netif_napi_add(wg->dev, &peer->napi, wg_packet_rx_poll,
-		       NAPI_POLL_WEIGHT);
+	netif_napi_add(wg->dev, &peer->napi, wg_packet_rx_poll);
 	napi_enable(&peer->napi);
 	list_add_tail(&peer->peer_list, &wg->peer_list);
 	INIT_LIST_HEAD(&peer->allowedips_list);
For the wireguard part,

   Acked-by: Jason A. Donenfeld [off-list ref]
Thread (11 messages) 11 messages, 7 authors, last reply 2022-10-02
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help