linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/7] netpoll: Untangle netpoll and netconsole
@ 2025-09-02 14:36 Breno Leitao
  2025-09-02 14:36 ` [PATCH 1/7] netconsole: Split UDP message building and sending operations Breno Leitao
                   ` (7 more replies)
  0 siblings, 8 replies; 22+ messages in thread
From: Breno Leitao @ 2025-09-02 14:36 UTC (permalink / raw)
  To: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Simon Horman, Sebastian Andrzej Siewior,
	Clark Williams, Steven Rostedt
  Cc: netdev, linux-kernel, linux-rt-devel, kernel-team, efault, calvin,
	Breno Leitao

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.

Link: https://lore.kernel.org/all/tgp5ddd2xdcvmkrhsyf2r6iav5a6ksvxk66xdw6ghur5g5ggee@cuz2o53younx/ [1]
Link: https://lore.kernel.org/all/b2qps3uywhmjaym4mht2wpxul4yqtuuayeoq4iv4k3zf5wdgh3@tocu6c7mj4lt/ [2]

To: Andrew Lunn <andrew+netdev@lunn.ch>
To: "David S. Miller" <davem@davemloft.net>
To: Eric Dumazet <edumazet@google.com>
To: Jakub Kicinski <kuba@kernel.org>
To: Paolo Abeni <pabeni@redhat.com>
To: Simon Horman <horms@kernel.org>
To: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
To: Clark Williams <clrkwllms@kernel.org>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: netdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Cc: linux-rt-devel@lists.linux.dev
Cc: kernel-team@meta.com
Cc: efault@gmx.de
Cc: calvin@wbinvd.org

Signed-off-by: Breno Leitao <leitao@debian.org>
---
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,
--  
Breno Leitao <leitao@debian.org>


^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2025-09-03 17:16 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-02 14:36 [PATCH 0/7] netpoll: Untangle netpoll and netconsole Breno Leitao
2025-09-02 14:36 ` [PATCH 1/7] netconsole: Split UDP message building and sending operations Breno Leitao
2025-09-02 22:41   ` Willem de Bruijn
2025-09-02 14:36 ` [PATCH 2/7] netpoll: move prepare skb functions to netconsole Breno Leitao
2025-09-02 22:44   ` Willem de Bruijn
2025-09-02 14:36 ` [PATCH 3/7] netpoll: Move netpoll_cleanup implementation " Breno Leitao
2025-09-02 22:49   ` Willem de Bruijn
2025-09-03 16:44     ` Breno Leitao
2025-09-03 17:13       ` Willem de Bruijn
2025-09-02 14:36 ` [PATCH 4/7] netpoll: Export zap_completion_queue Breno Leitao
2025-09-02 22:50   ` Willem de Bruijn
2025-09-03 16:51     ` Breno Leitao
2025-09-03 17:16       ` Willem de Bruijn
2025-09-02 14:36 ` [PATCH 5/7] netpoll: Move SKBs pool to netconsole side Breno Leitao
2025-09-02 22:56   ` Willem de Bruijn
2025-09-02 14:36 ` [PATCH 6/7] netpoll: Move find_skb() to netconsole and make it static Breno Leitao
2025-09-02 23:07   ` Willem de Bruijn
2025-09-02 14:36 ` [PATCH 7/7] netpoll: Flush skb_pool as part of netconsole cleanup Breno Leitao
2025-09-02 23:09   ` Willem de Bruijn
2025-09-03  0:09   ` Jakub Kicinski
2025-09-03 16:55     ` Breno Leitao
2025-09-02 15:23 ` [PATCH 0/7] netpoll: Untangle netpoll and netconsole Breno Leitao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).