mbox series

[net-next,v4,0/4] net: netconsole: configfs entries for boot target

Message ID 20231012111401.333798-1-leitao@debian.org (mailing list archive)
Headers show
Series net: netconsole: configfs entries for boot target | expand

Message

Breno Leitao Oct. 12, 2023, 11:13 a.m. UTC
There is a limitation in netconsole, where it is impossible to
disable or modify the target created from the command line parameter.
(netconsole=...).

"netconsole" cmdline parameter sets the remote IP, and if the remote IP
changes, the machine needs to be rebooted (with the new remote IP set in
the command line parameter).

This allows the user to modify a target without the need to restart the
machine.

This functionality sits on top of the dynamic target reconfiguration that is
already implemented in netconsole.

The way to modify a boot time target is creating special named configfs
directories, that will be associated with the targets coming from
`netconsole=...`.

Example:

Let's suppose you have two netconsole targets defined at boot time::

 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

You can modify these targets in runtime by creating the following targets::

 $ mkdir cmdline1
 $ cat cmdline1/remote_ip
 10.0.0.3
 $ echo 0 > cmdline1/enabled
 $ echo 10.0.0.4 > cmdline1/remote_ip
 $ echo 1 > cmdline1/enabled

==

Changelog:
 * Version 4:
	* Rename NETCONSOLE_PARAM_TARGET_NAME to NETCONSOLE_PARAM_TARGET_PREFIX

 * Version 3:
	* Move some functions around to avoid forward declaration

 * Version 2:
	* Replaced the name of the NETCONSOLE_PARAM_TARGET_NAME macro
	* Improved the code documentation
	* Improved the user documentation

Breno Leitao (4):
  netconsole: move init/cleanup functions lower
  netconsole: Initialize configfs_item for default targets
  netconsole: Attach cmdline target to dynamic target
  Documentation: netconsole: add support for cmdline targets

 Documentation/networking/netconsole.rst |  22 +++-
 drivers/net/netconsole.c                | 155 ++++++++++++++++--------
 2 files changed, 121 insertions(+), 56 deletions(-)

Comments

patchwork-bot+netdevbpf@kernel.org Oct. 14, 2023, 12:30 a.m. UTC | #1
Hello:

This series was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Thu, 12 Oct 2023 04:13:57 -0700 you wrote:
> There is a limitation in netconsole, where it is impossible to
> disable or modify the target created from the command line parameter.
> (netconsole=...).
> 
> "netconsole" cmdline parameter sets the remote IP, and if the remote IP
> changes, the machine needs to be rebooted (with the new remote IP set in
> the command line parameter).
> 
> [...]

Here is the summary with links:
  - [net-next,v4,1/4] netconsole: move init/cleanup functions lower
    https://git.kernel.org/netdev/net-next/c/28856ab2c0b5
  - [net-next,v4,2/4] netconsole: Initialize configfs_item for default targets
    https://git.kernel.org/netdev/net-next/c/131eeb45b961
  - [net-next,v4,3/4] netconsole: Attach cmdline target to dynamic target
    https://git.kernel.org/netdev/net-next/c/5fbd6cdbe304
  - [net-next,v4,4/4] Documentation: netconsole: add support for cmdline targets
    https://git.kernel.org/netdev/net-next/c/7eeb84d89f2e

You are awesome, thank you!