From nobody Sat Jun 13 08:18:49 2026 Received: from stravinsky.debian.org (stravinsky.debian.org [82.195.75.108]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EDB313E9585; Fri, 8 May 2026 13:29:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=82.195.75.108 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778246992; cv=none; b=B7sM9zKLbGWbI7+W60zrTxXEe6EVe7lbQm5R5u2WxmWcF6VI2lf6NEuL4e9B77SXNUWnXCo+qLGWS8BWJR3VyUlIkUgduj+neHyJh9W4vmmKzMjld3Gws3hcpE4P8XfobfySVW8rr3Z75Y/Luw2ytfPp1VevFNeg/OLlzoopT0s= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778246992; c=relaxed/simple; bh=07fpaNueP6L3dRf3qAgX/iGIbF3PMuZyCj3Rbbal+1s=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=AO0Owcm5FWQsKjO7knw3tHjw4Zk89DBg8vDLZViTkZxx9fv/e6fyUPjSQdZnrWBnqnogAjEyJGaGuRQeLivShpfHBQvJDssZOi2xCTLGaj0jE2SVp5ujyga0nSY+/pJe1zBcWSmTiHMo3nvujqRFPJBqoN0b0dwko9Ywz8soWz4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=debian.org; spf=pass smtp.mailfrom=debian.org; dkim=pass (2048-bit key) header.d=debian.org header.i=@debian.org header.b=ZSas3fhX; arc=none smtp.client-ip=82.195.75.108 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=debian.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=debian.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=debian.org header.i=@debian.org header.b="ZSas3fhX" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debian.org; s=smtpauto.stravinsky; h=X-Debian-User:Cc:To:In-Reply-To:References: Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description; bh=yVdjh0Hy07tpCUlFlB396VlkTSHh7UpPORhLbR9du7k=; b=ZSas3fhXG908aNMP6bmMS53MwG YbdgOkq80Fe+LvYNBJI3JUGTpmMxplgeHe8L1pVXfMGFi4hbIRwmP+2+2I1KzK7sxS9/68GUKsGb8 qbJUfeQySPHB6JT4WnjTQ4gs/ViMqvM7JoCG15uMBWq/+P6px+6dbX7HmnWGk/lYRKNOlr/Ukc4ON 7heVUAf72POGUs6TM54RCA1bMbS4loX1P7JWw4bwD28bhqam9t7dkHPvlgD4yhRNKT9YyFtdh8mwm RXAlI7myLxLrfSh0xwbBIOXcak6zem2nrlte6UA2Og5nAKhoM9Etr4WdoIu8q/xNBQSlajz7dfsRy bEkbHWCA==; Received: from authenticated user by stravinsky.debian.org with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.96) (envelope-from ) id 1wLLGr-005AyM-2q; Fri, 08 May 2026 13:29:38 +0000 From: Breno Leitao Date: Fri, 08 May 2026 06:29:15 -0700 Subject: [PATCH net-next 1/8] netpoll: expose UDP packet builder helpers for netconsole Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260508-netconsole_split-v1-1-0f660e62841f@debian.org> References: <20260508-netconsole_split-v1-0-0f660e62841f@debian.org> In-Reply-To: <20260508-netconsole_split-v1-0-0f660e62841f@debian.org> To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman , Andrew Lunn , Sebastian Andrzej Siewior , Clark Williams , Steven Rostedt Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-rt-devel@lists.linux.dev, Breno Leitao , kernel-team@meta.com X-Mailer: b4 0.16-dev-453a6 X-Developer-Signature: v=1; a=openpgp-sha256; l=4355; i=leitao@debian.org; h=from:subject:message-id; bh=07fpaNueP6L3dRf3qAgX/iGIbF3PMuZyCj3Rbbal+1s=; b=owEBbQKS/ZANAwAIATWjk5/8eHdtAcsmYgBp/eU47sGMolPJNBSSBobjrnMcdaXOpGp7LLDl5 +sPwMIo+cSJAjMEAAEIAB0WIQSshTmm6PRnAspKQ5s1o5Of/Hh3bQUCaf3lOAAKCRA1o5Of/Hh3 bcBbD/9gdHWhs269033hwtj66YQM6yjYXRhfDJkgzKujiEUP92Z2xBUsdUNYPj9gTOgxRxTsrkw +uSvCUusHbuBemnYUvvOD+noWtrivHHBkFGafpGIBXa7RZF1MThVyFLYkLH9YOVMfM9upNAn7YK nOXVyLY2XYIdzNF5Pfsltlsp54eg1piNfzUxP0C489ucTniPx2u84LgKloj4+7s9792fxCFNiJ8 eYxrH2aMnAMW84wtYvDlXiPeAXaUQY53FAXFynVPbSSmEmXYx2k30h/U3zZ/2nUopDVufhw86U7 OiiZOR2Iq9g2lKt7l6ZqDJIFe/otEvKbV6txf3EYpcYKZ6OhM465y0BtWE+Z5GIxk9THjomakYL 4yn2L2EIln/XcVHmWy17hgRVABNz8WduGZYtGeppNA4xi6JllKswhmicX8Tru3g/dMKtqAqPaXu 8t7fJGbCTOjmkoMbAAdVVRCGU7XqrPJXGLyJ7hlOAp8TrlhwNiyttrVmhtZFzM4BqiZcyYZleBZ Ded7Y/KMDy51l52+v6nfa8jVS/DeLx70oy4fyw3mpDvCHWOxLGhCNKIeL/jwuZUl17XCgPHYoL9 Zxnrd2oiQbgMgwyScnnwiUhZeFSaYB1k4mR6mYHBEBJaQ7t8CwUnql+EB2stERfJKt3mahB4rhe tQWv+hkiNDykARw== X-Developer-Key: i=leitao@debian.org; a=openpgp; fpr=AC8539A6E8F46702CA4A439B35A3939FFC78776D X-Debian-User: leitao Promote each from file-static to EXPORT_SYMBOL_GPL and forward- declare them in include/linux/netpoll.h so netconsole can call them once netpoll_send_udp() moves out. These exports are kept until the end of the series, when al of them move into netconsole. No functional change. Signed-off-by: Breno Leitao --- include/linux/netpoll.h | 6 ++++++ net/core/netpoll.c | 20 +++++++++++++------- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/include/linux/netpoll.h b/include/linux/netpoll.h index f22eec4660405..e68c80b329411 100644 --- a/include/linux/netpoll.h +++ b/include/linux/netpoll.h @@ -74,6 +74,12 @@ void __netpoll_free(struct netpoll *np); 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_udp_checksum(struct netpoll *np, struct sk_buff *skb, int len= ); +void push_ipv6(struct netpoll *np, struct sk_buff *skb, int len); +void push_ipv4(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); =20 #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 84faace50ac28..41305056c56ff 100644 --- a/net/core/netpoll.c +++ b/net/core/netpoll.c @@ -268,7 +268,7 @@ static void zap_completion_queue(void) put_cpu_var(softnet_data); } =20 -static struct sk_buff *find_skb(struct netpoll *np, int len, int reserve) +struct sk_buff *find_skb(struct netpoll *np, int len, int reserve) { int count =3D 0; struct sk_buff *skb; @@ -294,6 +294,7 @@ static struct sk_buff *find_skb(struct netpoll *np, int= len, int reserve) skb_reserve(skb, reserve); return skb; } +EXPORT_SYMBOL_GPL(find_skb); =20 static int netpoll_owner_active(struct net_device *dev) { @@ -369,8 +370,8 @@ static netdev_tx_t __netpoll_send_skb(struct netpoll *n= p, struct sk_buff *skb) return ret; } =20 -static void netpoll_udp_checksum(struct netpoll *np, struct sk_buff *skb, - int len) +void netpoll_udp_checksum(struct netpoll *np, struct sk_buff *skb, + int len) { struct udphdr *udph; int udp_len; @@ -393,6 +394,7 @@ static void netpoll_udp_checksum(struct netpoll *np, st= ruct sk_buff *skb, if (udph->check =3D=3D 0) udph->check =3D CSUM_MANGLED_0; } +EXPORT_SYMBOL_GPL(netpoll_udp_checksum); =20 netdev_tx_t netpoll_send_skb(struct netpoll *np, struct sk_buff *skb) { @@ -411,7 +413,7 @@ netdev_tx_t netpoll_send_skb(struct netpoll *np, struct= sk_buff *skb) } EXPORT_SYMBOL(netpoll_send_skb); =20 -static void push_ipv6(struct netpoll *np, struct sk_buff *skb, int len) +void push_ipv6(struct netpoll *np, struct sk_buff *skb, int len) { struct ipv6hdr *ip6h; =20 @@ -433,8 +435,9 @@ static void push_ipv6(struct netpoll *np, struct sk_buf= f *skb, int len) =20 skb->protocol =3D htons(ETH_P_IPV6); } +EXPORT_SYMBOL_GPL(push_ipv6); =20 -static void push_ipv4(struct netpoll *np, struct sk_buff *skb, int len) +void push_ipv4(struct netpoll *np, struct sk_buff *skb, int len) { static atomic_t ip_ident; struct iphdr *iph; @@ -460,8 +463,9 @@ static void push_ipv4(struct netpoll *np, struct sk_buf= f *skb, int len) iph->check =3D ip_fast_csum((unsigned char *)iph, iph->ihl); skb->protocol =3D htons(ETH_P_IP); } +EXPORT_SYMBOL_GPL(push_ipv4); =20 -static void push_udp(struct netpoll *np, struct sk_buff *skb, int len) +void push_udp(struct netpoll *np, struct sk_buff *skb, int len) { struct udphdr *udph; int udp_len; @@ -478,8 +482,9 @@ static void push_udp(struct netpoll *np, struct sk_buff= *skb, int len) =20 netpoll_udp_checksum(np, skb, len); } +EXPORT_SYMBOL_GPL(push_udp); =20 -static void push_eth(struct netpoll *np, struct sk_buff *skb) +void push_eth(struct netpoll *np, struct sk_buff *skb) { struct ethhdr *eth; =20 @@ -492,6 +497,7 @@ static void push_eth(struct netpoll *np, struct sk_buff= *skb) else eth->h_proto =3D htons(ETH_P_IP); } +EXPORT_SYMBOL_GPL(push_eth); =20 int netpoll_send_udp(struct netpoll *np, const char *msg, int len) { --=20 2.53.0-Meta From nobody Sat Jun 13 08:18:49 2026 Received: from stravinsky.debian.org (stravinsky.debian.org [82.195.75.108]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0D05A3DCD80; Fri, 8 May 2026 13:29:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=82.195.75.108 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778246991; cv=none; b=GA0Wb4FiUNArsmWUX6iYntL70E/CVA9Crr+zoCSfhdb/h+3Gyt6hJtpHM0VfNBSlCRuyPfzv0sbFpiNlnAtrsRoZcVlZfAxL3o+TpKaPOudc532zxHN+qe/GNne/ZoOKFPsyV3gyaWVALWTHHakfeUu/iS/nrSKXPkDeKZBE47Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778246991; c=relaxed/simple; bh=g51YoIxKxK7pAG4HD08tG6mrbm89uoSU90lVR64Mqdc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=El5MyPLJJR9UKqWfWMr0XSunfZeImhnE7ocKJeouvSVBq8KPm7Ba1eCnZZs442Bgj4/oGBffYsZuhZOxUqbTa8uq7OX6tUOQ6fnBq91SZlobG+7uboEKaZlL9MsQseX57UbaWETqpt63kGKdyNIgWyPZMjE4o9mHD9FdQGVuljc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=debian.org; spf=pass smtp.mailfrom=debian.org; dkim=pass (2048-bit key) header.d=debian.org header.i=@debian.org header.b=rm8gwQoo; arc=none smtp.client-ip=82.195.75.108 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=debian.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=debian.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=debian.org header.i=@debian.org header.b="rm8gwQoo" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debian.org; s=smtpauto.stravinsky; h=X-Debian-User:Cc:To:In-Reply-To:References: Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description; bh=kCBhypCSxo5qvVndamNwauiU6sS5fgJGsBY2nx0+uIo=; b=rm8gwQooZ1XkDo2DyDI/TxM9BI QS0JQWP58PJoQpoL95rhDEyMI0o4egvbIuQeR2LEpR//BVzEQtI5HaI9jBZJJVSDZBb8fPGq2LMZt s8JQrKD6IwvaJdTN6GdfkI8fcFjCYykzhu7Nj4v5tu++cM+AJ2CvSff10Q7QSzLCgxpOD7B/n6ygd vJC6KLzhmQiej2OuHm8/zzDFsLwddIYFjnp6tOaZVxRgq7PLbWXnKFKmvF6HC6UXH5/QDDgem0m2q mVcQICGVuN9uZcizAap4IQ0/iCdxrhWm+Xwupr2y6pJlfjq8rogg2Xxi6HVv9nZKLhJ/ItDBNrEdr 9x5XxayA==; Received: from authenticated user by stravinsky.debian.org with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.96) (envelope-from ) id 1wLLGw-005Ayr-1T; Fri, 08 May 2026 13:29:42 +0000 From: Breno Leitao Date: Fri, 08 May 2026 06:29:16 -0700 Subject: [PATCH net-next 2/8] netconsole: move netpoll_send_udp() from netpoll Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260508-netconsole_split-v1-2-0f660e62841f@debian.org> References: <20260508-netconsole_split-v1-0-0f660e62841f@debian.org> In-Reply-To: <20260508-netconsole_split-v1-0-0f660e62841f@debian.org> To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman , Andrew Lunn , Sebastian Andrzej Siewior , Clark Williams , Steven Rostedt Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-rt-devel@lists.linux.dev, Breno Leitao , kernel-team@meta.com X-Mailer: b4 0.16-dev-453a6 X-Developer-Signature: v=1; a=openpgp-sha256; l=4492; i=leitao@debian.org; h=from:subject:message-id; bh=g51YoIxKxK7pAG4HD08tG6mrbm89uoSU90lVR64Mqdc=; b=owEBbQKS/ZANAwAIATWjk5/8eHdtAcsmYgBp/eU4cIwx4IvWvPORIAEptPk1PDaGlPsd9KIew FOWaBfTbXiJAjMEAAEIAB0WIQSshTmm6PRnAspKQ5s1o5Of/Hh3bQUCaf3lOAAKCRA1o5Of/Hh3 bYlbEACEGwumathcAKqiKTcPm1ALRN8OfvAbSs7+Bhg5ywgm3AuPsm3k13mKCSOfcG9IHQoyU7s S0FLE8aNgtep40LZO1uKGYVHE3ZwrmrE/86mbsMn3RVGZ+bYi/+mq1HK0gYzPebrZtPLV6sIhkp uc6vzLH7LA4bxZWa6WyAOeMRvanQNIt7lU0TbgN94QGaq5ZZ28CvjajgNX5RoDyCk21pHhmjz6F zXOsOTXggbt7Ecj+lhL4sGAXJpLZzloiBioCqy26y65uMA4eiuOTzX5COEUaM4oTD0Wk+aE2EGI U11jQs0hYx0qCya7wpyhEYN8weE/jEGjhjD1DZmoY6EqClxm6mzqGZngLESIj1cKpQol/nWZ55g SKV4mGZqJQObqi444HJ5KJzFXocpArQy/MaiKgN+EDpe+Ycf/jlM9m3JUJvibgJ3v6e/tYheHaF yIxpFrSfxDbKYX5E5xuUzrt3ak34URRuwSfRLV67GPiZZaRnqLSDXKba8GSPxG20KFkSxMqeFtQ gi7vtVtn1DOrRwl1/GurdUkqfoOjXB+QMt2TQp5FnylPO8qc/wEvb6EkToN02QvBAf1nMI198ro qEAkKfL8wx1CdVQNG/FE23VNTl2RKyEswhMWAz6A13IoiY9h7ZXN34slF20uOFx6YaKBasBN3SH 7YtXfTr8tHBClpQ== X-Developer-Key: i=leitao@debian.org; a=openpgp; fpr=AC8539A6E8F46702CA4A439B35A3939FFC78776D X-Debian-User: leitao Move netpoll_send_udp() from net/core/netpoll.c into drivers/net/netconsole.c as a static helper, drop EXPORT_SYMBOL(), and remove the prototype from include/linux/netpoll.h. netconsole was the only in-tree caller of this entry point. Every other netpoll consumer (bonding, team, vlan, bridge, macvlan, dsa) already builds its own sk_buff and hands it to netpoll_send_skb(), so the netpoll send-side interface is now skb-only. The helpers it depends on (find_skb(), push_ipv6(), push_ipv4(), push_udp(), push_eth(), netpoll_udp_checksum()) were exposed in the previous patches and stay in net/core/netpoll.c for now. Subsequent patches move each of them into netconsole one at a time and drop the corresponding EXPORT_SYMBOL_GPL. Pull , and into netconsole.c so the moved code can name the header structures. Signed-off-by: Breno Leitao --- drivers/net/netconsole.c | 38 ++++++++++++++++++++++++++++++++++++++ include/linux/netpoll.h | 1 - net/core/netpoll.c | 37 ------------------------------------- 3 files changed, 38 insertions(+), 38 deletions(-) diff --git a/drivers/net/netconsole.c b/drivers/net/netconsole.c index 57dd6821a8aa9..56f310041ebda 100644 --- a/drivers/net/netconsole.c +++ b/drivers/net/netconsole.c @@ -32,6 +32,9 @@ #include #include #include +#include +#include +#include #include #include #include @@ -1648,6 +1651,41 @@ static struct notifier_block netconsole_netdev_notif= ier =3D { .notifier_call =3D netconsole_netdev_event, }; =20 +static int netpoll_send_udp(struct netpoll *np, const char *msg, int len) +{ + int total_len, ip_len, udp_len; + struct sk_buff *skb; + + if (!IS_ENABLED(CONFIG_PREEMPT_RT)) + WARN_ON_ONCE(!irqs_disabled()); + + udp_len =3D len + sizeof(struct udphdr); + if (np->ipv6) + ip_len =3D udp_len + sizeof(struct ipv6hdr); + else + ip_len =3D udp_len + sizeof(struct iphdr); + + total_len =3D ip_len + LL_RESERVED_SPACE(np->dev); + + skb =3D find_skb(np, total_len + np->dev->needed_tailroom, + total_len - len); + if (!skb) + return -ENOMEM; + + skb_copy_to_linear_data(skb, msg, len); + skb_put(skb, len); + + push_udp(np, skb, len); + if (np->ipv6) + push_ipv6(np, skb, len); + else + push_ipv4(np, skb, len); + push_eth(np, skb); + skb->dev =3D np->dev; + + return (int)netpoll_send_skb(np, skb); +} + /** * send_udp - Wrapper for netpoll_send_udp that counts errors * @nt: target to send message to diff --git a/include/linux/netpoll.h b/include/linux/netpoll.h index e68c80b329411..57be72bb82dc9 100644 --- a/include/linux/netpoll.h +++ b/include/linux/netpoll.h @@ -67,7 +67,6 @@ static inline void netpoll_poll_disable(struct net_device= *dev) { return; } static inline void netpoll_poll_enable(struct net_device *dev) { return; } #endif =20 -int netpoll_send_udp(struct netpoll *np, const char *msg, int len); int __netpoll_setup(struct netpoll *np, struct net_device *ndev); int netpoll_setup(struct netpoll *np); void __netpoll_free(struct netpoll *np); diff --git a/net/core/netpoll.c b/net/core/netpoll.c index 41305056c56ff..39209308efad0 100644 --- a/net/core/netpoll.c +++ b/net/core/netpoll.c @@ -499,43 +499,6 @@ void push_eth(struct netpoll *np, struct sk_buff *skb) } EXPORT_SYMBOL_GPL(push_eth); =20 -int netpoll_send_udp(struct netpoll *np, const char *msg, int len) -{ - int total_len, ip_len, udp_len; - struct sk_buff *skb; - - if (!IS_ENABLED(CONFIG_PREEMPT_RT)) - WARN_ON_ONCE(!irqs_disabled()); - - udp_len =3D len + sizeof(struct udphdr); - if (np->ipv6) - ip_len =3D udp_len + sizeof(struct ipv6hdr); - else - ip_len =3D udp_len + sizeof(struct iphdr); - - total_len =3D ip_len + LL_RESERVED_SPACE(np->dev); - - skb =3D find_skb(np, total_len + np->dev->needed_tailroom, - total_len - len); - if (!skb) - return -ENOMEM; - - skb_copy_to_linear_data(skb, msg, len); - skb_put(skb, len); - - push_udp(np, skb, len); - if (np->ipv6) - push_ipv6(np, skb, len); - else - push_ipv4(np, skb, len); - push_eth(np, skb); - skb->dev =3D np->dev; - - return (int)netpoll_send_skb(np, skb); -} -EXPORT_SYMBOL(netpoll_send_udp); - - static void skb_pool_flush(struct netpoll *np) { struct sk_buff_head *skb_pool; --=20 2.53.0-Meta From nobody Sat Jun 13 08:18:49 2026 Received: from stravinsky.debian.org (stravinsky.debian.org [82.195.75.108]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5A2D23E5589; Fri, 8 May 2026 13:29:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=82.195.75.108 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778246994; cv=none; b=Ri4vZJ1a9Dv4z9U/+kAA7+BJQNrR9icaK4hbAkVrkRz243038uFsV/WVhrc++tB3u/rcf5cUUZazkBsEzC7NiEOJVwLs3mZGXz3RxKAKYAOHuvsYXq3fckcMV/ou+2TcrB8jo/NKjCSQuKexGjP7Le8bTMyBJtZnX1/MX0L1bEw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778246994; c=relaxed/simple; bh=mxUAmZ420X85haUIzTp19glhWGQdZTf/bXmydQ7s+/8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=S/D4TQn3GEFYBfhDKvfBjoOd1fDG8Qz/DAt6uIfYR95YKEZtDdqUNgVjM6iCfk9r97nSWw9UOE6H3xIabkwA2wwY5vvFg8xB9Tc+geOHnjbCsyngcoVgajoUKsDKNC8hOLHPJOMCJL6vxdnBGWyvCu7QlWMsZf1UdfkBrG90ikk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=debian.org; spf=pass smtp.mailfrom=debian.org; dkim=pass (2048-bit key) header.d=debian.org header.i=@debian.org header.b=RhlfMm0u; arc=none smtp.client-ip=82.195.75.108 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=debian.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=debian.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=debian.org header.i=@debian.org header.b="RhlfMm0u" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debian.org; s=smtpauto.stravinsky; h=X-Debian-User:Cc:To:In-Reply-To:References: Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description; bh=LesysH0/MXvQZiIFUdo6p+9o+QMWkku83rRBrC3W1pg=; b=RhlfMm0uOCKkvOpCILnqgV8Bbv m2UUM3qq7WFq9VyaRlvciAOCfw5IM0HLjsDgafAXXN6YggVVNBFPxPGBGGa6jcAKLEwQJZBVT8s0u aYRzvYWYfvPBitZpAgP5lw/1YVCTMmxBGE8Ufrj9p5sqzqNDKnnM0UhjC9Zlxp2vsDM2Zz31bCR9L rG6CQ9JnoxMeX3H1yzK7U03zjsySnvQGNp6vrDzR7dQheFvLFzSXkKnS7qHm6P5gypBX9IPbTX5B2 mXVnUaUDsX1QCIfzbKeSbtirkndMYkcwIWga8oXdzBx6UnsiPtMeTb0bPaD6LgVxhJxHs6mT4GJ4l tp0ZcGJw==; Received: from authenticated user by stravinsky.debian.org with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.96) (envelope-from ) id 1wLLH0-005Ayz-2u; Fri, 08 May 2026 13:29:47 +0000 From: Breno Leitao Date: Fri, 08 May 2026 06:29:17 -0700 Subject: [PATCH net-next 3/8] netconsole: move push_ipv6() from netpoll Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260508-netconsole_split-v1-3-0f660e62841f@debian.org> References: <20260508-netconsole_split-v1-0-0f660e62841f@debian.org> In-Reply-To: <20260508-netconsole_split-v1-0-0f660e62841f@debian.org> To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman , Andrew Lunn , Sebastian Andrzej Siewior , Clark Williams , Steven Rostedt Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-rt-devel@lists.linux.dev, Breno Leitao , kernel-team@meta.com X-Mailer: b4 0.16-dev-453a6 X-Developer-Signature: v=1; a=openpgp-sha256; l=3314; i=leitao@debian.org; h=from:subject:message-id; bh=mxUAmZ420X85haUIzTp19glhWGQdZTf/bXmydQ7s+/8=; b=owEBbQKS/ZANAwAIATWjk5/8eHdtAcsmYgBp/eU4Sj28l3gQeS6EGFweWHhdthXrAwdqrZ8rM 2Da4DKgWmqJAjMEAAEIAB0WIQSshTmm6PRnAspKQ5s1o5Of/Hh3bQUCaf3lOAAKCRA1o5Of/Hh3 bcywD/48hwqcRSAhB9mE3htbyt0jL9IZqtjYlmtwhnNwBZSLoq6hjkknfKet4Q69RkeNMk7ARwQ G90JbQpUHHuvzAYW7kw3b86GDpKORoP73axVgcjqFitCSNAJsZNudkvRilmZ0X1op/AFYUxlFuK I3l0ll7gfO3N3ub34ce6l131eIW61//pZJA6j39cLUEpO6pB0Do9Bgdm/cAxCIc0f3aaaszblLg PLiYM6C4xMgx6RJqZX0W/49UfuSi05L7PbguldWLF9YE/e5f3IJuijKIVVfhNJCTZ/gscNrvngT HQ5BqRQ8WqvpRefv31SAxcEOIasFuVToPLo+/R4OrzwnGywl296ICnrH1R5izL0ppA2o5WPvCiu X6nt57I6rl72bdrK3jiX0uwCrgaxjm7rKhTe/7JjK8grYVW2bCKbbzrcbd5xC8KdDnRsxBGT6as PZpuAgvslGt2FeC+HuwxSDeAjbRQ2Rp7kATPqQRkDSvOfPBIyE28rnNPT6d1ysy8w/rHlOeKDEF MBzg3F15gTwjw617E7jNGrBqeeefmUs14bg1qWoR9zueVnV8bHKKjNhg3DdscGDuygz8AUjqEwe OqgVmoDVMrql1pClJqQhPfji0wfpPdapzXJHiPf8d1TA12zVGQU41XmXJ5VLokCjG/GEbKNiw+Z U+zQx/SZtF5PHow== X-Developer-Key: i=leitao@debian.org; a=openpgp; fpr=AC8539A6E8F46702CA4A439B35A3939FFC78776D X-Debian-User: leitao push_ipv6() builds the IPv6 header for netconsole's UDP packets. Its only caller, netpoll_send_udp(), now lives in netconsole, so the helper can move there as a file-static function. Drop its EXPORT_SYMBOL_GPL and remove the prototype from include/linux/netpoll.h. Signed-off-by: Breno Leitao --- drivers/net/netconsole.c | 23 +++++++++++++++++++++++ include/linux/netpoll.h | 1 - net/core/netpoll.c | 24 ------------------------ 3 files changed, 23 insertions(+), 25 deletions(-) diff --git a/drivers/net/netconsole.c b/drivers/net/netconsole.c index 56f310041ebda..f805ae95ce7b1 100644 --- a/drivers/net/netconsole.c +++ b/drivers/net/netconsole.c @@ -1651,6 +1651,29 @@ static struct notifier_block netconsole_netdev_notif= ier =3D { .notifier_call =3D netconsole_netdev_event, }; =20 +static void push_ipv6(struct netpoll *np, struct sk_buff *skb, int len) +{ + struct ipv6hdr *ip6h; + + skb_push(skb, sizeof(struct ipv6hdr)); + skb_reset_network_header(skb); + ip6h =3D ipv6_hdr(skb); + + /* ip6h->version =3D 6; ip6h->priority =3D 0; */ + *(unsigned char *)ip6h =3D 0x60; + ip6h->flow_lbl[0] =3D 0; + ip6h->flow_lbl[1] =3D 0; + ip6h->flow_lbl[2] =3D 0; + + ip6h->payload_len =3D htons(sizeof(struct udphdr) + len); + ip6h->nexthdr =3D IPPROTO_UDP; + ip6h->hop_limit =3D 32; + ip6h->saddr =3D np->local_ip.in6; + ip6h->daddr =3D np->remote_ip.in6; + + skb->protocol =3D htons(ETH_P_IPV6); +} + static int netpoll_send_udp(struct netpoll *np, const char *msg, int len) { int total_len, ip_len, udp_len; diff --git a/include/linux/netpoll.h b/include/linux/netpoll.h index 57be72bb82dc9..7f57bd0eac66d 100644 --- a/include/linux/netpoll.h +++ b/include/linux/netpoll.h @@ -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_ipv6(struct netpoll *np, struct sk_buff *skb, int len); void push_ipv4(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); diff --git a/net/core/netpoll.c b/net/core/netpoll.c index 39209308efad0..6a10ca5eaa093 100644 --- a/net/core/netpoll.c +++ b/net/core/netpoll.c @@ -413,30 +413,6 @@ netdev_tx_t netpoll_send_skb(struct netpoll *np, struc= t sk_buff *skb) } EXPORT_SYMBOL(netpoll_send_skb); =20 -void push_ipv6(struct netpoll *np, struct sk_buff *skb, int len) -{ - struct ipv6hdr *ip6h; - - skb_push(skb, sizeof(struct ipv6hdr)); - skb_reset_network_header(skb); - ip6h =3D ipv6_hdr(skb); - - /* ip6h->version =3D 6; ip6h->priority =3D 0; */ - *(unsigned char *)ip6h =3D 0x60; - ip6h->flow_lbl[0] =3D 0; - ip6h->flow_lbl[1] =3D 0; - ip6h->flow_lbl[2] =3D 0; - - ip6h->payload_len =3D htons(sizeof(struct udphdr) + len); - ip6h->nexthdr =3D IPPROTO_UDP; - ip6h->hop_limit =3D 32; - ip6h->saddr =3D np->local_ip.in6; - ip6h->daddr =3D np->remote_ip.in6; - - skb->protocol =3D htons(ETH_P_IPV6); -} -EXPORT_SYMBOL_GPL(push_ipv6); - void push_ipv4(struct netpoll *np, struct sk_buff *skb, int len) { static atomic_t ip_ident; --=20 2.53.0-Meta From nobody Sat Jun 13 08:18:49 2026 Received: from stravinsky.debian.org (stravinsky.debian.org [82.195.75.108]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F1F1A3E558C; Fri, 8 May 2026 13:29:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=82.195.75.108 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778247003; cv=none; b=tAeIDuOpACU6PPS5qlkMoExayfUe9a+teSzu9idu0QDil66D1t/0ZU7qGIp0eGsFdmowbwtPMes1w7VAjQpXOOS2ALWb1Kyj4KoUpD6l95govQKfva0NXXmYV5rGK89BkuKNU0iyjgy0Om/egtJTlMGl+I+xRAdcdEnSk1tKYKw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778247003; c=relaxed/simple; bh=cLO+HVbzM/630mHJi4qoFZSolx/5RGQx4SlxSfx1DMg=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=fC3mAzRSUbZcRfILZit8g5GLAaLMmSlQA5RQxag4xCINCJ261sw5IwFl2pvrD3d+hg/wDaNG5MEXu/qAGk5XtTkJFzN6Rb+Wb02xCTTE7f+YGg0pPaUXIvfkHneIOpYRZJ4xalwg8uX3TKi7s1jYFgL2pExxWDUjafSpkJCNECI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=debian.org; spf=pass smtp.mailfrom=debian.org; dkim=pass (2048-bit key) header.d=debian.org header.i=@debian.org header.b=ngtZBMWo; arc=none smtp.client-ip=82.195.75.108 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=debian.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=debian.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=debian.org header.i=@debian.org header.b="ngtZBMWo" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debian.org; s=smtpauto.stravinsky; h=X-Debian-User:Cc:To:In-Reply-To:References: Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description; bh=NzIMdK4kCc1Qj9zvLOEZvz2a+qMp6//MJYzsoIv7p4Q=; b=ngtZBMWom30HGkjAZkxWnHDQas deGrEW7sntHh8FxLbdkVcXqHzWZv7WCaSPtVcJmMRBivyEC5a9HdvWQqqVzbK5bSG94mP897ZLHht BhZM+hEdC7mziIRWADDzjyNG2QFN9fmZewiop/2OTPGWQLmWSJq66lLaHVlKRluy28APThPjuvlxH LU9JCttJBqnuLPVM06wXjlFjIroCMEM5fO9e80U/6U5OHi8V3fwS1gkx2whm42w9K/3cgiJTtHk4n hp/p8aucbpDT68fQXmoJ74gYLDh9daGbHs11hOzz2PM7+b6ttqQJWVQ0Fk+cLsYaBld8tsmq0S8ku xV0nTTxw==; Received: from authenticated user by stravinsky.debian.org with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.96) (envelope-from ) id 1wLLH5-005Az5-1K; Fri, 08 May 2026 13:29:51 +0000 From: Breno Leitao Date: Fri, 08 May 2026 06:29:18 -0700 Subject: [PATCH net-next 4/8] netconsole: move push_ipv4() from netpoll Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260508-netconsole_split-v1-4-0f660e62841f@debian.org> References: <20260508-netconsole_split-v1-0-0f660e62841f@debian.org> In-Reply-To: <20260508-netconsole_split-v1-0-0f660e62841f@debian.org> To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman , Andrew Lunn , Sebastian Andrzej Siewior , Clark Williams , Steven Rostedt Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-rt-devel@lists.linux.dev, Breno Leitao , kernel-team@meta.com X-Mailer: b4 0.16-dev-453a6 X-Developer-Signature: v=1; a=openpgp-sha256; l=4161; i=leitao@debian.org; h=from:subject:message-id; bh=cLO+HVbzM/630mHJi4qoFZSolx/5RGQx4SlxSfx1DMg=; b=owEBbQKS/ZANAwAIATWjk5/8eHdtAcsmYgBp/eU4IDpVsW4ak1nC20cT4i8r04XSioEqp/XPT ibyMK9SSzKJAjMEAAEIAB0WIQSshTmm6PRnAspKQ5s1o5Of/Hh3bQUCaf3lOAAKCRA1o5Of/Hh3 bcHHD/wN0XcvmygMg/HKxlEbdrs/XKGkEc4G64dySeOqjK8U6g+HRa0aiT6CvdrrnuuOXDzSfGb S8ClRT/y+3Ac7agPlqqB0Md2B46o9BsuxVgBBqJThqRY6LMcbodx9ETfBLdW4Tv8hyFcIoJchfw MOtpiEbRFz2AR3+Vu/d0uI8MRcb9HpzcypUt37eO9I9joPDXsyFy/uluQfi3I1odvWysgFSdWVq g1hTq0YogO7//Fu3r9ncy8oAWqU3Yyz3oJnHqYkY5UX7wZHhacP3sIdfoNj902wBpCNffsEP88C Gr8azVHAmAw3/IYRya7P4XZwa9Lxpg6yDCAm9LDi5kmNQVKYBmtFHSjLeOIdz9zuzcEXUOk7g6k qYJ0Qyd409YqL17Li4po4bhKW8pwH8OHxWMz0glVwHv0CoLOg3sJzKXA+cB8qbyK1ktIOfqNph2 Izgtee+tqhP2WWFOwIZWVsIUKKb4JJHtxmmu3FuX21qYLnUR00eqzkqUriTkE/2pDO7lveDWod5 CTzP9z+wt8MFOgWuOZW0uLUdQ7LelGBDyEytcpuVcNwDZGY7X8K/n4NETi/KVp/qWY7XSdGp7en /oibJRg3G/eoxqSnqP4hyKFo5zVnE+9FLFPlSXrncDNfNaUQPHk7px9cIv3CbATNe5GPgWQrXxI 5LjiCan6qzasBMg== X-Developer-Key: i=leitao@debian.org; a=openpgp; fpr=AC8539A6E8F46702CA4A439B35A3939FFC78776D X-Debian-User: leitao push_ipv4() builds the IPv4 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. put_unaligned() is no longer used in net/core/netpoll.c, so drop the now-stale include from there. Pull it into netconsole.c so the moved code keeps building. Signed-off-by: Breno Leitao --- drivers/net/netconsole.c | 28 ++++++++++++++++++++++++++++ include/linux/netpoll.h | 1 - net/core/netpoll.c | 29 ----------------------------- 3 files changed, 28 insertions(+), 30 deletions(-) diff --git a/drivers/net/netconsole.c b/drivers/net/netconsole.c index f805ae95ce7b1..84f90b53a10f7 100644 --- a/drivers/net/netconsole.c +++ b/drivers/net/netconsole.c @@ -37,6 +37,7 @@ #include #include #include +#include #include #include #include @@ -1651,6 +1652,33 @@ static struct notifier_block netconsole_netdev_notif= ier =3D { .notifier_call =3D netconsole_netdev_event, }; =20 +static void push_ipv4(struct netpoll *np, struct sk_buff *skb, int len) +{ + static atomic_t ip_ident; + struct iphdr *iph; + int ip_len; + + ip_len =3D len + sizeof(struct udphdr) + sizeof(struct iphdr); + + skb_push(skb, sizeof(struct iphdr)); + skb_reset_network_header(skb); + iph =3D ip_hdr(skb); + + /* iph->version =3D 4; iph->ihl =3D 5; */ + *(unsigned char *)iph =3D 0x45; + iph->tos =3D 0; + put_unaligned(htons(ip_len), &iph->tot_len); + iph->id =3D htons(atomic_inc_return(&ip_ident)); + iph->frag_off =3D 0; + iph->ttl =3D 64; + iph->protocol =3D IPPROTO_UDP; + iph->check =3D 0; + put_unaligned(np->local_ip.ip, &iph->saddr); + put_unaligned(np->remote_ip.ip, &iph->daddr); + iph->check =3D ip_fast_csum((unsigned char *)iph, iph->ihl); + skb->protocol =3D htons(ETH_P_IP); +} + static void push_ipv6(struct netpoll *np, struct sk_buff *skb, int len) { struct ipv6hdr *ip6h; diff --git a/include/linux/netpoll.h b/include/linux/netpoll.h index 7f57bd0eac66d..1fcde9c87b8c2 100644 --- a/include/linux/netpoll.h +++ b/include/linux/netpoll.h @@ -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_ipv4(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); =20 diff --git a/net/core/netpoll.c b/net/core/netpoll.c index 6a10ca5eaa093..030424e43bfb4 100644 --- a/net/core/netpoll.c +++ b/net/core/netpoll.c @@ -34,7 +34,6 @@ #include #include #include -#include #include #include =20 @@ -413,34 +412,6 @@ netdev_tx_t netpoll_send_skb(struct netpoll *np, struc= t sk_buff *skb) } EXPORT_SYMBOL(netpoll_send_skb); =20 -void push_ipv4(struct netpoll *np, struct sk_buff *skb, int len) -{ - static atomic_t ip_ident; - struct iphdr *iph; - int ip_len; - - ip_len =3D len + sizeof(struct udphdr) + sizeof(struct iphdr); - - skb_push(skb, sizeof(struct iphdr)); - skb_reset_network_header(skb); - iph =3D ip_hdr(skb); - - /* iph->version =3D 4; iph->ihl =3D 5; */ - *(unsigned char *)iph =3D 0x45; - iph->tos =3D 0; - put_unaligned(htons(ip_len), &iph->tot_len); - iph->id =3D htons(atomic_inc_return(&ip_ident)); - iph->frag_off =3D 0; - iph->ttl =3D 64; - iph->protocol =3D IPPROTO_UDP; - iph->check =3D 0; - put_unaligned(np->local_ip.ip, &iph->saddr); - put_unaligned(np->remote_ip.ip, &iph->daddr); - iph->check =3D ip_fast_csum((unsigned char *)iph, iph->ihl); - skb->protocol =3D htons(ETH_P_IP); -} -EXPORT_SYMBOL_GPL(push_ipv4); - void push_udp(struct netpoll *np, struct sk_buff *skb, int len) { struct udphdr *udph; --=20 2.53.0-Meta From nobody Sat Jun 13 08:18:49 2026 Received: from stravinsky.debian.org (stravinsky.debian.org [82.195.75.108]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BBF553E7166; Fri, 8 May 2026 13:30:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=82.195.75.108 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778247008; cv=none; b=XXaRUwPAh73v1Qb0Zpe0vwPjN1ju58UrfJEJvHAoLURSJxBcmaPwl1LgbbqwS3dYg/qDf2Ivgt9aXYVDj1XfFngWdOzQtFHydjMDbFmNVGSIqyGQ6e38fqVEjaDYlkBOjv8NxeiQd6vKigXChrG73E3Y8UrfnveSh4IQZP7SfEk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778247008; c=relaxed/simple; bh=PMpPkJWHttQX5kh4Gi1+W+Qb2aqcl2x//u13feAjgAU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=HW49blipzUIR1dMNOcfQJ7NQ/v1TzHZLes4VT5MV2lxJh2T+Un/Rh7xKDnn4RkVJc2zgOgKKT9m2sV+hi0TFgXqLUCH2Vau4XHZpI0fnP3BAMbdCwpwLQRXMt0MU2hNG+SeG/kGzH7zXRXBol+0cUKZasZZkbPjam/b+3ZwVfvY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=debian.org; spf=pass smtp.mailfrom=debian.org; dkim=pass (2048-bit key) header.d=debian.org header.i=@debian.org header.b=Gg20uitJ; arc=none smtp.client-ip=82.195.75.108 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=debian.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=debian.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=debian.org header.i=@debian.org header.b="Gg20uitJ" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debian.org; s=smtpauto.stravinsky; h=X-Debian-User:Cc:To:In-Reply-To:References: Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description; bh=ZvvQm/zY3VAgs6XRZ+pEkISjtTM4U0Plb8SiYTnxo3M=; b=Gg20uitJxJWxnG6KjAYAcAHpwe C0fw8z20X7hPDbi/028xV4SrXEf25sEa3cXqnagEL29YL2cu3T6vd94tQMrEVEvIh6GeKlUKGyGKi oICW6brb1IVqq72VPDavVBW7MPa4+E8SIzUg8CZ8J6JuR6jahCpQugr/L0s8wDPkJq0jiL3bO//r4 Tw3E6rz4RGq5x/pDoo/HU7amvu6YbKtVnASb69RlrzwJhCwmxtNGuqlYxJS4aBme42GbsDUhS99Y3 Rt5xvyZ1Tx9zTDGyZVRpvyD1oT1eB+lhzh7gRVaMoDps9alz9fxuDT56xM22ORdEDGUZTR6E9A+v1 awUUnFMQ==; Received: from authenticated user by stravinsky.debian.org with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.96) (envelope-from ) id 1wLLHA-005AzL-0z; Fri, 08 May 2026 13:29:56 +0000 From: Breno Leitao Date: Fri, 08 May 2026 06:29:19 -0700 Subject: [PATCH net-next 5/8] netconsole: move push_eth() from netpoll Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260508-netconsole_split-v1-5-0f660e62841f@debian.org> References: <20260508-netconsole_split-v1-0-0f660e62841f@debian.org> In-Reply-To: <20260508-netconsole_split-v1-0-0f660e62841f@debian.org> To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman , Andrew Lunn , Sebastian Andrzej Siewior , Clark Williams , Steven Rostedt Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-rt-devel@lists.linux.dev, Breno Leitao , kernel-team@meta.com X-Mailer: b4 0.16-dev-453a6 X-Developer-Signature: v=1; a=openpgp-sha256; l=2639; i=leitao@debian.org; h=from:subject:message-id; bh=PMpPkJWHttQX5kh4Gi1+W+Qb2aqcl2x//u13feAjgAU=; b=owEBbQKS/ZANAwAIATWjk5/8eHdtAcsmYgBp/eU4D0tBg0kHmPz41CQsjovX2PRvuv3v5uiM0 +gAF1eaFvmJAjMEAAEIAB0WIQSshTmm6PRnAspKQ5s1o5Of/Hh3bQUCaf3lOAAKCRA1o5Of/Hh3 bVlFD/4/5QHcvzBAOudvYEnr1a/75f+odo3YgFVZ2OEAaXx53gLXxBT2s2Qtv6PlvxzldHgSWyd 0cSiusL8Ebfe7odS3moMJEr8aHE0oXQeNzaw8ruib6uJHdAN0vdLc/n/6mF78FUeFrLw736VXnK vnCXnulkkU7IewYJZyDJm/+sD2sge0mwvq6GgjTlTbFy9a5LnnCSuFUUY5p2HBf3/QU3diVyJIm AljoH7ajir3904uWMxnhfziillVvQdcfGCfcy/pi9aYwjmSH2Pm/dJRrwEaXldt3B5Fdr878BJP AjCBUUCVX27GbmHCamNpb3wACYq/Q2ObSZyvaOGCEmjHuo5SLawuTsEBrjpk30A8DNxYDnbRSI4 i9B73vOeDjiPlWOeE58hCtwjkrZiwKScDLtLU9yUTW5t4a1jWA29sOsF7HEX/9QP1SMfqM2cxoW AEBSCKO8qEhU28IzJZOMIhh3NKGj97p02TElBpAxKpC/5ayUf4cy7Bhqr4HcB8ewybNYuLI87JL QPmyGMWGEXkceNTvaYhC7aYwdTtQlEoc8Nqe6gqxXiR6uxa6ATljUVehGHD7btAiw+3q/7ismr3 sBR392oQi5tvqxsBg1psRvvRuFPx9lj1nQfptAKO8XaMZdnaJW/eNL8fEVBXZi2NiL1HwgR9djg SOtkfgXPO2vOMww== X-Developer-Key: i=leitao@debian.org; a=openpgp; fpr=AC8539A6E8F46702CA4A439B35A3939FFC78776D X-Debian-User: leitao 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 --- drivers/net/netconsole.c | 14 ++++++++++++++ include/linux/netpoll.h | 1 - net/core/netpoll.c | 15 --------------- 3 files changed, 14 insertions(+), 16 deletions(-) diff --git a/drivers/net/netconsole.c b/drivers/net/netconsole.c index 84f90b53a10f7..bcedc161b13ec 100644 --- a/drivers/net/netconsole.c +++ b/drivers/net/netconsole.c @@ -1652,6 +1652,20 @@ static struct notifier_block netconsole_netdev_notif= ier =3D { .notifier_call =3D netconsole_netdev_event, }; =20 +static void push_eth(struct netpoll *np, struct sk_buff *skb) +{ + struct ethhdr *eth; + + eth =3D 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 =3D htons(ETH_P_IPV6); + else + eth->h_proto =3D htons(ETH_P_IP); +} + static void push_ipv4(struct netpoll *np, struct sk_buff *skb, int len) { static atomic_t ip_ident; diff --git a/include/linux/netpoll.h b/include/linux/netpoll.h index 1fcde9c87b8c2..11eb95b3248e2 100644 --- a/include/linux/netpoll.h +++ b/include/linux/netpoll.h @@ -76,7 +76,6 @@ netdev_tx_t netpoll_send_skb(struct netpoll *np, struct s= k_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); =20 #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 030424e43bfb4..12165667705f3 100644 --- a/net/core/netpoll.c +++ b/net/core/netpoll.c @@ -431,21 +431,6 @@ void push_udp(struct netpoll *np, struct sk_buff *skb,= int len) } EXPORT_SYMBOL_GPL(push_udp); =20 -void push_eth(struct netpoll *np, struct sk_buff *skb) -{ - struct ethhdr *eth; - - eth =3D 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 =3D htons(ETH_P_IPV6); - else - eth->h_proto =3D htons(ETH_P_IP); -} -EXPORT_SYMBOL_GPL(push_eth); - static void skb_pool_flush(struct netpoll *np) { struct sk_buff_head *skb_pool; --=20 2.53.0-Meta From nobody Sat Jun 13 08:18:49 2026 Received: from stravinsky.debian.org (stravinsky.debian.org [82.195.75.108]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 360983EC2E9; Fri, 8 May 2026 13:30:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=82.195.75.108 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778247012; cv=none; b=HgmXol5fQL2W/E4I+tAW1N4pO0IvTivbemmg8x67yb5P2nvsvkdLXO7foKtqQWev49w8lgJGtcOYM5CQT7Um3+jLl1oO2F/F+iAs57kg2C3r/NHNYWRCFX5XFPukPadqCOh3qnCcj4JW8CpFIr24JKg7sa0RMK6I3XJsOgqtZ58= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778247012; c=relaxed/simple; bh=4INTG1+oJfjYqTw/8Iufhxk8oIaC+BZeDBdAE6GSv2Y=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=f1grb6XFqxxU6z9Mpk7rlBFUo6bWW7Xrgg974UodB8cUFsbNjOEk8zdFA2gCy/ewSIzdwiWG1bqrN1tW4YUJ3CtoK7US2SjHMM50/SvGut1tZ5WthcqpKwwdzW/Q+TylApBOVvx3wZFUuMwcsKu8g7Ou2VgbRmbFAiXYsAFWs9o= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=debian.org; spf=pass smtp.mailfrom=debian.org; dkim=pass (2048-bit key) header.d=debian.org header.i=@debian.org header.b=IFmXFs5M; arc=none smtp.client-ip=82.195.75.108 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=debian.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=debian.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=debian.org header.i=@debian.org header.b="IFmXFs5M" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debian.org; s=smtpauto.stravinsky; h=X-Debian-User:Cc:To:In-Reply-To:References: Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description; bh=qycDlW1R0cbLg2Vqh/6w/U4a7rxfxey6kPJF0LXVgko=; b=IFmXFs5MCqwlZ2oy1pkuVetCj+ GbXS+l3cRDcp2P51kfCxJ5zJeZWe3cQUf6sa4jtL6h6/987mtoeZOxevfyC8/8BQZCQPK3zEh3e+A keTNgHRLXC6bDpDWYNeM8iMvjOwZB5k+ac+YxDxMsHo3Bv7Aw9XW7zyTFBx70PFZqjgjuUH3OGPPU XPjMDSBdki3uI4lXKSmjGvwAcNyBN4JNRDftLuw+SopFgUz+EMZRFhkvaEXNwn4OkV/FKxZRata/q 1gUJRnhtzYnoTwaK6a15EinnQcvTnhF+Il8TVayLb0XTW1++44uL9K+Q/UC7N7UuxiYYHghFoSq2e nGAeW1iw==; Received: from authenticated user by stravinsky.debian.org with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.96) (envelope-from ) id 1wLLHE-005Azr-2s; Fri, 08 May 2026 13:30:01 +0000 From: Breno Leitao Date: Fri, 08 May 2026 06:29:20 -0700 Subject: [PATCH net-next 6/8] netconsole: move push_udp() from netpoll Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260508-netconsole_split-v1-6-0f660e62841f@debian.org> References: <20260508-netconsole_split-v1-0-0f660e62841f@debian.org> In-Reply-To: <20260508-netconsole_split-v1-0-0f660e62841f@debian.org> To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman , Andrew Lunn , Sebastian Andrzej Siewior , Clark Williams , Steven Rostedt Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-rt-devel@lists.linux.dev, Breno Leitao , kernel-team@meta.com X-Mailer: b4 0.16-dev-453a6 X-Developer-Signature: v=1; a=openpgp-sha256; l=3195; i=leitao@debian.org; h=from:subject:message-id; bh=4INTG1+oJfjYqTw/8Iufhxk8oIaC+BZeDBdAE6GSv2Y=; b=owEBbQKS/ZANAwAIATWjk5/8eHdtAcsmYgBp/eU46lOV4dIaUZoED2/oYJAqO7dSgg5hrPKMo VMbhOOVDyuJAjMEAAEIAB0WIQSshTmm6PRnAspKQ5s1o5Of/Hh3bQUCaf3lOAAKCRA1o5Of/Hh3 bWcZD/95gSRQqF7anw9yiyJLbPygw6q651m/JIh3onSmOowhSEWb3HzNvSXL2558R5tg4r4X583 EmaCAQX6V131gJFpnj/LJfARcwqzsOUqavPrBfpYZTSGBQ3PAoSuR3y4x6HdMPPvfTlf2i110QW +V+2hUUmtVlpFBR9bv8WjR9b8XJI/eAV08sqBdbzJnfgxIOHJC8tnDNKibsHf5aPPpPb2oOLoF5 CV9j5xHUbJNZ6FG6fTWj5yacCbguyczFQnRIv+vT79JaNF5cTY2vB7dtbEVhQ1AhDA9lkGFXW6z KDbeRJTC+A4wX5hFsI/AlFZjgxQAw5zM/o+svBlPLK59QRlUz1ptAAjwpcfvwNyVIU3MGheZhET mCWlDjAlZQQOLZqBgbA6M3RBGOW7Cr899yKOOeHYHQLer404rzz5OQyVBgGJXik0c4N/DZytGOn zzwqSqtoOu6ejObB5Rq+yY7W/TXdpiP4w6wR7hZs8H27OoVCsMcWC5s0DuF76IHyYNKNqB730FT Kz9/E8morAyEaEGG5AoMRNY51VUqWuoUx9e7ecpC5MzTfWAQ3NZ62SeXMOShKgpWiz8DHQdBm3u cxzXm8Pc4tmyA+TQw7JwcUopaBSpOcgKp0hlcDgjo25NJCLVuxzQthFn50tGZEbuxA21vYjVe/D uCFmSeQmwpKwasQ== X-Developer-Key: i=leitao@debian.org; a=openpgp; fpr=AC8539A6E8F46702CA4A439B35A3939FFC78776D X-Debian-User: leitao 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. push_udp() was the last udp_hdr() consumer in net/core/netpoll.c, so swap for there: MAX_SKB_SIZE still needs struct udphdr. Signed-off-by: Breno Leitao --- drivers/net/netconsole.c | 18 ++++++++++++++++++ include/linux/netpoll.h | 1 - net/core/netpoll.c | 21 +-------------------- 3 files changed, 19 insertions(+), 21 deletions(-) diff --git a/drivers/net/netconsole.c b/drivers/net/netconsole.c index bcedc161b13ec..e8d96e482fe05 100644 --- a/drivers/net/netconsole.c +++ b/drivers/net/netconsole.c @@ -1652,6 +1652,24 @@ static struct notifier_block netconsole_netdev_notif= ier =3D { .notifier_call =3D netconsole_netdev_event, }; =20 +static void push_udp(struct netpoll *np, struct sk_buff *skb, int len) +{ + struct udphdr *udph; + int udp_len; + + udp_len =3D len + sizeof(struct udphdr); + + skb_push(skb, sizeof(struct udphdr)); + skb_reset_transport_header(skb); + + udph =3D udp_hdr(skb); + udph->source =3D htons(np->local_port); + udph->dest =3D htons(np->remote_port); + udph->len =3D htons(udp_len); + + netpoll_udp_checksum(np, skb, len); +} + static void push_eth(struct netpoll *np, struct sk_buff *skb) { struct ethhdr *eth; diff --git a/include/linux/netpoll.h b/include/linux/netpoll.h index 11eb95b3248e2..03a49953a3d8a 100644 --- a/include/linux/netpoll.h +++ b/include/linux/netpoll.h @@ -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); =20 #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 12165667705f3..4ec9e309dfe6c 100644 --- a/net/core/netpoll.c +++ b/net/core/netpoll.c @@ -29,8 +29,8 @@ #include #include #include +#include #include -#include #include #include #include @@ -412,25 +412,6 @@ netdev_tx_t netpoll_send_skb(struct netpoll *np, struc= t sk_buff *skb) } EXPORT_SYMBOL(netpoll_send_skb); =20 -void push_udp(struct netpoll *np, struct sk_buff *skb, int len) -{ - struct udphdr *udph; - int udp_len; - - udp_len =3D len + sizeof(struct udphdr); - - skb_push(skb, sizeof(struct udphdr)); - skb_reset_transport_header(skb); - - udph =3D udp_hdr(skb); - udph->source =3D htons(np->local_port); - udph->dest =3D htons(np->remote_port); - udph->len =3D 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; --=20 2.53.0-Meta From nobody Sat Jun 13 08:18:49 2026 Received: from stravinsky.debian.org (stravinsky.debian.org [82.195.75.108]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CD4C53EDAC5; Fri, 8 May 2026 13:30:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=82.195.75.108 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778247015; cv=none; b=jOyHR4/eq9SaFXAZjgowZZne9yBZix6puMB5irX4lhBzEwqwBdfcRjjPh3WF6wJ9VUyIsaDEXmepCdu2wAT8BqQNZSSyxrZb8DivXdPbepM6F/6EljWtxqBbposLByt1Qw5CaKKdXiEy8rIDbL1hdeyhWM3aQbugIMXk+e+y7vE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778247015; c=relaxed/simple; bh=Xbj/pnMzUb5x/z6kxsDEmCXpVFXkthdSDEyl0CENJ9A=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=QIivgPK2RSR9oZZfzFwf1/a4u+18fa8+YUm/eVhUjASrrkaGMpBdiCZyfmSYOkYo0hP6ObV0302A8xXiepDtxM6XCKm8QkzuDx0npq2nrxsmCpPBy8VhXt4ZT1mH68/J0jsHkZvjgxjNHi7L8t1OKducPD3vUJurd3qgC929vj4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=debian.org; spf=pass smtp.mailfrom=debian.org; dkim=pass (2048-bit key) header.d=debian.org header.i=@debian.org header.b=jkIU1Kgx; arc=none smtp.client-ip=82.195.75.108 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=debian.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=debian.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=debian.org header.i=@debian.org header.b="jkIU1Kgx" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debian.org; s=smtpauto.stravinsky; h=X-Debian-User:Cc:To:In-Reply-To:References: Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description; bh=T1Gk+dukeWGSlvBnhpJO7HvMhgIx2N3vM3eGZ0zDWKM=; b=jkIU1KgxFtWShqpAr9RQmjE3iT FNgA/UN+DpyWBpdta3ljzTvoPUiDHn7yzN4w5JZI5DusQtmKLmV9LXxo22yj342zkorqYOtLILYcH 3Tb2EjnTeVUtl3nkWLt8qNb5E6RtXp7P8Uq5pMGf+yE+iD3axxRtY3O4fRRmJIxaSkJjnqDD2pial oX//T4rFajPqCQrIOmLTzImnk1mnDOxmTlaBp/0NqR9+UiY46AUutzHJyS2v1E7DkhLQSiOHGCk02 yDxYlhJ/HOKThQGsis+3BmcXFVMvG+Z9X1FuL8lmaBoLt6OJ2UxUbSD4ciMC7SL0qki1flMQYmHE2 dN5uViHQ==; Received: from authenticated user by stravinsky.debian.org with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.96) (envelope-from ) id 1wLLHJ-005B06-0Y; Fri, 08 May 2026 13:30:05 +0000 From: Breno Leitao Date: Fri, 08 May 2026 06:29:21 -0700 Subject: [PATCH net-next 7/8] netconsole: move netpoll_udp_checksum() from netpoll Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260508-netconsole_split-v1-7-0f660e62841f@debian.org> References: <20260508-netconsole_split-v1-0-0f660e62841f@debian.org> In-Reply-To: <20260508-netconsole_split-v1-0-0f660e62841f@debian.org> To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman , Andrew Lunn , Sebastian Andrzej Siewior , Clark Williams , Steven Rostedt Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-rt-devel@lists.linux.dev, Breno Leitao , kernel-team@meta.com X-Mailer: b4 0.16-dev-453a6 X-Developer-Signature: v=1; a=openpgp-sha256; l=3949; i=leitao@debian.org; h=from:subject:message-id; bh=Xbj/pnMzUb5x/z6kxsDEmCXpVFXkthdSDEyl0CENJ9A=; b=owEBbQKS/ZANAwAIATWjk5/8eHdtAcsmYgBp/eU4M/8qiLCeRK3xfVVwvwbxAQu/cxVJCfajI rTGzFdrcdyJAjMEAAEIAB0WIQSshTmm6PRnAspKQ5s1o5Of/Hh3bQUCaf3lOAAKCRA1o5Of/Hh3 bRJbD/9AuUKfArF1nM8WTMXlAh4V/srcQhp39H+41at0aXtJRdylz5ogAwHze4CblW47auwPyP6 KlLiRfnAnVG2vIiw97lW3FsDoxBR+HSwJD8bqd4i6Aj/PyYTFZkRqdnUBLu5RX1YPayTX5R0m63 zg7ZTEwHM+GHh++wCj446tPK4CJTi0J0BqaoebHxQA1Vn3inDqUw9nLze7/kDq/w/9UVZWOR1W2 aliUNhfbDqdGmM4T2YYRmGWcuTYv7KljJIIAyCBtsoSkdACfUrhlru/0QvNeeR67eRKtNjSA76L XqbQhlITeK5E8uaBK7Rn1NrNgQtVnPi7csCBPxm8FbGi14hypVNk+SL0zV+2ydHQI4SZ/E1BIUG UlFLICPHi3x2ISQyt4SqJ6uGYPfg7nQQipikJWteeAD8lggA7jCEFUKLOWcooZjKo4LEhugUsPA g3FEsE95l1ri2SeSRj4ybuVssm3rTwEjdeA1dWbOslScBqC1+gWIZ5HNlwgJwANXkkpRF8qjLO2 dJLqlnihgISfEsco0XGekALHuWTr4nZHclOxPbl86nKaYBhK7ktm8LgOweXEePlnw1rBq+i2eqJ +X466qwQnuY44acIBE+nUrJQvuhW05g8jx9KPkPkET7F7p+ZuOhM7UXgzO4lHBF8KFjq8G+93B/ Z55nFB+415oVpRQ== X-Developer-Key: i=leitao@debian.org; a=openpgp; fpr=AC8539A6E8F46702CA4A439B35A3939FFC78776D X-Debian-User: leitao netpoll_udp_checksum() computes the UDP checksum for netconsole's 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. This was the last csum_ipv6_magic() consumer in net/core/netpoll.c, so drop the now-stale include there. Pull it into netconsole.c so the moved code keeps building. Signed-off-by: Breno Leitao --- drivers/net/netconsole.c | 26 ++++++++++++++++++++++++++ include/linux/netpoll.h | 1 - net/core/netpoll.c | 27 --------------------------- 3 files changed, 26 insertions(+), 28 deletions(-) diff --git a/drivers/net/netconsole.c b/drivers/net/netconsole.c index e8d96e482fe05..48d2670bbdef5 100644 --- a/drivers/net/netconsole.c +++ b/drivers/net/netconsole.c @@ -38,6 +38,7 @@ #include #include #include +#include #include #include #include @@ -1652,6 +1653,31 @@ static struct notifier_block netconsole_netdev_notif= ier =3D { .notifier_call =3D netconsole_netdev_event, }; =20 +static void netpoll_udp_checksum(struct netpoll *np, struct sk_buff *skb, + int len) +{ + struct udphdr *udph; + int udp_len; + + udp_len =3D len + sizeof(struct udphdr); + udph =3D udp_hdr(skb); + + /* check needs to be set, since it will be consumed in csum_partial */ + udph->check =3D 0; + if (np->ipv6) + udph->check =3D csum_ipv6_magic(&np->local_ip.in6, + &np->remote_ip.in6, + udp_len, IPPROTO_UDP, + csum_partial(udph, udp_len, 0)); + else + udph->check =3D csum_tcpudp_magic(np->local_ip.ip, + np->remote_ip.ip, + udp_len, IPPROTO_UDP, + csum_partial(udph, udp_len, 0)); + if (udph->check =3D=3D 0) + udph->check =3D CSUM_MANGLED_0; +} + static void push_udp(struct netpoll *np, struct sk_buff *skb, int len) { struct udphdr *udph; diff --git a/include/linux/netpoll.h b/include/linux/netpoll.h index 03a49953a3d8a..1877d42ccbccf 100644 --- a/include/linux/netpoll.h +++ b/include/linux/netpoll.h @@ -74,7 +74,6 @@ 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_udp_checksum(struct netpoll *np, struct sk_buff *skb, int len= ); =20 #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 4ec9e309dfe6c..c148b3b68cec9 100644 --- a/net/core/netpoll.c +++ b/net/core/netpoll.c @@ -33,7 +33,6 @@ #include #include #include -#include #include #include =20 @@ -369,32 +368,6 @@ static netdev_tx_t __netpoll_send_skb(struct netpoll *= np, struct sk_buff *skb) return ret; } =20 -void netpoll_udp_checksum(struct netpoll *np, struct sk_buff *skb, - int len) -{ - struct udphdr *udph; - int udp_len; - - udp_len =3D len + sizeof(struct udphdr); - udph =3D udp_hdr(skb); - - /* check needs to be set, since it will be consumed in csum_partial */ - udph->check =3D 0; - if (np->ipv6) - udph->check =3D csum_ipv6_magic(&np->local_ip.in6, - &np->remote_ip.in6, - udp_len, IPPROTO_UDP, - csum_partial(udph, udp_len, 0)); - else - udph->check =3D csum_tcpudp_magic(np->local_ip.ip, - np->remote_ip.ip, - udp_len, IPPROTO_UDP, - csum_partial(udph, udp_len, 0)); - if (udph->check =3D=3D 0) - udph->check =3D CSUM_MANGLED_0; -} -EXPORT_SYMBOL_GPL(netpoll_udp_checksum); - netdev_tx_t netpoll_send_skb(struct netpoll *np, struct sk_buff *skb) { unsigned long flags; --=20 2.53.0-Meta From nobody Sat Jun 13 08:18:49 2026 Received: from stravinsky.debian.org (stravinsky.debian.org [82.195.75.108]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D911F3EF0C8; Fri, 8 May 2026 13:30:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=82.195.75.108 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778247020; cv=none; b=iFOJW+64LTMvie4FuIyoqZxtkhe1XaF0NY8+++jZ3j7fbOkPV6w31RcXOMwF7wRexQf67jkIt0sI0CJHpegFh6d3nlvpVcwx37vgCTPekthVQ6Giaozwsu+qNVd6HjE9+rY1cjjHw2Zd0aTQ+/P8I8YBZs39GNUXrBM25LKyNy8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778247020; c=relaxed/simple; bh=GCut3ieEWzJwDvrV9EKvxW+yE6TgayFDTE7Hcw9Em7s=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=bMVIaTl8qHHYecFvbBZKLc0OJXRKOkBJWax2rER7GcTwG+cZ++XG3lA9AgTPQSVqJBneUjWa2YgT0CKI/pGS+zwnA6gAZow0f6VoK4+QOTYKHQCQMm0Gh0v81c5ycJcwmHlSjzkTJGuGtWV+xWckYG+hjWvrYwavSfqMghFQQI8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=debian.org; spf=pass smtp.mailfrom=debian.org; dkim=pass (2048-bit key) header.d=debian.org header.i=@debian.org header.b=u6/bCcTL; arc=none smtp.client-ip=82.195.75.108 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=debian.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=debian.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=debian.org header.i=@debian.org header.b="u6/bCcTL" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debian.org; s=smtpauto.stravinsky; h=X-Debian-User:Cc:To:In-Reply-To:References: Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description; bh=sIUzyPzrM5JMnMUNbhqwM36aBxK6ebWQrwSmdyV+TzI=; b=u6/bCcTLKRMMJAMweqg8CnN6lL EMORAEv1MxE4b7cH+3A8pyX8qW9/Ij33GRarRrnqkyO2wvmnQNokBhGkeA9E/hGrPLsKipJCRIE29 /93MiohewMK/5ocTsmkb+W6Vj5WkBBPnoWDwYbM1CX5jJ+nz3KXjkAYgIc4gpuaaiNQrk1LIU9AKR 5UXS3WHJ2+DWi7RPsBv9mBEqiJI7eAt+rGIHJa/QA1gaCZOG5+V9QHvlfhLxIy0/QaoI09v8ULvIj ckIGSbpLyofQXJOLilHMnSI+NoIu94S/H1wQnpgQ6+DWOgLLAwOPeXWjRPSGOZv2GwjnYn7gGyBaC 3fLIs7sA==; Received: from authenticated user by stravinsky.debian.org with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.96) (envelope-from ) id 1wLLHN-005B0V-2D; Fri, 08 May 2026 13:30:09 +0000 From: Breno Leitao Date: Fri, 08 May 2026 06:29:22 -0700 Subject: [PATCH net-next 8/8] netconsole: move find_skb() from netpoll Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260508-netconsole_split-v1-8-0f660e62841f@debian.org> References: <20260508-netconsole_split-v1-0-0f660e62841f@debian.org> In-Reply-To: <20260508-netconsole_split-v1-0-0f660e62841f@debian.org> To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman , Andrew Lunn , Sebastian Andrzej Siewior , Clark Williams , Steven Rostedt Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-rt-devel@lists.linux.dev, Breno Leitao , kernel-team@meta.com X-Mailer: b4 0.16-dev-453a6 X-Developer-Signature: v=1; a=openpgp-sha256; l=4422; i=leitao@debian.org; h=from:subject:message-id; bh=GCut3ieEWzJwDvrV9EKvxW+yE6TgayFDTE7Hcw9Em7s=; b=owEBbQKS/ZANAwAIATWjk5/8eHdtAcsmYgBp/eU4CF6GDfOj3Hwg9IqzIQPZdehz5g17nY+mi lHiG2qhNWWJAjMEAAEIAB0WIQSshTmm6PRnAspKQ5s1o5Of/Hh3bQUCaf3lOAAKCRA1o5Of/Hh3 bfoUEACwvDEX7QebhylYdbMGVx88BOvOHHgx6Gg64V8x8JDwzG2YcajvtN8Cx3DXz2hkN9Uch1Q LflOZTt0wUFUQhN52eFbYy22T0Wzyrx+qa2Cw7EC7roiUP9pUz5W51dgZwigM3zgMzmveJsTYhW OqrUX6p+FK8imKHXZb/p8vg+I7TTwvmTfm1aY0fZacpmtXLJgg6X4RMJjWpUJGb6LICTPMIKmlZ QRGceYiOaBVZEX8+8CyriTnEdyhrinwSulttkwsMuEiEwN6K4CGQXVyXUnRn0geJ5RZb2IWmxBc 7znuF+FaJHJshfGbKOs96/V0iqQAnfF1U8IOQmj51EIasMbWvm6jG0ANuDO379tH2kVhkIOdV46 79+6o4knnmOTq2epZQHj3aghV9C1hi6m7JHqUVgS+92aQE9OYJrQDAX2ebIjM3DKspQNBtX5Hd1 69TgkjqGk9GeWONg6c1FsfAGaRHsvPrA1txnmeTI88+iaAFh1KpDMmqNO4cqXs4XpExoVwpNoTp MHEDoVaQP1p48Xcjqg8ZnmCmKUqxHQ7DzrbPtIAwRARoFP7CXsHtfxBmsmYDw9cvjUWte9HZU2/ 3PSkuSTsB8ltDYK1DPoHrwxzkBi+aNqEDp9omF7YWNo5Q8W2xS84O7+fOG7KGT8H2xkP/L6ayu5 fylYkCc6f68ZyBg== X-Developer-Key: i=leitao@debian.org; a=openpgp; fpr=AC8539A6E8F46702CA4A439B35A3939FFC78776D X-Debian-User: leitao find_skb() is the netconsole-specific entry into the netpoll skb pool: every other netpoll consumer (bonding, team, vlan, bridge, macvlan, dsa) builds its own sk_buff and never touches the pool. With netpoll_send_udp() (its only caller) now living in netconsole, find_skb() can join it. Move find_skb() into drivers/net/netconsole.c as a file-static helper, drop EXPORT_SYMBOL_GPL(find_skb) and remove its prototype from include/linux/netpoll.h. find_skb() calls zap_completion_queue() to drain TX completions before allocating. zap_completion_queue() also has a second caller inside netpoll itself (netpoll_poll_dev() runs it after each poll to free completed skbs), so it stays in net/core/netpoll.c. Promote it from file-static to EXPORT_SYMBOL_GPL with a forward declaration in include/linux/netpoll.h, and drop its old file-static forward declaration. The skb pool's lifecycle (np->skb_pool, np->refill_wq, refill_skbs(), refill_skbs_work_handler(), skb_pool_flush()) stays in netpoll: it is initialised in __netpoll_setup() and torn down in __netpoll_cleanup(), both of which remain netpoll's responsibility. The refill work queued via schedule_work(&np->refill_wq) from the moved find_skb() runs refill_skbs_work_handler() in netpoll without any further plumbing. Signed-off-by: Breno Leitao --- drivers/net/netconsole.c | 27 +++++++++++++++++++++++++++ include/linux/netpoll.h | 2 +- net/core/netpoll.c | 33 ++------------------------------- 3 files changed, 30 insertions(+), 32 deletions(-) diff --git a/drivers/net/netconsole.c b/drivers/net/netconsole.c index 48d2670bbdef5..817561d8b06bb 100644 --- a/drivers/net/netconsole.c +++ b/drivers/net/netconsole.c @@ -1653,6 +1653,33 @@ static struct notifier_block netconsole_netdev_notif= ier =3D { .notifier_call =3D netconsole_netdev_event, }; =20 +static struct sk_buff *find_skb(struct netpoll *np, int len, int reserve) +{ + int count =3D 0; + struct sk_buff *skb; + + zap_completion_queue(); +repeat: + + skb =3D alloc_skb(len, GFP_ATOMIC); + if (!skb) { + skb =3D skb_dequeue(&np->skb_pool); + schedule_work(&np->refill_wq); + } + + if (!skb) { + if (++count < 10) { + netpoll_poll_dev(np->dev); + goto repeat; + } + return NULL; + } + + refcount_set(&skb->users, 1); + skb_reserve(skb, reserve); + return skb; +} + static void netpoll_udp_checksum(struct netpoll *np, struct sk_buff *skb, int len) { diff --git a/include/linux/netpoll.h b/include/linux/netpoll.h index 1877d42ccbccf..c9a03d88263ef 100644 --- a/include/linux/netpoll.h +++ b/include/linux/netpoll.h @@ -73,7 +73,7 @@ void __netpoll_free(struct netpoll *np); 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 zap_completion_queue(void); =20 #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 c148b3b68cec9..956528904050e 100644 --- a/net/core/netpoll.c +++ b/net/core/netpoll.c @@ -51,8 +51,6 @@ sizeof(struct udphdr) + \ MAX_UDP_CHUNK) =20 -static void zap_completion_queue(void); - static unsigned int carrier_timeout =3D 4; module_param(carrier_timeout, uint, 0644); =20 @@ -238,7 +236,7 @@ static void refill_skbs(struct netpoll *np) } } =20 -static void zap_completion_queue(void) +void zap_completion_queue(void) { unsigned long flags; struct softnet_data *sd =3D &get_cpu_var(softnet_data); @@ -265,34 +263,7 @@ static void zap_completion_queue(void) =20 put_cpu_var(softnet_data); } - -struct sk_buff *find_skb(struct netpoll *np, int len, int reserve) -{ - int count =3D 0; - struct sk_buff *skb; - - zap_completion_queue(); -repeat: - - skb =3D alloc_skb(len, GFP_ATOMIC); - if (!skb) { - skb =3D skb_dequeue(&np->skb_pool); - schedule_work(&np->refill_wq); - } - - if (!skb) { - if (++count < 10) { - netpoll_poll_dev(np->dev); - goto repeat; - } - return NULL; - } - - refcount_set(&skb->users, 1); - skb_reserve(skb, reserve); - return skb; -} -EXPORT_SYMBOL_GPL(find_skb); +EXPORT_SYMBOL_GPL(zap_completion_queue); =20 static int netpoll_owner_active(struct net_device *dev) { --=20 2.53.0-Meta