The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Chris Down <chris@chrisdown.name>
To: Breno Leitao <leitao@debian.org>,
	Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@kernel.org>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>
Cc: Shuah Khan <shuah@kernel.org>,
	Shuah Khan <skhan@linuxfoundation.org>,
	Gustavo Luiz Duarte <gustavold@gmail.com>,
	linux-kselftest@vger.kernel.org, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org, pmladek@suse.com,
	john.ogness@linutronix.de, printk@lists.linux.dev,
	kernel-team@meta.com
Subject: [PATCH 0/2] netconsole: give the console of each target a unique name
Date: Fri, 04 Dec 2026 12:01:48 -0800	[thread overview]
Message-ID: <cover.1796410817.git.chris@chrisdown.name> (raw)

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


             reply	other threads:[~2026-12-04 20:01 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-04 20:01 Chris Down [this message]
2026-12-04 20:01 ` [PATCH 1/2] netconsole: give the console of each target a unique name Chris Down
2026-12-04 20:01 ` [PATCH 2/2] selftests: netconsole: check that targets get distinct console names Chris Down

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cover.1796410817.git.chris@chrisdown.name \
    --to=chris@chrisdown.name \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=gustavold@gmail.com \
    --cc=john.ogness@linutronix.de \
    --cc=kernel-team@meta.com \
    --cc=kuba@kernel.org \
    --cc=leitao@debian.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=pmladek@suse.com \
    --cc=printk@lists.linux.dev \
    --cc=shuah@kernel.org \
    --cc=skhan@linuxfoundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox