]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
netconsole: move push_eth() from netpoll
authorBreno Leitao <leitao@debian.org>
Tue, 12 May 2026 10:46:38 +0000 (03:46 -0700)
committerJakub Kicinski <kuba@kernel.org>
Thu, 14 May 2026 01:09:12 +0000 (18:09 -0700)
push_eth() builds the Ethernet header 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-5-1191d14ad66d@debian.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/netconsole.c
include/linux/netpoll.h
net/core/netpoll.c

index 84f90b53a10f77fab995406fa7b0f61acfb6bb26..bcedc161b13eca45aa219b8d76a9d8e1ea815de7 100644 (file)
@@ -1652,6 +1652,20 @@ static struct notifier_block netconsole_netdev_notifier = {
        .notifier_call  = netconsole_netdev_event,
 };
 
+static void push_eth(struct netpoll *np, struct sk_buff *skb)
+{
+       struct ethhdr *eth;
+
+       eth = skb_push(skb, ETH_HLEN);
+       skb_reset_mac_header(skb);
+       ether_addr_copy(eth->h_source, np->dev->dev_addr);
+       ether_addr_copy(eth->h_dest, np->remote_mac);
+       if (np->ipv6)
+               eth->h_proto = htons(ETH_P_IPV6);
+       else
+               eth->h_proto = htons(ETH_P_IP);
+}
+
 static void push_ipv4(struct netpoll *np, struct sk_buff *skb, int len)
 {
        static atomic_t ip_ident;
index 1fcde9c87b8c24ac691fa94b067d973c3466a8a9..11eb95b3248e22bee185acae0dbcedc5a5f2348c 100644 (file)
@@ -76,7 +76,6 @@ 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);
-void push_eth(struct netpoll *np, struct sk_buff *skb);
 
 #ifdef CONFIG_NETPOLL
 static inline void *netpoll_poll_lock(struct napi_struct *napi)
index 030424e43bfb4f0dd416a2ec9b723af6fc168b52..12165667705f3e7e03ec1f7b28b81e0b8b2ec416 100644 (file)
@@ -431,21 +431,6 @@ void push_udp(struct netpoll *np, struct sk_buff *skb, int len)
 }
 EXPORT_SYMBOL_GPL(push_udp);
 
-void push_eth(struct netpoll *np, struct sk_buff *skb)
-{
-       struct ethhdr *eth;
-
-       eth = skb_push(skb, ETH_HLEN);
-       skb_reset_mac_header(skb);
-       ether_addr_copy(eth->h_source, np->dev->dev_addr);
-       ether_addr_copy(eth->h_dest, np->remote_mac);
-       if (np->ipv6)
-               eth->h_proto = htons(ETH_P_IPV6);
-       else
-               eth->h_proto = htons(ETH_P_IP);
-}
-EXPORT_SYMBOL_GPL(push_eth);
-
 static void skb_pool_flush(struct netpoll *np)
 {
        struct sk_buff_head *skb_pool;