Thread (22 messages) 22 messages, 3 authors, 2025-09-03

Re: [PATCH 4/7] netpoll: Export zap_completion_queue

From: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
Date: 2025-09-02 22:50:27
Also in: linux-rt-devel, lkml

Breno Leitao wrote:
Make zap_completion_queue() a globally visible symbol by changing its
linkage to non-static and adding EXPORT_SYMBOL_GPL.

This is a true netpoll function that will be needed by non-netpoll
functions that will be moved away from netpoll.

This will allow moving the skb pool management to netconsole, mainly
find_skb(), which invokes zap_completion_queue(), and will be moved to
netconsole.

Signed-off-by: Breno Leitao <leitao@debian.org>
Reviewed-by: Willem de Bruijn <willemb@google.com>
quoted hunk ↗ jump to hunk
---
 include/linux/netpoll.h | 1 +
 net/core/netpoll.c      | 5 ++---
 2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/include/linux/netpoll.h b/include/linux/netpoll.h
index 65bfade025f09..7f8b4d758a1e7 100644
--- a/include/linux/netpoll.h
+++ b/include/linux/netpoll.h
@@ -75,6 +75,7 @@ void __netpoll_free(struct netpoll *np);
 void do_netpoll_cleanup(struct netpoll *np);
 netdev_tx_t netpoll_send_skb(struct netpoll *np, struct sk_buff *skb);
 struct sk_buff *find_skb(struct netpoll *np, int len, int reserve);
+void zap_completion_queue(void);
 
 #ifdef CONFIG_NETPOLL
 static inline void *netpoll_poll_lock(struct napi_struct *napi)
diff --git a/net/core/netpoll.c b/net/core/netpoll.c
index 9e12a667a5f0a..04a55ec392fd2 100644
--- a/net/core/netpoll.c
+++ b/net/core/netpoll.c
@@ -50,8 +50,6 @@
 	 sizeof(struct udphdr) +					\
 	 MAX_UDP_CHUNK)
 
-static void zap_completion_queue(void);
-
 static unsigned int carrier_timeout = 4;
 module_param(carrier_timeout, uint, 0644);
 
@@ -240,7 +238,7 @@ static void refill_skbs(struct netpoll *np)
 	spin_unlock_irqrestore(&skb_pool->lock, flags);
 }
 
-static void zap_completion_queue(void)
+void zap_completion_queue(void)
 {
 	unsigned long flags;
 	struct softnet_data *sd = &get_cpu_var(softnet_data);
@@ -267,6 +265,7 @@ static void zap_completion_queue(void)
 
 	put_cpu_var(softnet_data);
 }
+EXPORT_SYMBOL_GPL(zap_completion_queue);
consider EXPORT_SYMBOL_NS_GPL(zap_completion_queue, "NETDEV_INTERNAL");

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help