]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
netpoll: rename and export netpoll_zap_completion_queue()
authorBreno Leitao <leitao@debian.org>
Tue, 12 May 2026 10:46:41 +0000 (03:46 -0700)
committerJakub Kicinski <kuba@kernel.org>
Thu, 14 May 2026 01:09:13 +0000 (18:09 -0700)
zap_completion_queue() drains the per-CPU softnet completion queue.
Rename it with the netpoll_ prefix shared by the rest of the
subsystem's public API, and promote it from file-static to
EXPORT_SYMBOL_NS_GPL in the NETDEV_INTERNAL namespace so the upcoming
netconsole-side find_skb() can call it once the function moves out.
A forward declaration is added to include/linux/netpoll.h, and the
old file-static forward declaration is dropped.

No functional change.

Suggested-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Breno Leitao <leitao@debian.org>
Link: https://patch.msgid.link/20260512-netconsole_split-v2-8-1191d14ad66d@debian.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
include/linux/netpoll.h
net/core/netpoll.c

index 1877d42ccbccf1f8afd33cb18836f69ca484810c..f986f7486cb8ccddb478b3279da73bbf4fd24711 100644 (file)
@@ -74,6 +74,7 @@ void netpoll_cleanup(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 netpoll_zap_completion_queue(void);
 
 #ifdef CONFIG_NETPOLL
 static inline void *netpoll_poll_lock(struct napi_struct *napi)
index c148b3b68cec9fa5095445d3c7cca27e29a15cf8..e4cda0aa4d488ab2c47f3b3c254afb162f6c6cee 100644 (file)
@@ -51,8 +51,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);
 
@@ -199,7 +197,7 @@ void netpoll_poll_dev(struct net_device *dev)
 
        up(&ni->dev_lock);
 
-       zap_completion_queue();
+       netpoll_zap_completion_queue();
 }
 EXPORT_SYMBOL(netpoll_poll_dev);
 
@@ -238,7 +236,7 @@ static void refill_skbs(struct netpoll *np)
        }
 }
 
-static void zap_completion_queue(void)
+void netpoll_zap_completion_queue(void)
 {
        unsigned long flags;
        struct softnet_data *sd = &get_cpu_var(softnet_data);
@@ -265,13 +263,14 @@ static void zap_completion_queue(void)
 
        put_cpu_var(softnet_data);
 }
+EXPORT_SYMBOL_NS_GPL(netpoll_zap_completion_queue, "NETDEV_INTERNAL");
 
 struct sk_buff *find_skb(struct netpoll *np, int len, int reserve)
 {
        int count = 0;
        struct sk_buff *skb;
 
-       zap_completion_queue();
+       netpoll_zap_completion_queue();
 repeat:
 
        skb = alloc_skb(len, GFP_ATOMIC);