]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
netconsole: Increase MAX_USERDATA_ITEMS
authorGustavo Luiz Duarte <gustavold@gmail.com>
Thu, 20 Nov 2025 00:14:52 +0000 (16:14 -0800)
committerJakub Kicinski <kuba@kernel.org>
Fri, 21 Nov 2025 02:47:18 +0000 (18:47 -0800)
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>
Reviewed-by: Breno Leitao <leitao@debian.org>
Link: https://patch.msgid.link/20251119-netconsole_dynamic_extradata-v3-4-497ac3191707@meta.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/netconsole.c
tools/testing/selftests/drivers/net/netcons_overflow.sh

index 0b350f82d91560840dfbbf97fcef3455b431cd7b..9cb4dfc242f5f797d89e546675e161b737bd0dee 100644 (file)
@@ -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_PRINT_CHUNK                        1000
 
 static char config[MAX_PARAM_LENGTH];
index 29bad56448a24a2d98c21bd53b74f3bc2ca7e64a..06089643b7716fb5cf6d061def9782746c079c3e 100755 (executable)
@@ -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() {