|
Revision tags: v6.15, v6.15-rc7, v6.15-rc6, v6.15-rc5, v6.15-rc4, v6.15-rc3, v6.15-rc2, v6.15-rc1, v6.14, v6.14-rc7 |
|
| #
cfcc9239 |
| 14-Mar-2025 |
Breno Leitao <[email protected]> |
netconsole: append release to sysdata
Append the init_utsname()->release to sysdata buffer before sending the message in case the feature is set.
Signed-off-by: Breno Leitao <[email protected]> Rev
netconsole: append release to sysdata
Append the init_utsname()->release to sysdata buffer before sending the message in case the feature is set.
Signed-off-by: Breno Leitao <[email protected]> Reviewed-by: Simon Horman <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Paolo Abeni <[email protected]>
show more ...
|
| #
b92c6fc4 |
| 14-Mar-2025 |
Breno Leitao <[email protected]> |
netconsole: add 'sysdata' suffix to related functions
This commit appends a common "sysdata" suffix to functions responsible for appending data to sysdata.
This change enhances code clarity and pre
netconsole: add 'sysdata' suffix to related functions
This commit appends a common "sysdata" suffix to functions responsible for appending data to sysdata.
This change enhances code clarity and prevents naming conflicts with other "append" functions, particularly in anticipation of the upcoming inclusion of the `release` field in the next patch.
Signed-off-by: Breno Leitao <[email protected]> Reviewed-by: Simon Horman <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Paolo Abeni <[email protected]>
show more ...
|
| #
343f9022 |
| 14-Mar-2025 |
Breno Leitao <[email protected]> |
netconsole: implement configfs for release_enabled
Implement the configfs helpers to show and set release_enabled configfs directories under userdata.
When enabled, set the feature bit in netconsol
netconsole: implement configfs for release_enabled
Implement the configfs helpers to show and set release_enabled configfs directories under userdata.
When enabled, set the feature bit in netconsole_target->sysdata_fields.
Signed-off-by: Breno Leitao <[email protected]> Reviewed-by: Simon Horman <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Paolo Abeni <[email protected]>
show more ...
|
| #
42211e31 |
| 14-Mar-2025 |
Breno Leitao <[email protected]> |
netconsole: introduce 'release' as a new sysdata field
This commit adds a new feature to the sysdata structure, allowing the kernel release/version to be appended as part of sysdata. Additionally, i
netconsole: introduce 'release' as a new sysdata field
This commit adds a new feature to the sysdata structure, allowing the kernel release/version to be appended as part of sysdata. Additionally, it updates the logic to count this new field as a used entry when enabled.
Signed-off-by: Breno Leitao <[email protected]> Reviewed-by: Simon Horman <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Paolo Abeni <[email protected]>
show more ...
|
| #
6d6c1ba7 |
| 12-Mar-2025 |
Uday Shankar <[email protected]> |
net, treewide: define and use MAC_ADDR_STR_LEN
There are a few places in the tree which compute the length of the string representation of a MAC address as 3 * ETH_ALEN - 1. Define a constant for th
net, treewide: define and use MAC_ADDR_STR_LEN
There are a few places in the tree which compute the length of the string representation of a MAC address as 3 * ETH_ALEN - 1. Define a constant for this and use it where relevant. No functionality changes are expected.
Signed-off-by: Uday Shankar <[email protected]> Reviewed-by: Michal Swiatkowski <[email protected]> Acked-by: Johannes Berg <[email protected]> Reviewed-by: Breno Leitao <[email protected]> Reviewed-by: Simon Horman <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Paolo Abeni <[email protected]>
show more ...
|
|
Revision tags: v6.14-rc6, v6.14-rc5 |
|
| #
dd30ae53 |
| 28-Feb-2025 |
Breno Leitao <[email protected]> |
netconsole: add task name to extra data fields
This is the core patch for this whole patchset. Add support for including the current task's name in netconsole's extra data output. This adds a new ap
netconsole: add task name to extra data fields
This is the core patch for this whole patchset. Add support for including the current task's name in netconsole's extra data output. This adds a new append_taskname() function that writes the task name (from current->comm) into the target's extradata buffer, similar to how CPU numbers are handled.
The task name is included when the SYSDATA_TASKNAME field is set, appearing in the format "taskname=<name>" in the output. This additional context can help with debugging by showing which task generated each console message.
Signed-off-by: Breno Leitao <[email protected]> Reviewed-by: Simon Horman <[email protected]> Signed-off-by: Paolo Abeni <[email protected]>
show more ...
|
| #
09e87759 |
| 28-Feb-2025 |
Breno Leitao <[email protected]> |
netconsole: add configfs controls for taskname sysdata feature
Add configfs interface to enable/disable the taskname sysdata feature. This adds the following functionality:
The implementation follo
netconsole: add configfs controls for taskname sysdata feature
Add configfs interface to enable/disable the taskname sysdata feature. This adds the following functionality:
The implementation follows the same pattern as the existing CPU number feature, ensuring consistent behavior and error handling across sysdata features.
Signed-off-by: Breno Leitao <[email protected]> Reviewed-by: Simon Horman <[email protected]> Signed-off-by: Paolo Abeni <[email protected]>
show more ...
|
| #
33e4b29f |
| 28-Feb-2025 |
Breno Leitao <[email protected]> |
netconsole: add taskname to extradata entry count
New SYSDATA_TASKNAME feature flag to track when taskname append is enabled.
Additional check in count_extradata_entries() to include taskname in to
netconsole: add taskname to extradata entry count
New SYSDATA_TASKNAME feature flag to track when taskname append is enabled.
Additional check in count_extradata_entries() to include taskname in total, counting it as an entry in extradata. This function is used to check if we are not overflowing the number of extradata items.
Signed-off-by: Breno Leitao <[email protected]> Reviewed-by: Simon Horman <[email protected]> Signed-off-by: Paolo Abeni <[email protected]>
show more ...
|
| #
4d989521 |
| 28-Feb-2025 |
Breno Leitao <[email protected]> |
netconsole: refactor CPU number formatting into separate function
Extract CPU number formatting logic from prepare_extradata() into a new append_cpu_nr() function.
This refactoring improves code or
netconsole: refactor CPU number formatting into separate function
Extract CPU number formatting logic from prepare_extradata() into a new append_cpu_nr() function.
This refactoring improves code organization by isolating CPU number formatting into its own function while reducing the complexity of prepare_extradata().
The change prepares the codebase for the upcoming taskname feature by establishing a consistent pattern for handling sysdata features.
The CPU number formatting logic itself remains unchanged; only its location has moved to improve maintainability.
Signed-off-by: Breno Leitao <[email protected]> Reviewed-by: Simon Horman <[email protected]> Signed-off-by: Paolo Abeni <[email protected]>
show more ...
|
| #
efb878fb |
| 28-Feb-2025 |
Breno Leitao <[email protected]> |
netconsole: Make boolean comparison consistent
Convert the current state assignment to use explicit boolean conversion, making the code more robust and easier to read. This change adds a double-nega
netconsole: Make boolean comparison consistent
Convert the current state assignment to use explicit boolean conversion, making the code more robust and easier to read. This change adds a double-negation operator to ensure consistent boolean conversion as suggested by Paolo[1].
This approach aligns with the existing pattern used in sysdata_cpu_nr_enabled_show().
Link: https://lore.kernel.org/all/[email protected]/ [1] Signed-off-by: Breno Leitao <[email protected]> Reviewed-by: Simon Horman <[email protected]> Signed-off-by: Paolo Abeni <[email protected]>
show more ...
|
| #
8a683295 |
| 28-Feb-2025 |
Breno Leitao <[email protected]> |
netconsole: prefix CPU_NR sysdata feature with SYSDATA_
Rename the CPU_NR enum value to SYSDATA_CPU_NR to establish a consistent naming convention for sysdata features. This change prepares for upco
netconsole: prefix CPU_NR sysdata feature with SYSDATA_
Rename the CPU_NR enum value to SYSDATA_CPU_NR to establish a consistent naming convention for sysdata features. This change prepares for upcoming additions to the sysdata feature set by clearly grouping related features under the SYSDATA prefix.
This change is purely cosmetic and does not modify any functionality.
Signed-off-by: Breno Leitao <[email protected]> Reviewed-by: Simon Horman <[email protected]> Signed-off-by: Paolo Abeni <[email protected]>
show more ...
|
|
Revision tags: v6.14-rc4, v6.14-rc3, v6.14-rc2 |
|
| #
ec15bc46 |
| 06-Feb-2025 |
Breno Leitao <[email protected]> |
netconsole: add support for sysdata and CPU population
Add infrastructure to automatically append kernel-generated data (sysdata) to netconsole messages. As the first use case, implement CPU number
netconsole: add support for sysdata and CPU population
Add infrastructure to automatically append kernel-generated data (sysdata) to netconsole messages. As the first use case, implement CPU number population, which adds the CPU that sent the message.
This change introduces three distinct data types: - extradata: The complete set of appended data (sysdata + userdata) - userdata: User-provided key-value pairs from userspace - sysdata: Kernel-populated data (e.g. cpu=XX)
The implementation adds a new configfs attribute 'cpu_nr' to control CPU number population per target. When enabled, each message is tagged with its originating CPU. The sysdata is dynamically updated at message time and appended after any existing userdata.
The CPU number is formatted as "cpu=XX" and is added to the extradata buffer, respecting the existing size limits.
Signed-off-by: Breno Leitao <[email protected]> Reviewed-by: Simon Horman <[email protected]> Signed-off-by: David S. Miller <[email protected]>
show more ...
|
| #
2bae25b1 |
| 06-Feb-2025 |
Breno Leitao <[email protected]> |
netconsole: Include sysdata in extradata entry count
Modify count_extradata_entries() to include sysdata fields when calculating the total number of extradata entries. This change ensures that the s
netconsole: Include sysdata in extradata entry count
Modify count_extradata_entries() to include sysdata fields when calculating the total number of extradata entries. This change ensures that the sysdata feature, specifically the CPU number field, is correctly counted against the MAX_EXTRADATA_ITEMS limit.
The modification adds a simple check for the CPU_NR flag in the sysdata_fields, incrementing the entry count accordingly.
Signed-off-by: Breno Leitao <[email protected]> Reviewed-by: Simon Horman <[email protected]> Signed-off-by: David S. Miller <[email protected]>
show more ...
|
| #
364f6783 |
| 06-Feb-2025 |
Breno Leitao <[email protected]> |
netconsole: Introduce configfs helpers for sysdata features
This patch introduces a bitfield to store sysdata features in the netconsole_target struct. It also adds configfs helpers to enable or dis
netconsole: Introduce configfs helpers for sysdata features
This patch introduces a bitfield to store sysdata features in the netconsole_target struct. It also adds configfs helpers to enable or disable the CPU_NR feature, which populates the CPU number in sysdata.
The patch provides the necessary infrastructure to set or unset the CPU_NR feature, but does not modify the message itself.
Signed-off-by: Breno Leitao <[email protected]> Reviewed-by: Simon Horman <[email protected]> Signed-off-by: David S. Miller <[email protected]>
show more ...
|
| #
563fe939 |
| 06-Feb-2025 |
Breno Leitao <[email protected]> |
netconsole: Helper to count number of used entries
Add a helper function nr_extradata_entries() to count the number of used extradata entries in a netconsole target. This refactors the duplicate cod
netconsole: Helper to count number of used entries
Add a helper function nr_extradata_entries() to count the number of used extradata entries in a netconsole target. This refactors the duplicate code for counting entries into a single function, which will be reused by upcoming CPU sysdata changes.
The helper uses list_count_nodes() to count the number of children in the userdata group configfs hierarchy.
Signed-off-by: Breno Leitao <[email protected]> Reviewed-by: Simon Horman <[email protected]> Signed-off-by: David S. Miller <[email protected]>
show more ...
|
| #
4205f649 |
| 06-Feb-2025 |
Breno Leitao <[email protected]> |
netconsole: Rename userdata to extradata
Rename "userdata" to "extradata" since this structure will hold both user and system data in future patches. Keep "userdata" term only for data that comes fr
netconsole: Rename userdata to extradata
Rename "userdata" to "extradata" since this structure will hold both user and system data in future patches. Keep "userdata" term only for data that comes from userspace (configfs), while "extradata" encompasses both userdata and future kerneldata.
These are the rules of the design
1. extradata_complete will hold userdata and sysdata (coming) 2. sysdata will come after userdata_length 3. extradata_complete[userdata_length] string will be replaced at every message 5. userdata is replaced when configfs changes (update_userdata()) 6. sysdata is replaced at every message
Example: extradata_complete = "userkey=uservalue cpu=42" userdata_length = 17 sysdata_length = 7 (space (" ") is part of sysdata)
Since sysdata is still not available, you will see the following in the send functions:
extradata_len = nt->userdata_length;
The upcoming patches will, which will add support for sysdata, will change it to:
extradata_len = nt->userdata_length + sysdata_len;
Signed-off-by: Breno Leitao <[email protected]> Reviewed-by: Simon Horman <[email protected]> Signed-off-by: David S. Miller <[email protected]>
show more ...
|
| #
1c1377d7 |
| 06-Feb-2025 |
Breno Leitao <[email protected]> |
netconsole: consolidate send buffers into netconsole_target struct
Move the static buffers from send_msg_no_fragmentation() and send_msg_fragmented() into the netconsole_target structure. This simpl
netconsole: consolidate send buffers into netconsole_target struct
Move the static buffers from send_msg_no_fragmentation() and send_msg_fragmented() into the netconsole_target structure. This simplifies the code by: - Eliminating redundant static buffers - Centralizing buffer management in the target structure - Reducing memory usage by 1KB (one buffer instead of two)
The buffer in netconsole_target is protected by target_list_lock, maintaining the same synchronization semantics as the original code.
Suggested-by: Jakub Kicinski <[email protected]> Signed-off-by: Breno Leitao <[email protected]> Reviewed-by: Simon Horman <[email protected]> Signed-off-by: David S. Miller <[email protected]>
show more ...
|
|
Revision tags: v6.14-rc1, v6.13, v6.13-rc7 |
|
| #
e51c7478 |
| 08-Jan-2025 |
Breno Leitao <[email protected]> |
netconsole: Warn if MAX_USERDATA_ITEMS limit is exceeded
netconsole configfs helpers doesn't allow the creation of more than MAX_USERDATA_ITEMS items.
Add a warning when netconsole userdata update
netconsole: Warn if MAX_USERDATA_ITEMS limit is exceeded
netconsole configfs helpers doesn't allow the creation of more than MAX_USERDATA_ITEMS items.
Add a warning when netconsole userdata update function attempts sees more than MAX_USERDATA_ITEMS entries.
Replace silent ignore mechanism with WARN_ON_ONCE() to highlight potential misuse during development and debugging.
Signed-off-by: Breno Leitao <[email protected]> Reviewed-by: Simon Horman <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
show more ...
|
|
Revision tags: v6.13-rc6, v6.13-rc5, v6.13-rc4, v6.13-rc3, v6.13-rc2 |
|
| #
36de47bf |
| 02-Dec-2024 |
Maksym Kutsevol <[email protected]> |
netcons: Add udp send fail statistics to netconsole
Enhance observability of netconsole. Packet sends can fail. Start tracking at least two failure possibilities: ENOMEM and NET_XMIT_DROP for every
netcons: Add udp send fail statistics to netconsole
Enhance observability of netconsole. Packet sends can fail. Start tracking at least two failure possibilities: ENOMEM and NET_XMIT_DROP for every target. Stats are exposed via an additional attribute in CONFIGFS.
The exposed statistics allows easier debugging of cases when netconsole messages were not seen by receivers, eliminating the guesswork if the sender thinks that messages in question were sent out.
Stats are not reset on enable/disable/change remote ip/etc, they belong to the netcons target itself.
Reported-by: Breno Leitao <[email protected]> Closes: https://lore.kernel.org/all/[email protected]/ Signed-off-by: Maksym Kutsevol <[email protected]> Link: https://patch.msgid.link/20241202-netcons-add-udp-send-fail-statistics-to-netconsole-v5-2-70e82239f922@kutsevol.com Signed-off-by: Jakub Kicinski <[email protected]>
show more ...
|
|
Revision tags: v6.13-rc1, v6.12, v6.12-rc7, v6.12-rc6, v6.12-rc5, v6.12-rc4 |
|
| #
60be416c |
| 17-Oct-2024 |
Breno Leitao <[email protected]> |
net: netconsole: split send_msg_fragmented
Refactor the send_msg_fragmented() function by extracting the logic for sending the message body into a new function called send_fragmented_body().
Now, s
net: netconsole: split send_msg_fragmented
Refactor the send_msg_fragmented() function by extracting the logic for sending the message body into a new function called send_fragmented_body().
Now, send_msg_fragmented() handles appending the release and header, and then delegates the task of breaking up the body and sending the fragments to send_fragmented_body().
This is the final flow now:
When send_ext_msg_udp() is called to send a message, it will: - call send_msg_no_fragmentation() if no fragmentation is needed or - call send_msg_fragmented() if fragmentation is needed * send_msg_fragmented() appends the header to the buffer, which is be persisted until the function returns * call send_fragmented_body() to iterate and populate the body of the message. It will not touch the header, and it will only replace the body, writing the msgbody and/or userdata.
Also add some comment to make the code easier to review.
Signed-off-by: Breno Leitao <[email protected]> Reviewed-by: Simon Horman <[email protected]> Signed-off-by: Paolo Abeni <[email protected]>
show more ...
|
| #
144d5736 |
| 17-Oct-2024 |
Breno Leitao <[email protected]> |
net: netconsole: do not pass userdata up to the tail
Do not pass userdata to send_msg_fragmented, since we can get it later.
This will be more useful in the next patch, where send_msg_fragmented()
net: netconsole: do not pass userdata up to the tail
Do not pass userdata to send_msg_fragmented, since we can get it later.
This will be more useful in the next patch, where send_msg_fragmented() will be split even more, and userdata is only necessary in the last function.
Suggested-by: Simon Horman <[email protected]> Signed-off-by: Breno Leitao <[email protected]> Reviewed-by: Simon Horman <[email protected]> Signed-off-by: Paolo Abeni <[email protected]>
show more ...
|
| #
684dce1f |
| 17-Oct-2024 |
Breno Leitao <[email protected]> |
net: netconsole: extract release appending into separate function
Refactor the code by extracting the logic for appending the release into the buffer into a separate function.
The goal is to reduce
net: netconsole: extract release appending into separate function
Refactor the code by extracting the logic for appending the release into the buffer into a separate function.
The goal is to reduce the size of send_msg_fragmented() and improve code readability.
Signed-off-by: Breno Leitao <[email protected]> Reviewed-by: Simon Horman <[email protected]> Signed-off-by: Paolo Abeni <[email protected]>
show more ...
|
| #
b8dee8ed |
| 17-Oct-2024 |
Breno Leitao <[email protected]> |
net: netconsole: track explicitly if msgbody was written to buffer
The current check to determine if the message body was fully sent is difficult to follow. To improve clarity, introduce a variable
net: netconsole: track explicitly if msgbody was written to buffer
The current check to determine if the message body was fully sent is difficult to follow. To improve clarity, introduce a variable that explicitly tracks whether the message body (msgbody) has been completely sent, indicating when it's time to begin sending userdata.
Additionally, add comments to make the code more understandable for others who may work with it.
Signed-off-by: Breno Leitao <[email protected]> Reviewed-by: Simon Horman <[email protected]> Signed-off-by: Paolo Abeni <[email protected]>
show more ...
|
| #
606994ad |
| 17-Oct-2024 |
Breno Leitao <[email protected]> |
net: netconsole: introduce variable to track body length
This new variable tracks the total length of the data to be sent, encompassing both the message body (msgbody) and userdata, which is collect
net: netconsole: introduce variable to track body length
This new variable tracks the total length of the data to be sent, encompassing both the message body (msgbody) and userdata, which is collectively called body.
By explicitly defining body_len, the code becomes clearer and easier to reason about, simplifying offset calculations and improving overall readability of the function.
Signed-off-by: Breno Leitao <[email protected]> Reviewed-by: Simon Horman <[email protected]> Signed-off-by: Paolo Abeni <[email protected]>
show more ...
|
| #
e1fa5d23 |
| 17-Oct-2024 |
Breno Leitao <[email protected]> |
net: netconsole: rename body to msg_body
With the introduction of the userdata concept, the term body has become ambiguous and less intuitive.
To improve clarity, body is renamed to msg_body, makin
net: netconsole: rename body to msg_body
With the introduction of the userdata concept, the term body has become ambiguous and less intuitive.
To improve clarity, body is renamed to msg_body, making it clear that the body is not the only content following the header.
In an upcoming patch, the term body_len will also be revised for further clarity.
The current packet structure is as follows:
release, header, body, [msg_body + userdata]
Here, [msg_body + userdata] collectively forms what is currently referred to as "body." This renaming helps to distinguish and better understand each component of the packet.
Signed-off-by: Breno Leitao <[email protected]> Reviewed-by: Simon Horman <[email protected]> Signed-off-by: Paolo Abeni <[email protected]>
show more ...
|