From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=74.125.224.133 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796414513; b=Hn4tLH+pm5UifKVXcbf1ocsDDH/9g7kWfH/IsuOmAbmbEmjlUMxqNrGf92tO0nHBtk8i ryb8MrpnocUQLWgkMCtDbwmvkY9WnDySB4hFpYa/7TNcfMFLtuk94I4qCOJlh1RDwe6ex 9K3zpmTDuoFOLBmNZKl2US1txk/iQZgEK0zjKms00GqeWLT5vpeNdSbQ+WHZox4PcP+Cq EB2J+98NESswWmQOFZzNFjZmGyYVcnFsp+yUijfv7YEAWXSOT8bv1ZyibTjc2FPtwwxUU d0SemwcfcuMM8kE+UxutAY6n7KvilSXacDzPWpzQNwHEOAY9Nfk5jb/CVVpKEAR8b+w== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796414513; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: Date:Message-ID:From:Subject:To:Cc:MIME-Version:Content-Type: Content-Disposition:User-Agent; bh=otv9ZuxucfiEl1v6Bc3ndsCkvqCr9xFUCmWr+eX/FNk=; b=HRupLMs4yFxl19ePXQTyq9XRsd/3PYZbsNgWGRyhi/SFd+DP+VlhVX5crMu51NZi8pa8 D+fe9m1U4daGsGScDwXgVPRD5m6nuK8oLALTOGT9Ux5GORHMFY+2krrgif6cWeuFCNKCa Y6HEgJnMhkcGoF3ZUHXB41aKiQscbCuJHa8Ymy6HAzjbJUz53SmpKBLtZ8KybOpgOAmhY KSI+nw8F4+vmhJNkMLzfYPg/od1HshQg9aQmevxAq88/4nuuAJriw76Zn0puicZK57BbN 0oCsUiptjAm3QaUvbfrUXGzlRNbePDwCbnd1naSw4llPLuhTcoZOD6eYfcrqL0O0Jpw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=chrisdown.name; spf=pass smtp.mailfrom=chrisdown.name; dkim=pass header.d=chrisdown.name header.i=@chrisdown.name header.a=rsa-sha256 header.s=google header.b=SvjoFnBE; arc=none smtp.remote-ip=74.125.224.133 Received: from mail-yx2-f5.google.com (mail-yx2-f5.google.com [74.125.224.133]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F1262606A322 for ; Fri, 4 Dec 2026 20:01:52 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org F1262606A322 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=chrisdown.name Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chrisdown.name Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chrisdown.name header.i=@chrisdown.name header.a=rsa-sha256 header.s=google header.b=SvjoFnBE Received: by mail-yx2-f5.google.com with SMTP id 00721157ae682-8b50788d48eso2755507b3.0 for ; Fri, 04 Dec 2026 12:01:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chrisdown.name; s=google; t=1796414512; x=1797019312; darn=vger.kernel.org; h=user-agent:content-disposition:content-type:mime-version:cc:to :subject:from:message-id:date:from:to:cc:subject:date:message-id :reply-to:content-type; bh=otv9ZuxucfiEl1v6Bc3ndsCkvqCr9xFUCmWr+eX/FNk=; b=SvjoFnBEcxtxDOc+Hqq1ejCnFJWjAAqLJUY0zY0SXsCCR3oeGIe6Gbb9ei1aDTi+PN fPvqzCQ37x1SbJmbOeO9jMJUYJadU6VE7aEt47JLtYCEA6DkIqrf0hD2wdjdlINDKhfW fMRZ3QwGUFsKfjkAz0uV0X4ED5jbaKLjDW6/8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796414512; x=1797019312; h=user-agent:content-disposition:content-type:mime-version:cc:to :subject:from:message-id:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to:content-type; bh=otv9ZuxucfiEl1v6Bc3ndsCkvqCr9xFUCmWr+eX/FNk=; b=UmIeBQdw/BvqBNeyBIEzlL7u3ncyxhm0YW0j7Uc2hsqTgkDjPeHDyUee7bYjaYyX1I k0/CPfSbG8i1zCRevjJCNgMos9Y7nyH1wcUCR/Q2QDBW7Ep4HO5CzZKF1j4sNjDVkMDs ChDi356uCaQ3JO3vOn+KDYWCfedjpsMms8KsWw6EfeQjoX+YW6PDFH/kezxozaWTTeTy isLOfJQO9n1B0vSajRIpB+pRwCazNtKBJz+PJ8D7ByTZCgdsPQhoj4kkTxitePFMsdp0 tlPhVGExVzkBCf3IU1k18GWKVKk8LmnqLBRs0MsQBiyZpnHI5HGZyxFmZmKmmdJJJ0H3 fO5g== X-Forwarded-Encrypted: i=1; AL+hErHqMMyykBGSocViaGPAqTeuLGeJcsg7HwC6sgV+K1m5KZ/KxERUrZl4Z3rrXTFw9VDR7Gv+rIw=@vger.kernel.org X-Gm-Message-State: AB4q+uHtI6qTjopvcsYBEKA4Mri0J++k8tbfIEme1/UwmcqQLsQFF1kl RXTBhgeLEB/lgfH1DQP0q9mPc+hytH+M2e+EpcHyGowHt5+jKD5rWHVYgnsXQtdU/A0= X-Gm-Gg: AZFdTZcz8fBCaulPLziSM1ByTAtaF+K3z0Bdpn9LEjceRhNL6pgwx6EQt90hWmAjSD1 2KNdsdBuInrJPANwVSEPmWK7E52o0XyZVoBreN03cl24jAXw/9aviFOqlPI3v752jjQqDBpxEgf PoJCeqjLd1DeqmcHl6JSMTBMSNQtBtk1zZQ+/ioD5eLv5hB/HRcpg7XymeC6rKBJx0TjndWm6os zGxLSpPE24qg/SIxvWP4r4/7LKyn5RBUZ2DqzsfaSXynQWcgIBbwtmY8bJBiSg1imAlVoerpLeH IheGiqmRMkSQlFfwsOuAzznQ1nkzQflTlJJm6Th1FBLQLhtrvlRpit11cUZUVJOBr0W3nI3pdV8 0cBqAUNMKJbflWeMMjCjQA4CFu+vFV72Tb6wKamT1I+ygQHDlTjSyARtjtELgpSC0tGGZUJ0Lij 7iIA36WdaqPRa+1oI5bT96Nh1pPP2kVH6hAZbpGn6ViFPjH5BXSIkN/JioDKYZNtiCK1jUJexU9 o7IKnIDv2FvCDGu0Eh5fr+ovjBh0U8skdpo4x6ZhFKSa69ujHrWS3IqsmwLTpksjDBm8Ldaqx+q BvNET6fgD6r78LWkBSSSLIoM2P2Ds2mHr6SsDYIKDsLPHpwZnw3aR37zDyAiYgm/KMyF/De4+cb DucFGVbdJxwaM8yi233lG4wA1Pj3gEbgpQ9DagP/WTDTB8j8u/PS44wqABH/i824JUKPFX1j7/p UQ7vQ606q2r9JlyMRFN/y6CS6qQJ0raGllSVZ9wMO/Tt5Ze1P+ZN9rErZPD6S3ZCO7A/v9kVTAT Kdr4JLacSO4SV1RgO96mq8= X-Received: by 2002:a05:690c:4cbc:b0:8b4:c991:47b1 with SMTP id 00721157ae682-8b660d9e3e1mr12389257b3.59.1796414511725; Fri, 04 Dec 2026 12:01:51 -0800 (PST) Received: from [172.18.0.2] (c-73-207-185-9.hsd1.ga.comcast.net. [73.207.185.9]) by smtp.gmail.com with ESMTPSA id 00721157ae682-8b660d846besm14125527b3.25.2026.12.04.12.01.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Dec 2026 12:01:51 -0800 (PST) Date: Fri, 04 Dec 2026 12:01:48 -0800 Message-ID: From: Chris Down Subject: [PATCH 0/2] netconsole: give the console of each target a unique name To: Breno Leitao , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: Shuah Khan , Shuah Khan , Gustavo Luiz Duarte , 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 X-Mailing-List: netdev@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/2.4.3 (cc9e3943) (2026-10-09) 0d97bae9abbe ("netconsole: register one console per target") calls the console of a target netcons_, 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