Netdev List
 help / color / mirror / Atom feed
* [PATCH 0/2] netconsole: give the console of each target a unique name
@ 2026-12-04 20:01 Chris Down
  2026-12-04 20:01 ` [PATCH 1/2] " Chris Down
  2026-12-04 20:01 ` [PATCH 2/2] selftests: netconsole: check that targets get distinct console names Chris Down
  0 siblings, 2 replies; 3+ messages in thread
From: Chris Down @ 2026-12-04 20:01 UTC (permalink / raw)
  To: Breno Leitao, Andrew Lunn, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni
  Cc: Shuah Khan, Shuah Khan, Gustavo Luiz Duarte, linux-kselftest,
	netdev, linux-kernel, pmladek, john.ogness, printk, kernel-team

0d97bae9abbe ("netconsole: register one console per target") calls the
console of a target netcons_<target name>, but only 15 characters of
that fit and a target made through configfs always has index 0, so
targets whose names start with the same seven characters all register
a console with the same name and index. At the moment that only means
that /proc/consoles can't tell them apart, but with the per-console
loglevel series [0] applied on top, the second such target fails to get
its directory in /sys/class/console, and the replay trigger planned for
netconsole [1] would go by the same names.

Patch 1 gives a new target the lowest index which no other target with
the same console name has. Two such targets then become, say,
netcons_target_0 and netcons_target_1, and a target with a short name
like foo is still netcons_foo0.

Patch 2 adds a selftest which creates two such targets and checks that
/proc/consoles lists a different console for each, since no test looks
at the console names so far.

Breno, 0d97bae9abbe says that names can collide, so you may well have
your own plans for this already. Patch 1 keeps the names you chose and
only uses the index to tell them apart, but please do tell me if you'd
rather go about it another way.

This is based on net-next, since nothing else has 0d97bae9abbe yet.

[0]: https://lore.kernel.org/r/84b8d91693e56f6026271bc40553bcb6657ab24d.1764272407.git.chris@chrisdown.name
[1]: https://lore.kernel.org/r/at84qygscue8crQi@gmail.com

Chris Down (2):
  netconsole: give the console of each target a unique name
  selftests: netconsole: check that targets get distinct console names

 drivers/net/netconsole.c                      | 43 +++++++++++-
 .../selftests/drivers/net/netconsole/Makefile |  1 +
 .../net/netconsole/netcons_console_name.sh    | 70 +++++++++++++++++++
 3 files changed, 113 insertions(+), 1 deletion(-)
 create mode 100755 tools/testing/selftests/drivers/net/netconsole/netcons_console_name.sh


base-commit: d5cf954cebe4f175dfd834e1dc471a3aa203ec7d
-- 
2.56.1


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

end of thread, other threads:[~2026-12-04 20:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-04 20:01 [PATCH 0/2] netconsole: give the console of each target a unique name Chris Down
2026-12-04 20:01 ` [PATCH 1/2] " Chris Down
2026-12-04 20:01 ` [PATCH 2/2] selftests: netconsole: check that targets get distinct console names Chris Down

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox