backports.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/8] headers: backport napi add functions
@ 2022-10-13  8:53 Felix Fietkau
  2022-10-13  8:53 ` [PATCH 2/8] headers: backport usb_maxpacket api change Felix Fietkau
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: Felix Fietkau @ 2022-10-13  8:53 UTC (permalink / raw)
  To: backports

Deal with the removed weight argument

Signed-off-by: Felix Fietkau <nbd@nbd.name>
---
 backport/backport-include/linux/netdevice.h | 38 ++++++++++-----------
 1 file changed, 19 insertions(+), 19 deletions(-)

diff --git a/backport/backport-include/linux/netdevice.h b/backport/backport-include/linux/netdevice.h
index 9b3291bb7188..c0c6a97945b1 100644
--- a/backport/backport-include/linux/netdevice.h
+++ b/backport/backport-include/linux/netdevice.h
@@ -23,27 +23,27 @@ static inline bool backport_napi_complete(struct napi_struct *n)
 #define napi_complete LINUX_BACKPORT(napi_complete)
 #endif /* < 4.10 */
 
-#if LINUX_VERSION_IS_LESS(4,5,0)
-#define netif_tx_napi_add LINUX_BACKPORT(netif_tx_napi_add)
-/**
- *	netif_tx_napi_add - initialize a napi context
- *	@dev:  network device
- *	@napi: napi context
- *	@poll: polling function
- *	@weight: default weight
- *
- * This variant of netif_napi_add() should be used from drivers using NAPI
- * to exclusively poll a TX queue.
- * This will avoid we add it into napi_hash[], thus polluting this hash table.
- */
-static inline void netif_tx_napi_add(struct net_device *dev,
-				     struct napi_struct *napi,
-				     int (*poll)(struct napi_struct *, int),
-				     int weight)
+#if LINUX_VERSION_IS_LESS(6,1,0)
+static inline void backport_netif_napi_add(struct net_device *dev,
+					   struct napi_struct *napi,
+					   int (*poll)(struct napi_struct *, int))
+{
+	netif_napi_add(dev, napi, poll, NAPI_POLL_WEIGHT);
+}
+#define netif_napi_add LINUX_BACKPORT(netif_napi_add)
+
+static inline void backport_netif_napi_add_tx(struct net_device *dev,
+					      struct napi_struct *napi,
+					      int (*poll)(struct napi_struct *, int))
 {
-	netif_napi_add(dev, napi, poll, weight);
+#if LINUX_VERSION_IS_LESS(4,5,0)
+	netif_napi_add(dev, napi, poll);
+#else
+	netif_tx_napi_add(dev, napi, poll, NAPI_POLL_WEIGHT);
+#endif
 }
-#endif /* < 4.5 */
+#define netif_napi_add_tx LINUX_BACKPORT(netif_napi_add_tx)
+#endif /* < 6.1 */
 
 #ifndef NETIF_F_CSUM_MASK
 #define NETIF_F_CSUM_MASK NETIF_F_ALL_CSUM
-- 
2.36.1

--
To unsubscribe from this list: send the line "unsubscribe backports" in

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

end of thread, other threads:[~2022-10-13  8:54 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-13  8:53 [PATCH 1/8] headers: backport napi add functions Felix Fietkau
2022-10-13  8:53 ` [PATCH 2/8] headers: backport usb_maxpacket api change Felix Fietkau
2022-10-13  8:53 ` [PATCH 3/8] headers: add txq_trans_cond_update Felix Fietkau
2022-10-13  8:53 ` [PATCH 4/8] headers: add __vstring and __assign_vstr Felix Fietkau
2022-10-13  8:53 ` [PATCH 5/8] headers: backport mmc_sw_reset and mmc_hw_reset API changes Felix Fietkau
2022-10-13  8:53 ` [PATCH 6/8] headers: add DEFINE_SIMPLE_DEV_PM_OPS Felix Fietkau
2022-10-13  8:53 ` [PATCH 7/8] headers: backport device_get_mac_address api change Felix Fietkau
2022-10-13  8:53 ` [PATCH 8/8] headers: add skb_tcp_all_headers Felix Fietkau

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).