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

Documentation: netconsole: add support for cmdline targets

With the previous patches, there is no more limitation at modifying the
targets created at boot time (or module load time).

Document the way on how to create the configfs directories to be able to
modify these netconsole targets.

The design discussion about this topic could be found at:
https://lore.kernel.org/all/ZRWRal5bW93px4km@gmail.com/

Signed-off-by: Breno Leitao <leitao@debian.org>
Link: https://lore.kernel.org/r/20231012111401.333798-5-leitao@debian.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Breno Leitao and committed by
Jakub Kicinski
7eeb84d8 5fbd6cdb

+19 -3
+19 -3
Documentation/networking/netconsole.rst
··· 99 99 Dynamic reconfigurability is a useful addition to netconsole that enables 100 100 remote logging targets to be dynamically added, removed, or have their 101 101 parameters reconfigured at runtime from a configfs-based userspace interface. 102 - [ Note that the parameters of netconsole targets that were specified/created 103 - from the boot/module option are not exposed via this interface, and hence 104 - cannot be modified dynamically. ] 105 102 106 103 To include this feature, select CONFIG_NETCONSOLE_DYNAMIC when building the 107 104 netconsole module (or kernel, if netconsole is built-in). ··· 151 154 You can also update the local interface dynamically. This is especially 152 155 useful if you want to use interfaces that have newly come up (and may not 153 156 have existed when netconsole was loaded / initialized). 157 + 158 + Netconsole targets defined at boot time (or module load time) with the 159 + `netconsole=` param are assigned the name `cmdline<index>`. For example, the 160 + first target in the parameter is named `cmdline0`. You can control and modify 161 + these targets by creating configfs directories with the matching name. 162 + 163 + Let's suppose you have two netconsole targets defined at boot time:: 164 + 165 + netconsole=4444@10.0.0.1/eth1,9353@10.0.0.2/12:34:56:78:9a:bc;4444@10.0.0.1/eth1,9353@10.0.0.3/12:34:56:78:9a:bc 166 + 167 + You can modify these targets in runtime by creating the following targets:: 168 + 169 + mkdir cmdline0 170 + cat cmdline0/remote_ip 171 + 10.0.0.2 172 + 173 + mkdir cmdline1 174 + cat cmdline1/remote_ip 175 + 10.0.0.3 154 176 155 177 Extended console: 156 178 =================