]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
netconsole: move push_udp() from netpoll
authorBreno Leitao <leitao@debian.org>
Tue, 12 May 2026 10:46:39 +0000 (03:46 -0700)
committerJakub Kicinski <kuba@kernel.org>
Thu, 14 May 2026 01:09:13 +0000 (18:09 -0700)
push_udp() builds the UDP header (and triggers the checksum) for
netconsole's UDP packets. Move it into drivers/net/netconsole.c as
a file-static helper; drop its EXPORT_SYMBOL_GPL and remove the
prototype from include/linux/netpoll.h.

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

index bcedc161b13eca45aa219b8d76a9d8e1ea815de7..e8d96e482fe0572f40b75b70229cd42282a1ea5a 100644 (file)
@@ -1652,6 +1652,24 @@ static struct notifier_block netconsole_netdev_notifier = {
        .notifier_call  = netconsole_netdev_event,
 };
 
+static void push_udp(struct netpoll *np, struct sk_buff *skb, int len)
+{
+       struct udphdr *udph;
+       int udp_len;
+
+       udp_len = len + sizeof(struct udphdr);
+
+       skb_push(skb, sizeof(struct udphdr));
+       skb_reset_transport_header(skb);
+
+       udph = udp_hdr(skb);
+       udph->source = htons(np->local_port);
+       udph->dest = htons(np->remote_port);
+       udph->len = htons(udp_len);
+
+       netpoll_udp_checksum(np, skb, len);
+}
+
 static void push_eth(struct netpoll *np, struct sk_buff *skb)
 {
        struct ethhdr *eth;
index 11eb95b3248e22bee185acae0dbcedc5a5f2348c..03a49953a3d8ac88fce5cb571289f6b79b671933 100644 (file)
@@ -75,7 +75,6 @@ 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_udp_checksum(struct netpoll *np, struct sk_buff *skb, int len);
-void push_udp(struct netpoll *np, struct sk_buff *skb, int len);
 
 #ifdef CONFIG_NETPOLL
 static inline void *netpoll_poll_lock(struct napi_struct *napi)
index 12165667705f3e7e03ec1f7b28b81e0b8b2ec416..96c65625f4cbb8862eafcb5b9d84118eab14ce82 100644 (file)
@@ -412,25 +412,6 @@ netdev_tx_t netpoll_send_skb(struct netpoll *np, struct sk_buff *skb)
 }
 EXPORT_SYMBOL(netpoll_send_skb);
 
-void push_udp(struct netpoll *np, struct sk_buff *skb, int len)
-{
-       struct udphdr *udph;
-       int udp_len;
-
-       udp_len = len + sizeof(struct udphdr);
-
-       skb_push(skb, sizeof(struct udphdr));
-       skb_reset_transport_header(skb);
-
-       udph = udp_hdr(skb);
-       udph->source = htons(np->local_port);
-       udph->dest = htons(np->remote_port);
-       udph->len = htons(udp_len);
-
-       netpoll_udp_checksum(np, skb, len);
-}
-EXPORT_SYMBOL_GPL(push_udp);
-
 static void skb_pool_flush(struct netpoll *np)
 {
        struct sk_buff_head *skb_pool;