Netdev List
 help / color / mirror / Atom feed
From: Breno Leitao <leitao@debian.org>
To: "David S. Miller" <davem@davemloft.net>,
	 Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>,
	 Paolo Abeni <pabeni@redhat.com>, Simon Horman <horms@kernel.org>,
	 Andrew Lunn <andrew+netdev@lunn.ch>,
	 Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
	 Clark Williams <clrkwllms@kernel.org>,
	Steven Rostedt <rostedt@goodmis.org>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	 linux-rt-devel@lists.linux.dev, Breno Leitao <leitao@debian.org>,
	 kernel-team@meta.com
Subject: [PATCH net-next 0/8] netpoll: move out netconsole-specific functions
Date: Fri, 08 May 2026 06:29:14 -0700	[thread overview]
Message-ID: <20260508-netconsole_split-v1-0-0f660e62841f@debian.org> (raw)

netpoll and netconsole were created together and their code has
been intermixed in net/core/netpoll.c for decades. The result is
that netpoll exposes two send-side interfaces:

 * a generic "give me an sk_buff" path used by every stacked-device
   driver (bonding, team, vlan, bridge, macvlan, dsa),

 * a second path that takes raw bytes and builds a UDP/IP/Ethernet
   packet -- exclusively for netconsole.

The packet builder, an skb pool allocator, and several
netconsole-specific helpers all live next to the generic plumbing even
though no other consumer ever touches them.

Worse, every netpoll user pays for that overlap: struct netpoll carries
an skb_pool and a refill work_struct that only netconsole's find_skb()
ever reads from, and net-core has to review unrelated changes (TTL, hop
limit, IP ID generation, source MAC selection, pool sizing) just because
they happen to be coded inside netpoll.

This is a waste of memory for something useless.

This series splits the netconsole-specific code out:

 * netpoll_send_udp() and its private helpers (push_ipv6, push_ipv4,
push_eth, push_udp, netpoll_udp_checksum, find_skb) move into
drivers/net/netconsole.c, leaving netpoll with a single skb-only
send interface that is the same for every user.

The moves are one function per patch for reviewability; helpers are
temporarily EXPORT_SYMBOL_GPL'd while netpoll_send_udp() is still in
netpoll calling them, then those exports are dropped together once
netpoll_send_udp() itself moves.

The only new permanent export is zap_completion_queue(), needed because
find_skb() still drains the per-CPU TX completion queue before
allocating.

struct netpoll is unchanged in this series; making the pool itself
netconsole-private (and reclaiming the skb_pool / refill_wq fields for
the rest of netpoll's users) is the natural follow-up, once this patchset
lands.

Signed-off-by: Breno Leitao <leitao@debian.org>
---
Breno Leitao (8):
      netpoll: expose UDP packet builder helpers for netconsole
      netconsole: move netpoll_send_udp() from netpoll
      netconsole: move push_ipv6() from netpoll
      netconsole: move push_ipv4() from netpoll
      netconsole: move push_eth() from netpoll
      netconsole: move push_udp() from netpoll
      netconsole: move netpoll_udp_checksum() from netpoll
      netconsole: move find_skb() from netpoll

 drivers/net/netconsole.c | 174 +++++++++++++++++++++++++++++++++++++++++++++
 include/linux/netpoll.h  |   2 +-
 net/core/netpoll.c       | 180 +----------------------------------------------
 3 files changed, 178 insertions(+), 178 deletions(-)
---
base-commit: 6a4c4656b0d2d4056a1f0c35442db4e8a5cf8021
change-id: 20260508-netconsole_split-4f8402a9a9ff

Best regards,
--  
Breno Leitao <leitao@debian.org>


             reply	other threads:[~2026-05-08 13:29 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-08 13:29 Breno Leitao [this message]
2026-05-08 13:29 ` [PATCH net-next 1/8] netpoll: expose UDP packet builder helpers for netconsole Breno Leitao
2026-05-08 13:29 ` [PATCH net-next 2/8] netconsole: move netpoll_send_udp() from netpoll Breno Leitao
2026-05-08 13:29 ` [PATCH net-next 3/8] netconsole: move push_ipv6() " Breno Leitao
2026-05-08 13:29 ` [PATCH net-next 4/8] netconsole: move push_ipv4() " Breno Leitao
2026-05-08 13:29 ` [PATCH net-next 5/8] netconsole: move push_eth() " Breno Leitao
2026-05-08 13:29 ` [PATCH net-next 6/8] netconsole: move push_udp() " Breno Leitao
2026-05-08 13:29 ` [PATCH net-next 7/8] netconsole: move netpoll_udp_checksum() " Breno Leitao
2026-05-08 13:29 ` [PATCH net-next 8/8] netconsole: move find_skb() " Breno Leitao
2026-05-12  1:37   ` Jakub Kicinski
2026-05-12  7:50     ` Breno Leitao

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260508-netconsole_split-v1-0-0f660e62841f@debian.org \
    --to=leitao@debian.org \
    --cc=andrew+netdev@lunn.ch \
    --cc=bigeasy@linutronix.de \
    --cc=clrkwllms@kernel.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=kernel-team@meta.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rt-devel@lists.linux.dev \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=rostedt@goodmis.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox