[PATCH net-next v3 0/5] netconsole: Add support for msgid in sysdata

Gustavo Luiz Duarte posted 5 patches 3 months, 3 weeks ago
Documentation/networking/netconsole.rst            | 32 +++++++++++
drivers/net/netconsole.c                           | 66 ++++++++++++++++++++++
.../selftests/drivers/net/netcons_sysdata.sh       | 30 ++++++++++
3 files changed, 128 insertions(+)
[PATCH net-next v3 0/5] netconsole: Add support for msgid in sysdata
Posted by Gustavo Luiz Duarte 3 months, 3 weeks ago
This patch series introduces a new feature to netconsole which allows
appending a message ID to the userdata dictionary.

If the msgid feature is enabled, the message ID is built from a per-target 32
bit counter that is incremented and appended to every message sent to the target.

Example::
  echo 1 > "/sys/kernel/config/netconsole/cmdline0/userdata/msgid_enabled"
  echo "This is message #1" > /dev/kmsg
  echo "This is message #2" > /dev/kmsg
  13,434,54928466,-;This is message #1
   msgid=1
  13,435,54934019,-;This is message #2
   msgid=2

This feature can be used by the target to detect if messages were dropped or
reordered before reaching the target. This allows system administrators to
assess the reliability of their netconsole pipeline and detect loss of messages
due to network contention or temporary unavailability.

Suggested-by: Breno Leitao <leitao@debian.org>
Signed-off-by: Gustavo Luiz Duarte <gustavold@gmail.com>

---
Changes in v3:
- Add kdoc documentation for msgcounter.
- Link to v2: https://lore.kernel.org/r/20250612-netconsole-msgid-v2-0-d4c1abc84bac@gmail.com

Changes in v2:
- Use wrapping_assign_add() to avoid warnings in UBSAN and friends.
- Improve documentation to clarify wrapping and distinguish msgid from sequnum.
- Rebase and fix conflict in prepare_extradata().
- Link to v1: https://lore.kernel.org/r/20250611-netconsole-msgid-v1-0-1784a51feb1e@gmail.com

---
Gustavo Luiz Duarte (5):
      netconsole: introduce 'msgid' as a new sysdata field
      netconsole: implement configfs for msgid_enabled
      netconsole: append msgid to sysdata
      selftests: netconsole: Add tests for 'msgid' feature in sysdata
      docs: netconsole: document msgid feature

 Documentation/networking/netconsole.rst            | 32 +++++++++++
 drivers/net/netconsole.c                           | 66 ++++++++++++++++++++++
 .../selftests/drivers/net/netcons_sysdata.sh       | 30 ++++++++++
 3 files changed, 128 insertions(+)
---
base-commit: 08207f42d3ffee43c97f16baf03d7426a3c353ca
change-id: 20250609-netconsole-msgid-b93c6f8e9c60

Best regards,
-- 
Gustavo Luiz Duarte <gustavold@gmail.com>
Re: [PATCH net-next v3 0/5] netconsole: Add support for msgid in sysdata
Posted by Jakub Kicinski 3 months, 3 weeks ago
On Mon, 16 Jun 2025 10:08:34 -0700 Gustavo Luiz Duarte wrote:
> This patch series introduces a new feature to netconsole which allows
> appending a message ID to the userdata dictionary.
> 
> If the msgid feature is enabled, the message ID is built from a per-target 32
> bit counter that is incremented and appended to every message sent to the target.

Breno, could you review the last 3 patches? 
These LGTM
Re: [PATCH net-next v3 0/5] netconsole: Add support for msgid in sysdata
Posted by Breno Leitao 3 months, 3 weeks ago
Hello Jakub,

On Tue, Jun 17, 2025 at 06:42:17PM -0700, Jakub Kicinski wrote:
> On Mon, 16 Jun 2025 10:08:34 -0700 Gustavo Luiz Duarte wrote:
> > This patch series introduces a new feature to netconsole which allows
> > appending a message ID to the userdata dictionary.
> > 
> > If the msgid feature is enabled, the message ID is built from a per-target 32
> > bit counter that is incremented and appended to every message sent to the target.
> 
> Breno, could you review the last 3 patches? 

Sorry, yes. They all look good.

Feel free to merge them.

Thanks!
--breno