Skip to content

netpoll: move out netconsole-specific functions

Breno Leitao linux-rt-devel lkml netdev 2 versions – Applied

Status from this message: This series was applied to netdev/net-next.git (main)

Get series with b4
b4 am [email protected] change-id 20260508-netconsole_split-4f8402a9a9ff

Versions newest first

  1. v2 Latest9 patches 0 repliesApplied 9/9
  2. v18 patches 2 repliesSuperseded

Changes in v2 from the cover letter

- rename and export {netpoll_}zap_completion_queue (Jakub)
- Change the commit to remove #include <net/udp.h> (Sashiko)
- Link to v1: https://patch.msgid.link/[email protected]

Patches in v2 All 9 applied

#Subject and filesSizeRepliesApplied
1/9netpoll: expose UDP packet builder helpers for netconsoleinclude/linux/netpoll.h net/core/netpoll.c+19 -70 repliesApplied
2/9netconsole: move netpoll_send_udp() from netpolldrivers/net/netconsole.c include/linux/netpoll.h net/core/netpoll.c+38 -380 repliesApplied
3/9netconsole: move push_ipv6() from netpolldrivers/net/netconsole.c include/linux/netpoll.h net/core/netpoll.c+23 -250 repliesApplied
4/9netconsole: move push_ipv4() from netpolldrivers/net/netconsole.c include/linux/netpoll.h net/core/netpoll.c+28 -300 repliesApplied
5/9netconsole: move push_eth() from netpolldrivers/net/netconsole.c include/linux/netpoll.h net/core/netpoll.c+14 -160 repliesApplied
6/9netconsole: move push_udp() from netpolldrivers/net/netconsole.c include/linux/netpoll.h net/core/netpoll.c+18 -200 repliesApplied
7/9netconsole: move netpoll_udp_checksum() from netpolldrivers/net/netconsole.c include/linux/netpoll.h net/core/netpoll.c+27 -290 repliesApplied
8/9netpoll: rename and export netpoll_zap_completion_queue()include/linux/netpoll.h net/core/netpoll.c+5 -50 repliesApplied
9/9netconsole: move find_skb() from netpolldrivers/net/netconsole.c include/linux/netpoll.h net/core/netpoll.c+28 -290 repliesApplied

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH net-next v2 0/9] netpoll: move out netconsole-specific functions

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.

---
Changes in v2:
- rename and export {netpoll_}zap_completion_queue (Jakub)
- Change the commit to remove #include <net/udp.h> (Sashiko)
- Link to v1: https://patch.msgid.link/[email protected]

---
Breno Leitao (9):
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
netpoll: rename and export netpoll_zap_completion_queue()
netconsole: move find_skb() from netpoll

 drivers/net/netconsole.c | 175 +++++++++++++++++++++++++++++++++++++++++++++
 include/linux/netpoll.h  |   2 +-
 net/core/netpoll.c       | 182 ++---------------------------------------------
 3 files changed, 180 insertions(+), 179 deletions(-)

---
base-commit: 73d587ae684d176fac9db94173f77d78a794ea4f
change-id: 20260508-netconsole_split-4f8402a9a9ff

Best regards,

Signature · 1 line
Breno Leitao <[email protected]>