Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

netconsole: Increase MAX_USERDATA_ITEMS

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>

authored by

Gustavo Luiz Duarte and committed by
Jakub Kicinski
5ad99453 eb83801a

+2 -2
+1 -1
drivers/net/netconsole.c
··· 50 50 /* The number 3 comes from userdata entry format characters (' ', '=', '\n') */ 51 51 #define MAX_EXTRADATA_NAME_LEN (MAX_EXTRADATA_ENTRY_LEN - \ 52 52 MAX_EXTRADATA_VALUE_LEN - 3) 53 - #define MAX_USERDATA_ITEMS 16 53 + #define MAX_USERDATA_ITEMS 256 54 54 #define MAX_PRINT_CHUNK 1000 55 55 56 56 static char config[MAX_PARAM_LENGTH];
+1 -1
tools/testing/selftests/drivers/net/netcons_overflow.sh
··· 15 15 16 16 source "${SCRIPTDIR}"/lib/sh/lib_netcons.sh 17 17 # This is coming from netconsole code. Check for it in drivers/net/netconsole.c 18 - MAX_USERDATA_ITEMS=16 18 + MAX_USERDATA_ITEMS=256 19 19 20 20 # Function to create userdata entries 21 21 function create_userdata_max_entries() {