From: Gustavo Luiz Duarte <gustavold@gmail.com>
To: Breno Leitao <leitao@debian.org>,
Andre Carvalho <asantostc@gmail.com>,
Simon Horman <horms@kernel.org>,
Andrew Lunn <andrew+netdev@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>,
Paolo Abeni <pabeni@redhat.com>, Shuah Khan <shuah@kernel.org>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-kselftest@vger.kernel.org,
Gustavo Luiz Duarte <gustavold@gmail.com>
Subject: [PATCH net-next 4/4] netconsole: Increase MAX_USERDATA_ITEMS
Date: Wed, 05 Nov 2025 09:06:46 -0800 [thread overview]
Message-ID: <20251105-netconsole_dynamic_extradata-v1-4-142890bf4936@meta.com> (raw)
In-Reply-To: <20251105-netconsole_dynamic_extradata-v1-0-142890bf4936@meta.com>
Increase MAX_USERDATA_ITEMS from 16 to 256 entries now that the userdata
buffer is allocated dynamically.
The previous limit of 16 was necessary because the buffer was statically
allocated for all targets. With dynamic allocation, we can support more
entries without wasting memory on targets that don't use userdata.
This allows users to attach more metadata to their netconsole messages,
which is useful for complex debugging and logging scenarios.
Also update the testcase accordingly.
Signed-off-by: Gustavo Luiz Duarte <gustavold@gmail.com>
---
drivers/net/netconsole.c | 2 +-
tools/testing/selftests/drivers/net/netcons_overflow.sh | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/netconsole.c b/drivers/net/netconsole.c
index 8a11b3ca2763..040bae29d485 100644
--- a/drivers/net/netconsole.c
+++ b/drivers/net/netconsole.c
@@ -50,7 +50,7 @@ MODULE_LICENSE("GPL");
/* The number 3 comes from userdata entry format characters (' ', '=', '\n') */
#define MAX_EXTRADATA_NAME_LEN (MAX_EXTRADATA_ENTRY_LEN - \
MAX_EXTRADATA_VALUE_LEN - 3)
-#define MAX_USERDATA_ITEMS 16
+#define MAX_USERDATA_ITEMS 256
#define MAX_SYSDATA_ITEMS 4
#define MAX_PRINT_CHUNK 1000
diff --git a/tools/testing/selftests/drivers/net/netcons_overflow.sh b/tools/testing/selftests/drivers/net/netcons_overflow.sh
index 29bad56448a2..06089643b771 100755
--- a/tools/testing/selftests/drivers/net/netcons_overflow.sh
+++ b/tools/testing/selftests/drivers/net/netcons_overflow.sh
@@ -15,7 +15,7 @@ SCRIPTDIR=$(dirname "$(readlink -e "${BASH_SOURCE[0]}")")
source "${SCRIPTDIR}"/lib/sh/lib_netcons.sh
# This is coming from netconsole code. Check for it in drivers/net/netconsole.c
-MAX_USERDATA_ITEMS=16
+MAX_USERDATA_ITEMS=256
# Function to create userdata entries
function create_userdata_max_entries() {
--
2.47.3
prev parent reply other threads:[~2025-11-05 17:07 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-05 17:06 [PATCH net-next 0/4] netconsole: Allow userdata buffer to grow dynamically Gustavo Luiz Duarte
2025-11-05 17:06 ` [PATCH net-next 1/4] netconsole: Simplify send_fragmented_body() Gustavo Luiz Duarte
2025-11-07 12:15 ` Breno Leitao
2025-11-07 19:48 ` Gustavo Luiz Duarte
2025-11-05 17:06 ` [PATCH net-next 2/4] netconsole: Split userdata and sysdata Gustavo Luiz Duarte
2025-11-07 13:23 ` Breno Leitao
2025-11-07 20:53 ` Gustavo Luiz Duarte
2025-11-05 17:06 ` [PATCH net-next 3/4] netconsole: Dynamic allocation of userdata buffer Gustavo Luiz Duarte
2025-11-05 17:06 ` Gustavo Luiz Duarte [this message]
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=20251105-netconsole_dynamic_extradata-v1-4-142890bf4936@meta.com \
--to=gustavold@gmail.com \
--cc=andrew+netdev@lunn.ch \
--cc=asantostc@gmail.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--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=shuah@kernel.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;
as well as URLs for NNTP newsgroup(s).