Skip to content

netpoll: Untangle netpoll and netconsole

Breno Leitao linux-rt-devel lkml netdev 1 version In review

Get series with b4
b4 am [email protected] change-id 20250902-netpoll_untangle_v3-e9f41781334e

Versions newest first

  1. v1 Latest7 patches 14 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/7netconsole: Split UDP message building and sending operationsdrivers/net/netconsole.c include/linux/netpoll.h net/core/netpoll.c+21 -111 reply
2/7netpoll: move prepare skb functions to netconsoledrivers/net/netconsole.c include/linux/netpoll.h net/core/netpoll.c+150 -1511 reply
3/7netpoll: Move netpoll_cleanup implementation to netconsoledrivers/net/netconsole.c include/linux/netpoll.h net/core/netpoll.c+10 -113 replies
4/7netpoll: Export zap_completion_queueinclude/linux/netpoll.h net/core/netpoll.c+3 -33 replies
5/7netpoll: Move SKBs pool to netconsole sidedrivers/net/netconsole.c net/core/netpoll.c+56 -461 reply
6/7netpoll: Move find_skb() to netconsole and make it staticdrivers/net/netconsole.c include/linux/netpoll.h net/core/netpoll.c+27 -291 reply
7/7netpoll: Flush skb_pool as part of netconsole cleanupdrivers/net/netconsole.c net/core/netpoll.c+11 -143 replies

Reviews trailers per patch

6 of 7 patches have a Reviewed-by or Acked-by.

PatchWillem de Bruijn
1/7R-b
2/7R-b
3/7R-b
4/7R-b
5/7
6/7R-b
7/7R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/7] netpoll: Untangle netpoll and netconsole

This patch series refactors the netpoll and netconsole subsystems to achieve better separation of concerns and improved code modularity. The main goal is to move netconsole-specific functionality out of the generic netpoll core, making netpoll a cleaner, more focused transmission-only interface.

Current problems:
* SKB pool is only used by netconsole, but, available in all netpoll instances, wasting memory.
* Given, netpoll populates the SKB and send the package for netconsole, there is no way to have a fine grained lock, to protect only the SKB population (specifically the netconsole target ->buf).
* In the future (when netconsole supports nbcon), the SKB will be populated and the TX deferred, which is impossible in the current configuration.

Key architectural changes:

1. SKB Pool Management Migration: Move all SKB pool management from netpoll core to netconsole driver, since netconsole is the sole user of this functionality. This reduces memory overhead for other netpoll users.

2. UDP Packet Construction Separation: Move UDP/IP packet preparation logic from netpoll to netconsole, making netpoll purely SKB transmission-focused.

3. Function Splitting: Split netpoll_send_udp() into separate preparation (netpoll_prepare_skb) and transmission (netpoll_send_skb) operations for better modularity and locking strategies.

4. Cleanup Consolidation: Move netpoll_cleanup() implementation to netconsole since it's the only caller, centralizing cleanup logic.

5. Enable netconsole to support nbcon, as being discussed in [1].
* I have a PoC[2] for migrating netconsole to nbcon, which depends on this chage.

The series maintains full backward compatibility, and shouldn't have any visible change for the user.

To: Andrew Lunn <[email protected]>
To: "David S. Miller" <[email protected]>
To: Eric Dumazet <[email protected]>
To: Jakub Kicinski <[email protected]>
To: Paolo Abeni <[email protected]>
To: Simon Horman <[email protected]>
To: Sebastian Andrzej Siewior <[email protected]>
To: Clark Williams <[email protected]>
To: Steven Rostedt <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]

---
Breno Leitao (7):
netconsole: Split UDP message building and sending operations
netpoll: move prepare skb functions to netconsole
netpoll: Move netpoll_cleanup implementation to netconsole
netpoll: Export zap_completion_queue
netpoll: Move SKBs pool to netconsole side
netpoll: Move find_skb() to netconsole and make it static
netpoll: Flush skb_pool as part of netconsole cleanup

 drivers/net/netconsole.c | 273 +++++++++++++++++++++++++++++++++++++++++++++--
 include/linux/netpoll.h  |   2 +-
 net/core/netpoll.c       | 248 +-----------------------------------------
 3 files changed, 268 insertions(+), 255 deletions(-)

---
base-commit: 2fd4161d0d2547650d9559d57fc67b4e0a26a9e3
change-id: 20250902-netpoll_untangle_v3-e9f41781334e

Best regards,

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